Generalize names and descriptions

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
pull/4208/head
Daniel Calviño Sánchez 8 years ago
parent 72310cdac1
commit bbe479bcd9
  1. 4
      .drone.yml
  2. 8
      build/acceptance/features/core/NextcloudTestServerLocalHelper.php
  3. 16
      build/acceptance/run-local.sh

@ -481,14 +481,14 @@ pipeline:
acceptance-access-levels: acceptance-access-levels:
image: nextcloudci/php7.0:php7.0-7 image: nextcloudci/php7.0:php7.0-7
commands: commands:
- build/acceptance/run-drone.sh features/access-levels.feature - build/acceptance/run-local.sh features/access-levels.feature
when: when:
matrix: matrix:
TESTS-ACCEPTANCE: access-levels TESTS-ACCEPTANCE: access-levels
acceptance-login: acceptance-login:
image: nextcloudci/php7.0:php7.0-7 image: nextcloudci/php7.0:php7.0-7
commands: commands:
- build/acceptance/run-drone.sh features/login.feature - build/acceptance/run-local.sh features/login.feature
when: when:
matrix: matrix:
TESTS-ACCEPTANCE: login TESTS-ACCEPTANCE: login

@ -22,8 +22,8 @@
*/ */
/** /**
* Helper to manage a Nextcloud test server when acceptance tests are run in a * Helper to manage a Nextcloud test server started directly by the acceptance
* Drone step. * tests themselves using the PHP built-in web server.
* *
* The Nextcloud test server is executed using the PHP built-in web server * The Nextcloud test server is executed using the PHP built-in web server
* directly from the grandparent directory of the acceptance tests directory * directly from the grandparent directory of the acceptance tests directory
@ -40,7 +40,7 @@
* by running "occ maintenance:install"). The base URL to access the Nextcloud * by running "occ maintenance:install"). The base URL to access the Nextcloud
* server can be got from "getBaseUrl". * server can be got from "getBaseUrl".
*/ */
class NextcloudTestServerDroneHelper implements NextcloudTestServerHelper { class NextcloudTestServerLocalHelper implements NextcloudTestServerHelper {
/** /**
* @var string * @var string
@ -48,7 +48,7 @@ class NextcloudTestServerDroneHelper implements NextcloudTestServerHelper {
private $phpServerPid; private $phpServerPid;
/** /**
* Creates a new NextcloudTestServerDroneHelper. * Creates a new NextcloudTestServerLocalHelper.
*/ */
public function __construct() { public function __construct() {
$this->phpServerPid = ""; $this->phpServerPid = "";

@ -18,7 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# Helper script to run the acceptance tests, which test a running Nextcloud # Helper script to run the acceptance tests, which test a running Nextcloud
# instance from the point of view of a real user, in a Drone step. # instance from the point of view of a real user, configured to start the
# Nextcloud server themselves and from their grandparent directory.
# #
# The acceptance tests are written in Behat so, besides running the tests, this # The acceptance tests are written in Behat so, besides running the tests, this
# script installs Behat, its dependencies, and some related packages in the # script installs Behat, its dependencies, and some related packages in the
@ -28,7 +29,8 @@
# snapshot of the whole grandparent directory (no .gitignore file is used) in # snapshot of the whole grandparent directory (no .gitignore file is used) in
# the Git repository. Finally, the acceptance tests also use the Selenium server # the Git repository. Finally, the acceptance tests also use the Selenium server
# to control a web browser, so this script waits for the Selenium server # to control a web browser, so this script waits for the Selenium server
# (provided in its own Drone service) to be ready before running the tests. # (which should have been started before executing this script) to be ready
# before running the tests.
# Exit immediately on errors. # Exit immediately on errors.
set -o errexit set -o errexit
@ -51,9 +53,9 @@ ORIGINAL="\
- NextcloudTestServerContext" - NextcloudTestServerContext"
REPLACEMENT="\ REPLACEMENT="\
- NextcloudTestServerContext:\n\ - NextcloudTestServerContext:\n\
nextcloudTestServerHelper: NextcloudTestServerDroneHelper\n\ nextcloudTestServerHelper: NextcloudTestServerLocalHelper\n\
nextcloudTestServerHelperParameters:" nextcloudTestServerHelperParameters:"
sed "s/$ORIGINAL/$REPLACEMENT/" config/behat.yml > config/behat-drone.yml sed "s/$ORIGINAL/$REPLACEMENT/" config/behat.yml > config/behat-local.yml
cd ../../ cd ../../
@ -66,10 +68,8 @@ git add --all && echo 'Default state' | git -c user.name='John Doe' -c user.emai
cd build/acceptance cd build/acceptance
# The Selenium server should be ready by now, as Composer typically takes way # Ensure that the Selenium server is ready before running the tests.
# longer to execute than its startup (which is done in parallel in a Drone
# service), but just in case.
echo "Waiting for Selenium" echo "Waiting for Selenium"
timeout 60s bash -c "while ! curl 127.0.0.1:4444 >/dev/null 2>&1; do sleep 1; done" timeout 60s bash -c "while ! curl 127.0.0.1:4444 >/dev/null 2>&1; do sleep 1; done"
vendor/bin/behat --config=config/behat-drone.yml $SCENARIO_TO_RUN vendor/bin/behat --config=config/behat-local.yml $SCENARIO_TO_RUN
Loading…
Cancel
Save