Skip to content

Commit 84a638d

Browse files
committed
Update CLI tests to PHP 7.4 to 8.0
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
1 parent e490062 commit 84a638d

File tree

3 files changed

+91
-58
lines changed

3 files changed

+91
-58
lines changed

.drone.yml

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: check-same-code-base
33

44
steps:
55
- name: check-same-code-base
6-
image: nextcloudci/php7.0:php7.0-19
6+
image: nextcloudci/php8.0:php8.0-1
77
commands:
88
- make check-same-code-base
99

@@ -17,11 +17,11 @@ trigger:
1717

1818
---
1919
kind: pipeline
20-
name: php70-cli
20+
name: php72-cli
2121

2222
steps:
23-
- name: php70-cli
24-
image: nextcloudci/php7.0:php7.0-19
23+
- name: php72-cli
24+
image: nextcloudci/php7.2:php7.2-14
2525
commands:
2626
- make test-cli
2727

@@ -35,11 +35,47 @@ trigger:
3535

3636
---
3737
kind: pipeline
38-
name: php71-cli
38+
name: php73-cli
3939

4040
steps:
41-
- name: php71-cli
42-
image: nextcloudci/php7.1:php7.1-16
41+
- name: php73-cli
42+
image: nextcloudci/php7.3:php7.3-5
43+
commands:
44+
- make test-cli
45+
46+
trigger:
47+
branch:
48+
- master
49+
- stable*
50+
event:
51+
- pull_request
52+
- push
53+
54+
---
55+
kind: pipeline
56+
name: php74-cli
57+
58+
steps:
59+
- name: php74-cli
60+
image: nextcloudci/php7.4:php7.4-3
61+
commands:
62+
- make test-cli
63+
64+
trigger:
65+
branch:
66+
- master
67+
- stable*
68+
event:
69+
- pull_request
70+
- push
71+
72+
---
73+
kind: pipeline
74+
name: php80-cli
75+
76+
steps:
77+
- name: php80-cli
78+
image: nextcloudci/php8.0:php8.0-1
4379
commands:
4480
- make test-cli
4581

@@ -51,24 +87,6 @@ trigger:
5187
- pull_request
5288
- push
5389

54-
#---
55-
#kind: pipeline
56-
#name: php72-cli
57-
#
58-
#steps:
59-
# - name: php72-cli
60-
# image: nextcloudci/php7.2:php7.2-12
61-
# commands:
62-
# - make test-cli
63-
#
64-
#trigger:
65-
# branch:
66-
# - master
67-
# - stable*
68-
# event:
69-
# - pull_request
70-
# - push
71-
#
7290
---
7391
kind: pipeline
7492
name: php70-stable14

tests/features/bootstrap/FeatureContext.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,21 @@ public function getSignatureForVersion($version) {
262262
CaZqjW7yCedKhj64F/SuXnUwaPhqTNNoDdhCN14IKvXCFYKLxm5UoGXrddwIcRrL
263263
rHSv7h5818aTjmj4sB1jsVrxNf32PgrUED8PUqgMYx1FxEzGyct4yj+GbIBi4D+K
264264
b813iKq4+cn3CjTunREm6A==',
265+
266+
267+
268+
'19.0.2' => 'MfRJPu59KkLbJSICRyTyvtH4jLV6rwD5cTR3VTF7T5TqSwHLcOKDi7yEZK9qZKTm
269+
qelJt17cUknifzJ+LKXwE26xua5SYA6KKGL1WIcaDKIJm8UMJhE3w7cMcxi79FVn
270+
4Gs1jOc+TxTaM7hD32QzqIqLfYXmfXBjkV6zdNmqEXP8yHErdazU6+FSYbA5Z+JH
271+
+LA46bRlAqZgf0NsfblCCpE5kAFlgMbZ4lpU6SfuNBWvIoX5k4iTtDvflQlpg58S
272+
zY8iDQ+AZ2ttFoQ4MjfyTzM1VM0WDL5f70phVg4F+jG/JPxo9Qpyhq1Hy30ANPa0
273+
dNqXHF6Re45NNc0vwNHjEA==',
274+
'20.0.1' => 'EDf7pKNahd9y/R6Gz69/i6DL/JcWddlqAvpibgvkKbBCX0cr5Oa7PZQzA26U2Ad8
275+
fdLgOjnBIKhSo10gn1D8/5pHjuIltFqUepdKFyvx3G/+1znA+S8VfKbDgItwHf1D
276+
gaTtuEcHuONoX7yyCib5kr6YQX4Cx0ICJmrS+KBB0CHzGwAo8Cj98havcDo8vYr0
277+
wR+I/lo/45qAgfUrcNge2ZJdtlZj6VHn/I9zRhz2Q+MDNMRrKxZ/XN/8KhdDerTS
278+
54QfoEoYbVRlLfjc45meKENdxM6/HK8XZckXkJI1Zc6XyubWsSYwnNWY1/GV5Zhd
279+
mxDr4jUlvGQX1jFuzd4nLQ==',
265280
];
266281

