From 27f46c9239d51f78010053e1ef744ad2487a27f8 Mon Sep 17 00:00:00 2001 From: ArturT Date: Mon, 4 Dec 2017 22:24:50 +0100 Subject: [PATCH] Allow forked version of repo to run tests with knapsack_pro gem without needed API key KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC. Based on: https://github.com/KnapsackPro/knapsack_pro-ruby#how-to-make-knapsack_pr o-works-for-forked-repositories-of-my-project --- .travis.yml | 2 +- bin/knapsack_pro_rspec | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 bin/knapsack_pro_rspec diff --git a/.travis.yml b/.travis.yml index 910227ea1..9da8210d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_script: - bundle exec rake db:setup script: - "bundle exec rake assets:precompile RAILS_ENV=test" - - "bundle exec rake knapsack_pro:queue:rspec" + - "bin/knapsack_pro_rspec" env: global: - KNAPSACK_PRO_CI_NODE_TOTAL=2 diff --git a/bin/knapsack_pro_rspec b/bin/knapsack_pro_rspec new file mode 100755 index 000000000..9aaf762ad --- /dev/null +++ b/bin/knapsack_pro_rspec @@ -0,0 +1,9 @@ +#!/bin/bash +if [ "$KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC" = "" ]; then + KNAPSACK_PRO_ENDPOINT=https://api-disabled-for-fork.knapsackpro.com \ + KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=disabled-for-fork \ + bundle exec rake knapsack_pro:rspec # use Regular Mode here always +else + # Queue Mode - dynamic tests allocation across CI nodes + bundle exec rake knapsack_pro:queue:rspec +fi