Skip to content

Commit

Permalink
ci: Update tests to support running with circle CI tests (#867)
Browse files Browse the repository at this point in the history
* Update tests to support running with circle CI tests

* Allow the current branch to run to test the pipeline

* Allow the build step to run in pipeline for tests to run properly

* Make markTest not run on test branches

* Undo changes to not run the test again

---------

Co-authored-by: Mihály Lengyel <[email protected]>
  • Loading branch information
deepjyoti30-st and porcellus authored Dec 4, 2024
1 parent 74f4bed commit 4e78607
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit 4e78607

Please sign in to comment.