267282
if(isset($signatures[$version])) {

tests/features/cli.feature

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
11
Feature: CLI updater
22

3-
Scenario: No update is available - 12.0.0
4-
Given the current version is 12.0.0
3+
Scenario: No update is available - 20.0.0
4+
Given the current version is 20.0.0
55
When the CLI updater is run
66
Then the output should contain "Could not find config.php. Is this file in the "updater" subfolder of Nextcloud?"
77

8-
Scenario: No update is available - 12.0.0
9-
Given the current installed version is 12.0.0
8+
Scenario: No update is available - 20.0.0
9+
Given the current installed version is 20.0.0
1010
And there is no update available
1111
When the CLI updater is run successfully
12-
Then the installed version should be 12.0.0
12+
Then the installed version should be 20.0.0
1313
And maintenance mode should be off
1414
And upgrade is not required
1515

16-
Scenario: Update is available - 12.0.0 to 12.0.1
17-
Given the current installed version is 12.0.0
18-
And there is an update to version 12.0.1 available
16+
Scenario: Update is available - 20.0.0 to 20.0.1
17+
Given the current installed version is 20.0.0
18+
And there is an update to version 20.0.1 available
1919
When the CLI updater is run successfully
20-
Then the installed version should be 12.0.1
20+
Then the installed version should be 20.0.1
2121
And maintenance mode should be off
2222
And upgrade is not required
2323

24-
Scenario: Invalid update is available - 12.0.0 to 12.0.503
25-
Given the current installed version is 12.0.0
26-
And there is an update to version 12.0.503 available
24+
Scenario: Invalid update is available - 20.0.0 to 20.0.503
25+
Given the current installed version is 20.0.0
26+
And there is an update to version 20.0.503 available
2727
When the CLI updater is run
2828
Then the return code should not be 0
2929
And the output should contain "Download failed - Not Found (HTTP 404)"
30-
And the installed version should be 12.0.0
30+
And the installed version should be 20.0.0
3131
And maintenance mode should be off
3232
And upgrade is not required
3333

34-
Scenario: Update without valid signature is being offered - 11.0.0 to 11.0.1
35-
Given the current installed version is 11.0.0
34+
Scenario: Update without valid signature is being offered - 19.0.0 to 19.0.1
35+
Given the current installed version is 19.0.0
3636
# This works because 11.0.1 is not in the signature list
37-
And there is an update to version 11.0.1 available
37+
And there is an update to version 19.0.1 available
3838
When the CLI updater is run
3939
Then the return code should not be 0
4040
And the output should contain "Signature of update is not valid"
41-
And the installed version should be 11.0.0
41+
And the installed version should be 19.0.0
4242
And maintenance mode should be off
4343
And upgrade is not required
4444

45-
Scenario: Update to older version - 12.0.0 to 11.0.2
46-
Given the current installed version is 12.0.0
47-
And there is an update to version 11.0.2 available
45+
Scenario: Update to older version - 20.0.0 to 19.0.2
46+
Given the current installed version is 20.0.0
47+
And there is an update to version 19.0.2 available
4848
When the CLI updater is run
4949
Then the return code should not be 0
5050
And the output should contain "Downloaded version is lower than installed version"
51-
And the installed version should be 12.0.0
51+
And the installed version should be 20.0.0
5252
And maintenance mode should be off
5353
And upgrade is not required
5454

55-
Scenario: Update is available but autoupdate is disabled - 12.0.0 to 12.0.1
56-
Given the current installed version is 12.0.0
55+
Scenario: Update is available but autoupdate is disabled - 20.0.0 to 20.0.1
56+
Given the current installed version is 20.0.0
5757
And the autoupdater is disabled
58-
And there is an update to version 12.0.1 available
58+
And there is an update to version 20.0.1 available
5959
When the CLI updater is run
60-
Then the installed version should be 12.0.0
60+
Then the installed version should be 20.0.0
6161
And maintenance mode should be off
6262
And upgrade is not required
6363

64-
Scenario: Update is available and apps2 folder is there and configured - 12.0.0 to 12.0.1
65-
Given the current installed version is 12.0.0
66-
And there is an update to version 12.0.1 available
64+
Scenario: Update is available and apps2 folder is there and configured - 20.0.0 to 20.0.1
65+
Given the current installed version is 20.0.0
66+
And there is an update to version 20.0.1 available
6767
And there is a folder called "apps2"
6868
And there is a config for a secondary apps directory called "apps2"
6969
When the CLI updater is run successfully
70-
Then the installed version should be 12.0.1
70+
Then the installed version should be 20.0.1
7171
And maintenance mode should be off
7272
And upgrade is not required
7373

74-
Scenario: Update is available and apps2 folder is there and not configured - 12.0.0 to 12.0.1
75-
Given the current installed version is 12.0.0
76-
And there is an update to version 12.0.1 available
74+
Scenario: Update is available and apps2 folder is there and not configured - 20.0.0 to 20.0.1
75+
Given the current installed version is 20.0.0
76+
And there is an update to version 20.0.1 available
7777
And there is a folder called "apps2"
7878
When the CLI updater is run
7979
Then the return code should not be 0
8080
And the output should contain "The following extra files have been found"
8181
And the output should contain "apps2"
82-
And the installed version should be 12.0.0
82+
And the installed version should be 20.0.0
8383
And maintenance mode should be off
8484
And upgrade is not required

0 commit comments

Comments
 (0)