Skip to content

Commit 4e78607

Browse files
ci: Update tests to support running with circle CI tests (#867)
* 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]>
1 parent 74f4bed commit 4e78607

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/startTestApp.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,18 @@ function startEndToEnd () {
5252
export SPEC_FILES="test/end-to-end/**/*.test.js"
5353
fi
5454

55-
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
55+
# We want to get the test files through CI and run the tests through it as well
56+
if ! [[ -z "${CI}" ]]; then
57+
export multi="spec=- mocha-junit-reporter=$MOCHA_FILE"
58+
export TEST_MODE=testing
59+
export APP_SERVER=$apiPort
60+
export SCREENSHOT_ROOT=~/test_report/screenshots
61+
62+
export SPEC_FILES=$(circleci tests glob 'test/end-to-end/**/*.test.js' 'test/unit/**/*.test.js')
63+
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
64+
else
65+
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
66+
fi
5667
fi
5768
testPassed=$?;
5869
if ! [[ -z "${CI}" ]]; then

0 commit comments

Comments
 (0)