Added yarn test:ci command

refs https://github.com/TryGhost/Toolbox/issues/208

- we currently run all test commands separately in CI and this can make
  it harder to replicate any issues we see in CI because we have to
  manually go and copy the order of the tests
- it's also nicer if there's just one command that runs so we can make
  changes globally to CI
- this commit adds a test:ci yarn command which will run the tests in
  order of speed/importance, with the -b AKA fail-fast flag so we
  don't have to wait for all tests to run before finding out about
  issues
- this also cleans up running unit tests in the DB matrix
This commit is contained in:
Daniel Lockyer 2022-02-16 18:54:12 +01:00
parent 7a5b262a84
commit 08eaed152b
2 changed files with 3 additions and 8 deletions

View File

@ -172,14 +172,8 @@ jobs:
- run: date +%s > ${{ runner.temp }}/startTime # Get start time for test suite
- run: yarn test:e2e
env:
database__connection__filename: /dev/shm/ghost-test.db
- run: yarn test:integration
env:
database__connection__filename: /dev/shm/ghost-test.db
- run: yarn test:unit
- run: yarn test:regression
- name: Run tests
run: yarn test:ci
env:
database__connection__filename: /dev/shm/ghost-test.db

View File

@ -33,6 +33,7 @@
"test:integration": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/integration' --timeout=5000",
"test:e2e": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/e2e-api' './test/e2e-frontend' './test/e2e-server' --timeout=10000",
"test:regression": "mocha --require=./test/utils/overrides.js --exit --trace-warnings --recursive --extension=test.js './test/regression' --timeout=60000",
"test:ci": "yarn test:e2e -b && yarn test:integration -b && yarn test:regression -b",
"test:unit:slow": "yarn test:unit --reporter=mocha-slow-test-reporter",
"test:int:slow": "yarn test:integration --reporter=mocha-slow-test-reporter",
"test:e2e:slow": "yarn test:e2e --reporter=mocha-slow-test-reporter",