From c3afa57ee0dd759b0992847bfafc7987fca06cd0 Mon Sep 17 00:00:00 2001 From: Deepjyoti Barman Date: Wed, 4 Dec 2024 14:26:42 +0530 Subject: [PATCH] Update tests to support running with circle CI tests --- test/startTestApp.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/startTestApp.sh b/test/startTestApp.sh index c04a4428a..3f9b14e12 100755 --- a/test/startTestApp.sh +++ b/test/startTestApp.sh @@ -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