diff --git a/bin/travis/_includes.sh b/bin/travis/_includes.sh index 86cb6f4cd..2ce54076d 100755 --- a/bin/travis/_includes.sh +++ b/bin/travis/_includes.sh @@ -33,11 +33,13 @@ function assert_env_vars { ORCA_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" export ORCA_ROOT export ORCA_FIXTURE_DIR=${ORCA_FIXTURE_DIR:="$ORCA_ROOT/../orca-build"} +export ORCA_FIXTURE_PROFILE=${ORCA_FIXTURE_PROFILE:="orca"} export ORCA_SUT_DIR=${ORCA_SUT_DIR:=${TRAVIS_BUILD_DIR}} +export ORCA_SUT_HAS_NIGHTWATCH_TESTS=$(cd "$ORCA_SUT_DIR"; find . -regex ".*/Nightwatch/.*" -name \*.js) export ORCA_SUT_MACHINE_NAME=${ORCA_SUT_NAME##*\/} -export ORCA_FIXTURE_PROFILE=${ORCA_FIXTURE_PROFILE:="orca"} export ORCA_TELEMETRY_ENABLE=${ORCA_TELEMETRY_ENABLE:="FALSE"} export ORCA_AMPLITUDE_USER_ID=${ORCA_AMPLITUDE_USER_ID:="$ORCA_SUT_NAME:$ORCA_SUT_BRANCH"} +export ORCA_ENABLE_NIGHTWATCH=${ORCA_ENABLE_NIGHTWATCH:="TRUE"} export ORCA_YARN_DIR="${ORCA_FIXTURE_DIR}/docroot/core" export DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES="node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest" export DRUPAL_NIGHTWATCH_OUTPUT="sites/default/reports/nightwatch" @@ -48,9 +50,6 @@ export DRUPAL_TEST_DB_URL="sqlite://localhost/sites/default/files/db.sqlite" export DRUPAL_TEST_WEBDRIVER_CHROME_ARGS="--disable-gpu --headless --no-sandbox" export DRUPAL_TEST_WEBDRIVER_HOSTNAME="localhost" export DRUPAL_TEST_WEBDRIVER_PORT="4444" -# This "bult-in" variable isn't available to scripts and must be set manually. -TRAVIS_NODE_VERSION="$(node -v 2> /dev/null)" -export TRAVIS_NODE_VERSION # Override the available columns setting to prevent Drush output from wrapping # too narrowly. diff --git a/bin/travis/install.sh b/bin/travis/install.sh index bdd51fc3c..7272a7006 100755 --- a/bin/travis/install.sh +++ b/bin/travis/install.sh @@ -13,11 +13,10 @@ cd "$(dirname "$0")" || exit; source _includes.sh assert_env_vars -RUN_NIGHTWATCH=TRUE case "$ORCA_JOB" in - "STATIC_CODE_ANALYSIS") unset RUN_NIGHTWATCH ;; - "DEPRECATED_CODE_SCAN") orca debug:packages; eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --sut-only --no-site-install"; unset RUN_NIGHTWATCH ;; - "DEPRECATED_CODE_SCAN_CONTRIB") orca debug:packages; eval "orca fixture:init -f --no-site-install"; unset RUN_NIGHTWATCH ;; + "STATIC_CODE_ANALYSIS") unset ORCA_ENABLE_NIGHTWATCH ;; + "DEPRECATED_CODE_SCAN") orca debug:packages; eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --sut-only --no-site-install"; unset ORCA_ENABLE_NIGHTWATCH ;; + "DEPRECATED_CODE_SCAN_CONTRIB") orca debug:packages; eval "orca fixture:init -f --no-site-install"; unset ORCA_ENABLE_NIGHTWATCH ;; "ISOLATED_RECOMMENDED") orca debug:packages CURRENT_RECOMMENDED; eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --sut-only --core=CURRENT_RECOMMENDED --profile=$ORCA_FIXTURE_PROFILE" ;; "INTEGRATED_RECOMMENDED") orca debug:packages CURRENT_RECOMMENDED; eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --core=CURRENT_RECOMMENDED --profile=$ORCA_FIXTURE_PROFILE" ;; "CORE_PREVIOUS") orca debug:packages PREVIOUS_RELEASE; eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --core=PREVIOUS_RELEASE --profile=$ORCA_FIXTURE_PROFILE" ;; @@ -28,8 +27,7 @@ case "$ORCA_JOB" in "CUSTOM") eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --profile=$ORCA_FIXTURE_PROFILE ${ORCA_CUSTOM_FIXTURE_INIT_ARGS:=}" ;; esac -# Install yarn on relevant jobs if Node is installed and a fixture exists. -if [[ "$RUN_NIGHTWATCH" && "$TRAVIS_NODE_VERSION" && -d "$ORCA_YARN_DIR" ]]; then +if [[ "$ORCA_ENABLE_NIGHTWATCH" && "$ORCA_SUT_HAS_NIGHTWATCH_TESTS" && -d "$ORCA_YARN_DIR" ]]; then ( cd "$ORCA_YARN_DIR" || exit eval "yarn install" diff --git a/bin/travis/script.sh b/bin/travis/script.sh index 55bdfc156..1540b2eea 100755 --- a/bin/travis/script.sh +++ b/bin/travis/script.sh @@ -20,11 +20,10 @@ assert_env_vars # Thus if the SUT changes it, only its own tests are run. [[ "$ORCA_FIXTURE_PROFILE" = "orca" ]] || SUT_ONLY="--sut-only" -RUN_NIGHTWATCH=TRUE case "$ORCA_JOB" in - "STATIC_CODE_ANALYSIS") eval "orca qa:static-analysis $ORCA_SUT_DIR"; unset RUN_NIGHTWATCH ;; - "DEPRECATED_CODE_SCAN") eval "orca qa:deprecated-code-scan --sut=$ORCA_SUT_NAME"; unset RUN_NIGHTWATCH ;; - "DEPRECATED_CODE_SCAN_CONTRIB") eval "orca qa:deprecated-code-scan --contrib"; unset RUN_NIGHTWATCH ;; + "STATIC_CODE_ANALYSIS") eval "orca qa:static-analysis $ORCA_SUT_DIR"; unset ORCA_ENABLE_NIGHTWATCH ;; + "DEPRECATED_CODE_SCAN") eval "orca qa:deprecated-code-scan --sut=$ORCA_SUT_NAME"; unset ORCA_ENABLE_NIGHTWATCH ;; + "DEPRECATED_CODE_SCAN_CONTRIB") eval "orca qa:deprecated-code-scan --contrib"; unset ORCA_ENABLE_NIGHTWATCH ;; "ISOLATED_RECOMMENDED") eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME --sut-only" ;; "INTEGRATED_RECOMMENDED") eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME $SUT_ONLY --phpunit" @@ -47,9 +46,7 @@ case "$ORCA_JOB" in "CUSTOM") eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME ${ORCA_CUSTOM_TESTS_RUN_ARGS:=}" ;; esac -# Run Nightwatch tests on relevant jobs if Node is installed and a fixture -# exists. -if [[ "$RUN_NIGHTWATCH" && "$TRAVIS_NODE_VERSION" && -d "$ORCA_YARN_DIR" ]]; then +if [[ "$ORCA_ENABLE_NIGHTWATCH" && "$ORCA_SUT_HAS_NIGHTWATCH_TESTS" && -d "$ORCA_YARN_DIR" ]]; then ( cd "$ORCA_YARN_DIR" || exit orca fixture:run-server & diff --git a/config/VERSION b/config/VERSION index 2e7bd9108..53b5bbb12 100644 --- a/config/VERSION +++ b/config/VERSION @@ -1 +1 @@ -v1.5.0 +v1.5.1 diff --git a/example/.travis.yml b/example/.travis.yml index 2d3f6aae5..4ce988618 100644 --- a/example/.travis.yml +++ b/example/.travis.yml @@ -33,8 +33,7 @@ version: ~> 1.0 # @see https://docs.acquia.com/acquia-cloud/arch/tech-platform/ php: "7.2" -# Uncomment the following line to run Nightwatch tests in your package. -# node_js: "lts/*" +node_js: "lts/*" addons: # Chrome is used via ChromeDriver by PHPUnit and Behat. diff --git a/src/Command/Debug/DebugEnvVarsCommand.php b/src/Command/Debug/DebugEnvVarsCommand.php index ba98be0bb..216405f14 100644 --- a/src/Command/Debug/DebugEnvVarsCommand.php +++ b/src/Command/Debug/DebugEnvVarsCommand.php @@ -25,8 +25,10 @@ class DebugEnvVarsCommand extends Command { 'ORCA_PACKAGES_CONFIG_ALTER', 'ORCA_PHPCS_STANDARD', 'ORCA_ROOT', + 'ORCA_ENABLE_NIGHTWATCH', 'ORCA_SUT_BRANCH', 'ORCA_SUT_DIR', + 'ORCA_SUT_HAS_NIGHTWATCH_TESTS', 'ORCA_SUT_MACHINE_NAME', 'ORCA_SUT_NAME', 'ORCA_TELEMETRY_ENABLE',