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: add e2e coverage clover reports and cast artifacts #12692

Merged
merged 1 commit into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions codebuild_specs/run_e2e_tests_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,21 @@ phases:
- source ./shared-scripts.sh && _runE2ETestsLinux
post_build:
commands:
- source ./shared-scripts.sh && _convertCoverage # && _uploadCoverageLinux (disabled while troubleshooting E2E test failures during initial CodeBuild setup)
- source ./shared-scripts.sh && _scanArtifacts
- source ./shared-scripts.sh && storeCache packages/amplify-e2e-tests/$E2E_TEST_COVERAGE_DIR e2e-test-coverage-raw
- source ./shared-scripts.sh && _uploadReportsToS3 $CODEBUILD_SOURCE_VERSION $CODEBUILD_BATCH_BUILD_IDENTIFIER amplify-e2e-tests
artifacts:
files:
- '**/*'
base-directory: packages/amplify-e2e-tests/$E2E_TEST_COVERAGE_DIR
- '$E2E_TEST_COVERAGE_DIR/*'
- amplify-e2e-reports/*
base-directory: packages/amplify-e2e-tests/
reports:
e2e-reports:
files:
- '*.xml'
file-format: 'JUNITXML'
base-directory: '$CODEBUILD_SRC_DIR/packages/amplify-e2e-tests/reports/junit'
e2e-coverage-report:
files:
- 'packages/amplify-e2e-tests/coverage/clover.xml'
file-format: CLOVERXML
3 changes: 2 additions & 1 deletion shared-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,9 @@ function _convertCoverage {
# assuming e2e tests are run from the amplify-e2e-tests directory:
# .../amplify-e2e-tests/$NODE_V8_COVERAGE - generated with setting NODE_V8_COVERAGE env var
# .../amplify-e2e-tests/coverage/<reporter> - generated with c8 command
loadCache e2e-test-coverage-raw $E2E_TEST_COVERAGE_DIR
pushd packages/amplify-e2e-tests
npx c8 report --temp-directory $E2E_TEST_COVERAGE_DIR --all --src ./packages -x "**/node_modules/**" -x "**/__tests__/**" --exclude-after-remap "**/node_modules/**" -x "**/amplify-e2e-*/**" -x "**/.yarn/**" --allow-external --reporter clover
popd
}
# https://docs.codecov.com/docs/codecov-uploader#integrity-checking-the-uploader
function _uploadCoverageLinux {
Expand Down