Files
firefox-accounts-mirror/packages/fxa-auth-server/scripts/test-ci.sh
dschom d96797ae6a task(CI): Improve nx caching for CI pipelines
Because:
- Not all CI operations where taking advantage of NX caches

This Commit:
- Adjusts nx.json config to ensure correct caching behavior
- Adjusts nx.json config to ensure proper target chains. ie build is dependent on pre-build
- Uses nx to directly run integration tests
- Uses nx to directly run unit tests
- Phases out dependency on generated .list files
- Ensures 'start up' for services for functional tests is done with nx and uses nx caches.
- Creates nx tags to facilitate test commands
- Fixes linter errors encountered
- Updates docker images to nx for builds
- Updates nx ignore files
2023-08-29 11:19:54 -07:00

31 lines
935 B
Bash
Executable File

#!/bin/bash -e
DIR=$(dirname "$0")
cd "$DIR/.."
export NODE_ENV=dev
export CORS_ORIGIN="http://foo,http://bar"
DEFAULT_ARGS="--require esbuild-register --require tsconfig-paths/register --recursive --timeout 5000 --exit "
if [ "$TEST_TYPE" == 'unit' ]; then GREP_TESTS="--grep #integration --invert "; fi;
if [ "$TEST_TYPE" == 'integration' ]; then GREP_TESTS="--grep #integration "; fi;
TESTS=(local oauth remote scripts)
if [ -z "$1" ]; then
TESTS=(local oauth remote scripts)
else
TESTS=($1)
fi
for t in "${TESTS[@]}"; do
echo -e "\n\nTesting: $t"
#./scripts/mocha-coverage.js $DEFAULT_ARGS $GREP_TESTS --reporter-options mochaFile="../../artifacts/tests/fxa-auth-server/$t/test-results.xml" "test/$t"
MOCHA_FILE=../../artifacts/tests/$npm_package_name/mocha-$TEST_TYPE-$t.xml mocha $DEFAULT_ARGS $GREP_TESTS test/$t
done
if [ "$TEST_TYPE" == 'integration' ]; then
yarn run clean-up-old-ci-stripe-customers;
fi;