Skip to content

Commit 7be1ad2

Browse files
author
rjabhi
committed
test: add function to run e2e migration tests
1 parent 8c1d484 commit 7be1ad2

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

.circleci/local_publish_helpers_codebuild.sh

+23
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,29 @@ function runE2eTestCb {
297297
fi
298298
}
299299

300+
function runGen2MigrationsE2ETestCb {
301+
_setupCoverage
302+
FAILED_TEST_REGEX_FILE="./amplify-migration-e2e-reports/amplify-migration-e2e-failed-test.txt"
303+
304+
if [ -f $FAILED_TEST_REGEX_FILE ]; then
305+
# read the content of failed tests
306+
failedTests=$(<$FAILED_TEST_REGEX_FILE)
307+
if [[ ! -z "$DISABLE_COVERAGE" ]]; then
308+
echo Running WITHOUT coverage
309+
yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE -t "$failedTests"
310+
else
311+
NODE_V8_COVERAGE=$E2E_TEST_COVERAGE_DIR yarn e2e-migration --forceExit --no-cache --maxWorkers=4 $TEST_SUITE -t "$failedTests"
312+
fi
313+
else
314+
if [[ ! -z "$DISABLE_COVERAGE" ]]; then
315+
echo Running WITHOUT coverage
316+
yarn e2e --forceExit --no-cache --maxWorkers=4 $TEST_SUITE
317+
else
318+
NODE_V8_COVERAGE=$E2E_TEST_COVERAGE_DIR yarn e2e-migration --forceExit --no-cache --maxWorkers=4 $TEST_SUITE
319+
fi
320+
fi
321+
}
322+
300323
function _setupCoverage {
301324
_teardownCoverage
302325
echo "Setup Coverage ($E2E_TEST_COVERAGE_DIR)"

codebuild_specs/run_gen2_migrations_e2e_tests_linux.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ artifacts:
4242
files:
4343
- '$E2E_TEST_COVERAGE_DIR/*'
4444
- amplify-e2e-reports/*
45-
base-directory: packages/amplify-e2e-tests/
45+
base-directory: packages/amplify-migration-e2e/
4646
reports:
4747
e2e-reports:
4848
files:

shared-scripts.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ function _runGen2MigrationE2ETestsLinux {
367367
amplify version
368368
cd packages/amplify-migration-e2e
369369
_loadTestAccountCredentials
370-
retry runE2eTestCb
370+
retry runGen2MigrationsE2ETestCb
371371
}
372372

373373
function _unassumeTestAccountCredentials {

0 commit comments

Comments
 (0)