Skip to content

Commit

Permalink
Merge pull request #344 from nextcloud/backport/339/stable19
Browse files Browse the repository at this point in the history
[stable19] Update CLI tests to PHP 7.4 to 8.0
  • Loading branch information
MorrisJobke authored Mar 23, 2021
2 parents 068bc03 + 03db744 commit 0c487be
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 59 deletions.
50 changes: 25 additions & 25 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down
16 changes: 16 additions & 0 deletions tests/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,22 @@ 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==',
'19.0.3' => 'THIS IS AN INVALID SIGNATURE',
'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])) {
Expand Down
68 changes: 34 additions & 34 deletions tests/features/cli.feature
Original file line number Diff line number Diff line change
@@ -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
# This works because 11.0.1 is not in the signature list
And there is an update to version 11.0.1 available
Scenario: Update without valid signature is being offered - 19.0.0 to 19.0.3
Given the current installed version is 19.0.0
# This works because 19.0.3 is in the signature list with an invalid signature
And there is an update to version 19.0.3 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

0 comments on commit 0c487be

Please sign in to comment.