From 5ebe8a647d01230993e2ddbfb123d29e3e3b2c70 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 16 Jun 2020 11:05:33 +0200 Subject: [PATCH 1/2] MOBILE-3294: Fix travis cron condition --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index bb544ad1b..027044d84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -109,17 +109,17 @@ jobs: name: "End to end tests (mod_forum, mod_messages and mod_comments)" services: - docker - if: env(TRAVIS_EVENT_TYPE) = cron + if: type = cron script: scripts/test_e2e.sh "@app&&@mod_forum" "@app&&@mod_messages" "@app&&@mod_comments" - stage: test name: "End to end tests (mod_data, mod_survey, mod_course, core_course and mod_courses)" services: - docker - if: env(TRAVIS_EVENT_TYPE) = cron + if: type = cron script: scripts/test_e2e.sh "@app&&@mod_data" "@app&&@mod_survey" "@app&&@mod_course" "@app&&@core_course" "@app&&@mod_courses" - stage: test name: "End to end tests (others)" services: - docker - if: env(TRAVIS_EVENT_TYPE) = cron + if: type = cron script: scripts/test_e2e.sh "@app&&~@mod_forum&&~@mod_messages&&~@mod_comments&&~@mod_data&&~@mod_survey&&~@mod_course&&~@core_course&&~@mod_courses" From 7795e4921b443453d792d0d6677d7233f1cc75f8 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 16 Jun 2020 17:32:05 +0200 Subject: [PATCH 2/2] MOBILE-3294: Relay compose exit code and filter cron jobs --- .travis.yml | 4 ++-- scripts/test_e2e.sh | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 027044d84..f7dfb6833 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,11 +43,11 @@ jobs: os: linux script: npm run build --bailOnLintError true --typeCheckOnLint true - stage: mirror - if: branch IN (master, integration, desktop) AND repo = moodlehq/moodleapp + if: branch IN (master, integration, desktop) AND repo = moodlehq/moodleapp AND type != cron os: linux script: scripts/mirror.sh - stage: prepare - if: branch =~ /(master|^integration)$/ AND env(PREPARE) IS NOT blank AND env(PREPARE) = 1 + if: branch =~ /(master|^integration)$/ AND env(PREPARE) IS NOT blank AND env(PREPARE) = 1 AND type != cron os: linux script: scripts/aot.sh - stage: build diff --git a/scripts/test_e2e.sh b/scripts/test_e2e.sh index cab0b094e..fc1c36291 100755 --- a/scripts/test_e2e.sh +++ b/scripts/test_e2e.sh @@ -41,14 +41,16 @@ $dockercompose pull $dockercompose up -d $dockerscripts/moodle-docker-wait-for-db $dockerscripts/moodle-docker-wait-for-app -$dockercompose exec -T webserver php admin/tool/behat/cli/init.php + +$dockercompose exec -T webserver sh -c "php admin/tool/behat/cli/init.php" +notify_on_error_exit "e2e failed initializing behat" # Run tests for tags in "$@" do print_title "Running e2e tests ($tags)" - $dockercompose exec -T webserver php admin/tool/behat/cli/run.php --tags="$tags" + $dockercompose exec -T webserver sh -c "php admin/tool/behat/cli/run.php --tags=\"$tags\"" notify_on_error_exit "e2e failed on $tags" done