From 72c055a9302ee97cced5bee296d1d60d14d708ca Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 23 Mar 2021 09:44:13 +0100 Subject: [PATCH] Update CLI tests to PHP 7.4 to 8.0 Signed-off-by: Morris Jobke --- .drone.yml | 50 ++++++++-------- tests/features/bootstrap/FeatureContext.php | 15 +++++ tests/features/cli.feature | 66 ++++++++++----------- 3 files changed, 73 insertions(+), 58 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1f59ce54..d149074c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,7 @@ name: check-same-code-base steps: - name: check-same-code-base - image: nextcloudci/php7.0:php7.0-19 + image: nextcloudci/php8.0:php8.0-1 commands: - make check-same-code-base @@ -17,11 +17,11 @@ trigger: --- kind: pipeline -name: php70-cli +name: php72-cli steps: - - name: php70-cli - image: nextcloudci/php7.0:php7.0-19 + - name: php72-cli + image: nextcloudci/php7.2:php7.2-14 commands: - make test-cli @@ -35,11 +35,29 @@ trigger: --- kind: pipeline -name: php71-cli +name: php73-cli steps: - - name: php71-cli - image: nextcloudci/php7.1:php7.1-16 + - name: php73-cli + image: nextcloudci/php7.3:php7.3-5 + commands: + - make test-cli + +trigger: + branch: + - master + - stable* + event: + - pull_request + - push + +--- +kind: pipeline +name: php74-cli + +steps: + - name: php74-cli + image: nextcloudci/php7.4:php7.4-3 commands: - make test-cli @@ -51,24 +69,6 @@ trigger: - pull_request - push -#--- -#kind: pipeline -#name: php72-cli -# -#steps: -# - name: php72-cli -# image: nextcloudci/php7.2:php7.2-12 -# commands: -# - make test-cli -# -#trigger: -# branch: -# - master -# - stable* -# event: -# - pull_request -# - push -# --- kind: pipeline name: php70-stable14 diff --git a/tests/features/bootstrap/FeatureContext.php b/tests/features/bootstrap/FeatureContext.php index 301030ff..c9fbd6fb 100644 --- a/tests/features/bootstrap/FeatureContext.php +++ b/tests/features/bootstrap/FeatureContext.php @@ -262,6 +262,21 @@ public function getSignatureForVersion($version) { CaZqjW7yCedKhj64F/SuXnUwaPhqTNNoDdhCN14IKvXCFYKLxm5UoGXrddwIcRrL rHSv7h5818aTjmj4sB1jsVrxNf32PgrUED8PUqgMYx1FxEzGyct4yj+GbIBi4D+K b813iKq4+cn3CjTunREm6A==', + + + + '19.0.2' => 'MfRJPu59KkLbJSICRyTyvtH4jLV6rwD5cTR3VTF7T5TqSwHLcOKDi7yEZK9qZKTm +qelJt17cUknifzJ+LKXwE26xua5SYA6KKGL1WIcaDKIJm8UMJhE3w7cMcxi79FVn +4Gs1jOc+TxTaM7hD32QzqIqLfYXmfXBjkV6zdNmqEXP8yHErdazU6+FSYbA5Z+JH ++LA46bRlAqZgf0NsfblCCpE5kAFlgMbZ4lpU6SfuNBWvIoX5k4iTtDvflQlpg58S +zY8iDQ+AZ2ttFoQ4MjfyTzM1VM0WDL5f70phVg4F+jG/JPxo9Qpyhq1Hy30ANPa0 +dNqXHF6Re45NNc0vwNHjEA==', + '20.0.1' => 'EDf7pKNahd9y/R6Gz69/i6DL/JcWddlqAvpibgvkKbBCX0cr5Oa7PZQzA26U2Ad8 +fdLgOjnBIKhSo10gn1D8/5pHjuIltFqUepdKFyvx3G/+1znA+S8VfKbDgItwHf1D +gaTtuEcHuONoX7yyCib5kr6YQX4Cx0ICJmrS+KBB0CHzGwAo8Cj98havcDo8vYr0 +wR+I/lo/45qAgfUrcNge2ZJdtlZj6VHn/I9zRhz2Q+MDNMRrKxZ/XN/8KhdDerTS +54QfoEoYbVRlLfjc45meKENdxM6/HK8XZckXkJI1Zc6XyubWsSYwnNWY1/GV5Zhd +mxDr4jUlvGQX1jFuzd4nLQ==', ]; if(isset($signatures[$version])) { diff --git a/tests/features/cli.feature b/tests/features/cli.feature index da4eae32..4adb6290 100644 --- a/tests/features/cli.feature +++ b/tests/features/cli.feature @@ -1,84 +1,84 @@ Feature: CLI updater - Scenario: No update is available - 12.0.0 - Given the current version is 12.0.0 + Scenario: No update is available - 20.0.0 + Given the current version is 20.0.0 When the CLI updater is run Then the output should contain "Could not find config.php. Is this file in the "updater" subfolder of Nextcloud?" - Scenario: No update is available - 12.0.0 - Given the current installed version is 12.0.0 + Scenario: No update is available - 20.0.0 + Given the current installed version is 20.0.0 And there is no update available When the CLI updater is run successfully - Then the installed version should be 12.0.0 + Then the installed version should be 20.0.0 And maintenance mode should be off And upgrade is not required - Scenario: Update is available - 12.0.0 to 12.0.1 - Given the current installed version is 12.0.0 - And there is an update to version 12.0.1 available + Scenario: Update is available - 20.0.0 to 20.0.1 + Given the current installed version is 20.0.0 + And there is an update to version 20.0.1 available When the CLI updater is run successfully - Then the installed version should be 12.0.1 + Then the installed version should be 20.0.1 And maintenance mode should be off And upgrade is not required - Scenario: Invalid update is available - 12.0.0 to 12.0.503 - Given the current installed version is 12.0.0 - And there is an update to version 12.0.503 available + Scenario: Invalid update is available - 20.0.0 to 20.0.503 + Given the current installed version is 20.0.0 + And there is an update to version 20.0.503 available When the CLI updater is run Then the return code should not be 0 And the output should contain "Download failed - Not Found (HTTP 404)" - And the installed version should be 12.0.0 + And the installed version should be 20.0.0 And maintenance mode should be off And upgrade is not required - Scenario: Update without valid signature is being offered - 11.0.0 to 11.0.1 - Given the current installed version is 11.0.0 + Scenario: Update without valid signature is being offered - 19.0.0 to 19.0.1 + Given the current installed version is 19.0.0 # This works because 11.0.1 is not in the signature list - And there is an update to version 11.0.1 available + And there is an update to version 19.0.1 available When the CLI updater is run Then the return code should not be 0 And the output should contain "Signature of update is not valid" - And the installed version should be 11.0.0 + And the installed version should be 19.0.0 And maintenance mode should be off And upgrade is not required - Scenario: Update to older version - 12.0.0 to 11.0.2 - Given the current installed version is 12.0.0 - And there is an update to version 11.0.2 available + Scenario: Update to older version - 20.0.0 to 19.0.2 + Given the current installed version is 20.0.0 + And there is an update to version 19.0.2 available When the CLI updater is run Then the return code should not be 0 And the output should contain "Downloaded version is lower than installed version" - And the installed version should be 12.0.0 + And the installed version should be 20.0.0 And maintenance mode should be off And upgrade is not required - Scenario: Update is available but autoupdate is disabled - 12.0.0 to 12.0.1 - Given the current installed version is 12.0.0 + Scenario: Update is available but autoupdate is disabled - 20.0.0 to 20.0.1 + Given the current installed version is 20.0.0 And the autoupdater is disabled - And there is an update to version 12.0.1 available + And there is an update to version 20.0.1 available When the CLI updater is run - Then the installed version should be 12.0.0 + Then the installed version should be 20.0.0 And maintenance mode should be off And upgrade is not required - Scenario: Update is available and apps2 folder is there and configured - 12.0.0 to 12.0.1 - Given the current installed version is 12.0.0 - And there is an update to version 12.0.1 available + Scenario: Update is available and apps2 folder is there and configured - 20.0.0 to 20.0.1 + Given the current installed version is 20.0.0 + And there is an update to version 20.0.1 available And there is a folder called "apps2" And there is a config for a secondary apps directory called "apps2" When the CLI updater is run successfully - Then the installed version should be 12.0.1 + Then the installed version should be 20.0.1 And maintenance mode should be off And upgrade is not required - Scenario: Update is available and apps2 folder is there and not configured - 12.0.0 to 12.0.1 - Given the current installed version is 12.0.0 - And there is an update to version 12.0.1 available + Scenario: Update is available and apps2 folder is there and not configured - 20.0.0 to 20.0.1 + Given the current installed version is 20.0.0 + And there is an update to version 20.0.1 available And there is a folder called "apps2" When the CLI updater is run Then the return code should not be 0 And the output should contain "The following extra files have been found" And the output should contain "apps2" - And the installed version should be 12.0.0 + And the installed version should be 20.0.0 And maintenance mode should be off And upgrade is not required