Fix end to end testing for Forem forked repositories (#11950)

* Fixed e2e parallelization when no API token for Knapsack.

* Re-eneabled e2e tests in Travis.

* Checks for the KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS now.
This commit is contained in:
Nick Taylor 2020-12-17 18:38:17 -05:00 committed by GitHub
parent 978b698e78
commit ccb8352841
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View file

@ -69,9 +69,9 @@ script:
- if [ "$KNAPSACK_PRO_CI_NODE_INDEX" == "1" ]; then bundle exec bundle-audit check --update --ignore CVE-2015-9284; fi
- if [ "$KNAPSACK_PRO_CI_NODE_INDEX" == "1" ]; then yarn build-storybook; fi
- if [ "$KNAPSACK_PRO_CI_NODE_INDEX" == "2" ]; then bin/test-console-check; fi
# - yarn e2e:ci
# Dropping and recreating the database for Capybara/rspecs
- export FOREM_OWNER_SECRET="secret"
- yarn e2e:ci
# Dropping and recreating the database for Capybara/rspecs
- bundle exec rails db:drop
- bundle exec rails db:create
- bundle exec rails db:schema:load

9
bin/e2e Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
if [ "$KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS" = "" ]; then
KNAPSACK_PRO_ENDPOINT=https://api-disabled-for-fork.knapsackpro.com \
KNAPSACK_PRO_MAX_REQUEST_RETRIES=0 \
KNAPSACK_PRO_TEST_SUITE_TOKEN_CYPRESS=disabled-for-fork \
npx cypress run # run without parallelization
else
npx knapsack-pro-cypress # parallelization is available
fi

View file

@ -26,7 +26,7 @@
"test:watch": "jest app/javascript/ bin/ --watch",
"postcss": "postcss public/assets/*.css -d public/assets 2> postcss_error.log",
"e2e": "cypress open",
"e2e:runner": "knapsack-pro-cypress",
"e2e:runner": "bin/e2e",
"e2e:server": "bin/rails s -p 3000 -b 0.0.0.0",
"e2e:ci": "start-server-and-test e2e:server http://localhost:3000 e2e:runner"
},