Skip to content

Commit

Permalink
provide tests for 11.0 beta2
Browse files Browse the repository at this point in the history
Signed-off-by: Morris Jobke <[email protected]>
  • Loading branch information
MorrisJobke committed Nov 28, 2016
1 parent 0280c3e commit 418e9c4
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 11 deletions.
24 changes: 24 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,27 @@ pipeline:
when:
matrix:
TESTS: php54-master
php56-stable11:
image: nextcloudci/php5.6:php5.6-7
commands:
- make test-stable11
when:
matrix:
TESTS: php56-stable11
php70-stable11:
image: nextcloudci/php7.0:php7.0-6
commands:
- make test-stable11
when:
matrix:
TESTS: php70-stable11
php71-stable11:
image: nextcloudci/php7.1:php7.1-9
commands:
- make test-stable11
when:
matrix:
TESTS: php71-stable11
php56-master:
image: nextcloudci/php5.6:php5.6-7
commands:
Expand Down Expand Up @@ -141,6 +162,9 @@ matrix:
- TESTS: php70-stable9
- TESTS: php56-stable10
- TESTS: php70-stable10
- TESTS: php56-stable11
- TESTS: php70-stable11
- TESTS: php71-stable11
- TESTS: php56-master
- TESTS: php70-master
- TESTS: php71-master
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ test-stable9: updater.phar test/vendor
test-stable10: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/stable10.feature

test-stable11: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/stable11.feature

test-master: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/master.feature

Expand Down
22 changes: 11 additions & 11 deletions tests/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class FeatureContext implements Context
protected $serverDir;
protected $updateServerDir;
protected $tmpDownloadDir;
protected $downloadURL = 'https://download.nextcloud.com/server/releases/';
protected $dailyDownloadURL = 'https://download.nextcloud.com/server/daily/latest-';
protected $prereleasesDownloadURL = 'https://download.nextcloud.com/server/prereleases/';
protected $downloadURL = 'https://download.nextcloud.com/server/releases/';
protected $dailyDownloadURL = 'https://download.nextcloud.com/server/daily/latest-';
protected $prereleasesDownloadURL = 'https://download.nextcloud.com/server/prereleases/';
/** @var resource */
protected $updaterServerProcess = null;
/** @var string[] */
protected $CLIOutput;
/** @var integer */
protected $CLIReturnCode;
/** @var string[] */
protected $CLIOutput;
/** @var integer */
protected $CLIReturnCode;

public function __construct()
{
Expand Down Expand Up @@ -82,10 +82,10 @@ public function theCurrentInstalledVersionIs($installed, $version)
$fp = fopen($this->tmpDownloadDir . $filename, 'w+');
$url = $this->downloadURL . $filename;
if (strpos($version, 'RC') !== false || strpos($version, 'beta') !== false) {
$url = $this->prereleasesDownloadURL . $version . '.zip';
} else if(strpos($version, 'stable') !== false || strpos($version, 'master') !== false) {
$url = $this->dailyDownloadURL . $version . '.zip';
}
$url = $this->prereleasesDownloadURL . 'nextcloud-' . $version . '.zip';
} else if(strpos($version, 'stable') !== false || strpos($version, 'master') !== false) {
$url = $this->dailyDownloadURL . $version . '.zip';
}
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fp);
if(curl_exec($ch) === false) {
Expand Down
27 changes: 27 additions & 0 deletions tests/features/stable10.feature
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,30 @@ Feature: CLI updater - stable10 base
Then the installed version should be 11.0.0
And maintenance mode should be off
And upgrade is not required

Scenario: Update is available - stable10 to 11.0.0 beta 2
Given the current installed version is stable10
And there is an update to prerelease version of 11.0.0beta2 available
When the CLI updater is run successfully
And the output should contain "Update successful"
Then the installed version should be 11.0.0.5
And maintenance mode should be off
And upgrade is not required

Scenario: Update is available - 10.0.0 to 11.0.0 beta 2
Given the current installed version is 10.0.0
And there is an update to prerelease version of 11.0.0beta2 available
When the CLI updater is run successfully
And the output should contain "Update successful"
Then the installed version should be 11.0.0.5
And maintenance mode should be off
And upgrade is not required

Scenario: Update is available - 10.0.1 to 11.0.0 beta 2
Given the current installed version is 10.0.1
And there is an update to prerelease version of 11.0.0beta2 available
When the CLI updater is run successfully
And the output should contain "Update successful"
Then the installed version should be 11.0.0.5
And maintenance mode should be off
And upgrade is not required
11 changes: 11 additions & 0 deletions tests/features/stable11.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Feature: CLI updater - stable11 base

Scenario: Update is available - 11.0.0 beta to 11.0.0 beta 2
Given the current installed version is 11.0.0beta
And there is an update to prerelease version of 11.0.0beta2 available
And the version number is decreased in the config.php to enforce upgrade
When the CLI updater is run successfully
And the output should contain "Update successful"
Then the installed version should be 11.0.0.5
And maintenance mode should be off
And upgrade is not required

0 comments on commit 418e9c4

Please sign in to comment.