Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Update tests to support running with circle CI tests #867

Merged
merged 6 commits into from
Dec 4, 2024
Merged
13 changes: 12 additions & 1 deletion test/startTestApp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,18 @@ function startEndToEnd () {
export SPEC_FILES="test/end-to-end/**/*.test.js"
fi

APP_SERVER=$apiPort TEST_MODE=testing multi="spec=- mocha-junit-reporter=/dev/null" mocha --reporter mocha-multi --bail=$BAIL --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config $SPEC_FILES
# We want to get the test files through CI and run the tests through it as well
if ! [[ -z "${CI}" ]]; then
export multi="spec=- mocha-junit-reporter=$MOCHA_FILE"
export TEST_MODE=testing
export APP_SERVER=$apiPort
export SCREENSHOT_ROOT=~/test_report/screenshots

export SPEC_FILES=$(circleci tests glob 'test/end-to-end/**/*.test.js' 'test/unit/**/*.test.js')
echo $SPEC_FILES | circleci tests run --command="xargs npx mocha mocha --reporter mocha-multi --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config" --verbose --split-by=timings
else
APP_SERVER=$apiPort TEST_MODE=testing multi="spec=- mocha-junit-reporter=/dev/null" mocha --reporter mocha-multi --bail=$BAIL --require @babel/register --require test/test.mocha.env --timeout 40000 --no-config $SPEC_FILES
fi
fi
testPassed=$?;
if ! [[ -z "${CI}" ]]; then
Expand Down
Loading