From bc9d61843d67fbca0d41b54cc02c64e055115bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Mon, 10 Dec 2018 14:08:10 +0100 Subject: [PATCH] Allow skipping mysql for saas --- .travis.yml | 15 ++++++++++++--- script/ci/cache_prepare.sh | 5 ++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4b88eaa8bf..3b31dcebf4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -89,6 +89,7 @@ jobs: script: - bash script/ci/setup.sh spec_legacy mysql - bash script/ci/runner.sh spec_legacy 1 1 + if: env(SKIP_MYSQL_TESTING) IS blank - stage: test name: 'spec_legacy (1/1) - postgres' script: @@ -99,6 +100,7 @@ jobs: script: - bash script/ci/setup.sh units mysql - bash script/ci/runner.sh units 4 1 + if: env(SKIP_MYSQL_TESTING) IS blank - stage: test name: 'units (1/4) - postgres' script: @@ -109,6 +111,7 @@ jobs: script: - bash script/ci/setup.sh units mysql - bash script/ci/runner.sh units 4 2 + if: env(SKIP_MYSQL_TESTING) IS blank - stage: test name: 'units (2/4) - postgres' script: @@ -119,6 +122,7 @@ jobs: script: - bash script/ci/setup.sh units mysql - bash script/ci/runner.sh units 4 3 + if: env(SKIP_MYSQL_TESTING) IS blank - stage: test name: 'units (3/4) - postgres' script: @@ -129,6 +133,7 @@ jobs: script: - bash script/ci/setup.sh units mysql - bash script/ci/runner.sh units 4 4 + if: env(SKIP_MYSQL_TESTING) IS blank - stage: test name: 'units (4/4) - postgres' script: @@ -139,6 +144,7 @@ jobs: script: - bash script/ci/setup.sh features mysql - bash script/ci/runner.sh features 4 1 + if: env(SKIP_MYSQL_TESTING) IS blank - stage: test name: 'features (1/4) - postgres' script: @@ -149,6 +155,7 @@ jobs: script: - bash script/ci/setup.sh features mysql - bash script/ci/runner.sh features 4 2 + if: env(SKIP_MYSQL_TESTING) IS blank - stage: test name: 'features (2/4) - postgres' script: @@ -159,6 +166,7 @@ jobs: script: - bash script/ci/setup.sh features mysql - bash script/ci/runner.sh features 4 3 + if: env(SKIP_MYSQL_TESTING) IS blank - stage: test name: 'features (3/4) - postgres' script: @@ -169,6 +177,7 @@ jobs: script: - bash script/ci/setup.sh features mysql - bash script/ci/runner.sh features 4 4 + if: env(SKIP_MYSQL_TESTING) IS blank - stage: test name: 'features (4/4) - postgres' script: @@ -179,7 +188,7 @@ jobs: script: - bash script/ci/setup.sh plugins:units mysql - bash script/ci/runner.sh plugins:units 1 1 - if: head_branch !~ /^core\// + if: env(SKIP_MYSQL_TESTING) IS blank AND head_branch !~ /^core\// - stage: test name: 'plugins:units (1/1) - postgres' script: @@ -191,7 +200,7 @@ jobs: script: - bash script/ci/setup.sh plugins:features mysql - bash script/ci/runner.sh plugins:features 1 1 - if: head_branch !~ /^core\// + if: env(SKIP_MYSQL_TESTING) IS blank AND head_branch !~ /^core\// - stage: test name: 'plugins:features (1/1) - postgres' script: @@ -203,7 +212,7 @@ jobs: script: - bash script/ci/setup.sh plugins:cucumber mysql - bash script/ci/runner.sh plugins:cucumber 1 1 - if: head_branch !~ /^core\// + if: env(SKIP_MYSQL_TESTING) IS blank AND head_branch !~ /^core\// - stage: test name: 'plugins:cucumber (1/1) - postgres' script: diff --git a/script/ci/cache_prepare.sh b/script/ci/cache_prepare.sh index 563bb77220..97ac3a0631 100644 --- a/script/ci/cache_prepare.sh +++ b/script/ci/cache_prepare.sh @@ -38,9 +38,8 @@ run() { eval $2; } -run "mysql -u root -e \"CREATE DATABASE IF NOT EXISTS travis_ci_test DEFAULT CHARACTER SET = 'utf8' DEFAULT COLLATE 'utf8_general_ci';\"" -run "mysql -u root -e \"GRANT ALL ON travis_ci_test.* TO 'travis'@'localhost';\"" -run "cp script/templates/database.travis.mysql.yml config/database.yml" +run "psql -c 'create database travis_ci_test;' -U postgres" +run "cp script/templates/database.travis.postgres.yml config/database.yml" run "bundle exec rake db:migrate"