Skip to content

Instantly share code, notes, and snippets.

@mcsf
Created October 9, 2019 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsf/3c5d896f55d0426d7530cd2290266ecc to your computer and use it in GitHub Desktop.
Save mcsf/3c5d896f55d0426d7530cd2290266ecc to your computer and use it in GitHub Desktop.
#!/bin/bash
TEST_SUITE="change-detection"
TEST_NAME="consecutive edits"
E2E_PATCH="bisect-e2e.diff"
skip() {
echo Skipping: $@; exit 125
}
# Setup
git checkout -f || skip Failed initial checkout
git apply $E2E_PATCH || skip Failed patch application
## Faster but more error-prone:
#npm i || skip Failed installation
# Slower but more reliable:
npm ci || skip Failed installation
npm run build || skip Failed build
# Test
# nom run test-e2e would be more reliable, but much slower, so instead:
FORCE_REDUCED_MOTION=true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= $( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath packages/e2e-tests/specs/$TEST_SUITE.test.js -t "$TEST_NAME"
ERROR=$?
# Cleanup
git checkout -f || skip Failed cleanup
# Exit, reporting test status
exit $ERROR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment