From 4505968fcb48f937dc686dc45b1fcbe5b7d8f8b5 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Tue, 22 Sep 2020 18:48:31 +0100 Subject: [PATCH] Tests: Remove redundant Python version tests (#1075) There were previously 6 virtually identical tests checking the handling of a non-existent Python version being specified in `runtime.txt`. Only one is necessary - removing the rest will improve CI run time. Closes @W-8110383@. [skip changelog] --- test/fixtures/python2_fail/requirements.txt | 1 - test/fixtures/python2_fail/runtime.txt | 1 - test/fixtures/python3_4_fail/requirements.txt | 1 - test/fixtures/python3_4_fail/runtime.txt | 1 - test/fixtures/python3_5_fail/requirements.txt | 1 - test/fixtures/python3_5_fail/runtime.txt | 1 - test/fixtures/python3_6_fail/requirements.txt | 1 - test/fixtures/python3_6_fail/runtime.txt | 1 - test/fixtures/python3_7_fail/requirements.txt | 1 - test/fixtures/python3_7_fail/runtime.txt | 1 - test/fixtures/python3_8_fail/requirements.txt | 1 - .../python_version_invalid/requirements.txt | 0 .../runtime.txt | 0 test/run-versions | 35 ++----------------- 14 files changed, 3 insertions(+), 43 deletions(-) delete mode 100644 test/fixtures/python2_fail/requirements.txt delete mode 100644 test/fixtures/python2_fail/runtime.txt delete mode 100644 test/fixtures/python3_4_fail/requirements.txt delete mode 100644 test/fixtures/python3_4_fail/runtime.txt delete mode 100644 test/fixtures/python3_5_fail/requirements.txt delete mode 100644 test/fixtures/python3_5_fail/runtime.txt delete mode 100644 test/fixtures/python3_6_fail/requirements.txt delete mode 100644 test/fixtures/python3_6_fail/runtime.txt delete mode 100644 test/fixtures/python3_7_fail/requirements.txt delete mode 100644 test/fixtures/python3_7_fail/runtime.txt delete mode 100644 test/fixtures/python3_8_fail/requirements.txt create mode 100644 test/fixtures/python_version_invalid/requirements.txt rename test/fixtures/{python3_8_fail => python_version_invalid}/runtime.txt (100%) diff --git a/test/fixtures/python2_fail/requirements.txt b/test/fixtures/python2_fail/requirements.txt deleted file mode 100644 index 663bd1f..0000000 --- a/test/fixtures/python2_fail/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -requests \ No newline at end of file diff --git a/test/fixtures/python2_fail/runtime.txt b/test/fixtures/python2_fail/runtime.txt deleted file mode 100644 index 3ee578b..0000000 --- a/test/fixtures/python2_fail/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-2.7.99 diff --git a/test/fixtures/python3_4_fail/requirements.txt b/test/fixtures/python3_4_fail/requirements.txt deleted file mode 100644 index 7e10602..0000000 --- a/test/fixtures/python3_4_fail/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -flask diff --git a/test/fixtures/python3_4_fail/runtime.txt b/test/fixtures/python3_4_fail/runtime.txt deleted file mode 100644 index 1314c85..0000000 --- a/test/fixtures/python3_4_fail/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-3.4.99 diff --git a/test/fixtures/python3_5_fail/requirements.txt b/test/fixtures/python3_5_fail/requirements.txt deleted file mode 100644 index 7e10602..0000000 --- a/test/fixtures/python3_5_fail/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -flask diff --git a/test/fixtures/python3_5_fail/runtime.txt b/test/fixtures/python3_5_fail/runtime.txt deleted file mode 100644 index 92d15aa..0000000 --- a/test/fixtures/python3_5_fail/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-3.5.99 diff --git a/test/fixtures/python3_6_fail/requirements.txt b/test/fixtures/python3_6_fail/requirements.txt deleted file mode 100644 index 7e10602..0000000 --- a/test/fixtures/python3_6_fail/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -flask diff --git a/test/fixtures/python3_6_fail/runtime.txt b/test/fixtures/python3_6_fail/runtime.txt deleted file mode 100644 index f0e0c19..0000000 --- a/test/fixtures/python3_6_fail/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-3.6.99 diff --git a/test/fixtures/python3_7_fail/requirements.txt b/test/fixtures/python3_7_fail/requirements.txt deleted file mode 100644 index 7e10602..0000000 --- a/test/fixtures/python3_7_fail/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -flask diff --git a/test/fixtures/python3_7_fail/runtime.txt b/test/fixtures/python3_7_fail/runtime.txt deleted file mode 100644 index e7217e5..0000000 --- a/test/fixtures/python3_7_fail/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-3.7.99 diff --git a/test/fixtures/python3_8_fail/requirements.txt b/test/fixtures/python3_8_fail/requirements.txt deleted file mode 100644 index 7e10602..0000000 --- a/test/fixtures/python3_8_fail/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -flask diff --git a/test/fixtures/python_version_invalid/requirements.txt b/test/fixtures/python_version_invalid/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/test/fixtures/python3_8_fail/runtime.txt b/test/fixtures/python_version_invalid/runtime.txt similarity index 100% rename from test/fixtures/python3_8_fail/runtime.txt rename to test/fixtures/python_version_invalid/runtime.txt diff --git a/test/run-versions b/test/run-versions index a2f2a09..f41366b 100755 --- a/test/run-versions +++ b/test/run-versions @@ -35,12 +35,6 @@ testPython2_warn() { assertCapturedSuccess } -testPython2_fail() { - compile "python2_fail" - assertCaptured "Aborting" - assertCapturedError -} - testPython3_4() { compile "python3_4" assertCaptured $LATEST_34 @@ -56,12 +50,6 @@ testPython3_4_warn() { assertCapturedSuccess } -testPython3_4_fail() { - compile "python3_4_fail" - assertCaptured "Aborting" - assertCapturedError -} - testPython3_5() { compile "python3_5" assertCaptured $LATEST_35 @@ -78,12 +66,6 @@ testPython3_5_warn() { assertCapturedSuccess } -testPython3_5_fail() { - compile "python3_5_fail" - assertCaptured "Aborting" - assertCapturedError -} - testPython3_6() { updateVersion "python3_6" $LATEST_36 compile "python3_6" @@ -102,12 +84,6 @@ testPython3_6_warn() { assertCapturedSuccess } -testPython3_6_fail() { - compile "python3_6_fail" - assertCaptured "Aborting" - assertCapturedError -} - testPython3_7() { updateVersion "python3_7" $LATEST_37 compile "python3_7" @@ -134,12 +110,6 @@ testPython3_7_warn() { fi } -testPython3_7_fail() { - compile "python3_7_fail" - assertCaptured "Aborting" - assertCapturedError -} - testPython3_8() { updateVersion "python3_8" $LATEST_38 compile "python3_8" @@ -166,8 +136,9 @@ testPython3_8_warn() { fi } -testPython3_8_fail() { - compile "python3_8_fail" +testPythonVersionInvalid() { + compile "python_version_invalid" + assertCaptured "Requested runtime (python-3.8.99) is not available for this stack" assertCaptured "Aborting" assertCapturedError }