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

test out new coverage merge script #34029

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
68 changes: 37 additions & 31 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ jobs:
name: Unit Tests
needs: [fetch-allow-lists, tests-prep]
timeout-minutes: 30
runs-on: ubuntu-16-cores-latest
runs-on: ubuntu-16-cores-22.04
outputs:
app_folders: ${{ steps.get-changed-apps.outputs.folders }}
changed-files: ${{ steps.get-changed-apps.outputs.changed_files }}
Expand Down Expand Up @@ -1320,6 +1320,12 @@ jobs:
run: |
node script/github-actions/merge-unit-test-coverage.js $(find qa-standards-dashboard-data/coverage -name '*.json')

- name: Archive merged coverage report
uses: ./.github/workflows/upload-artifact
with:
name: unit-test-coverage-merged
path: ./merged-coverage-report.json

- name: Generate coverage report by app
run: node script/app-coverage-report.js > qa-standards-dashboard-data/coverage/coverage_report.txt

Expand All @@ -1335,37 +1341,37 @@ jobs:
name: unit-test-coverage-txt
path: qa-standards-dashboard-data/coverage/coverage_report.txt

- name: Process Coverage Report and post results to BigQuery
run: yarn unit-coverage-to-bigquery
working-directory: qa-standards-dashboard-data

- name: Upload coverage report to S3
if: ${{ github.ref == 'refs/heads/main' && needs.unit-tests.outputs.app_folders == '' }}
run: |
if [ -f qa-standards-dashboard-data/coverage/test-coverage-report.json ]; then
aws s3 cp qa-standards-dashboard-data/coverage/test-coverage-report.json s3://vetsgov-website-builds-s3-upload-test/coverage/test-coverage-report.json --acl public-read --region us-gov-west-1
else
echo 'No coverage report exists as no tests were run.'
fi
# - name: Process Coverage Report and post results to BigQuery
# run: yarn unit-coverage-to-bigquery
# working-directory: qa-standards-dashboard-data

# - name: Upload coverage report to S3
# if: ${{ github.ref == 'refs/heads/main' && needs.unit-tests.outputs.app_folders == '' }}
# run: |
# if [ -f qa-standards-dashboard-data/coverage/test-coverage-report.json ]; then
# aws s3 cp qa-standards-dashboard-data/coverage/test-coverage-report.json s3://vetsgov-website-builds-s3-upload-test/coverage/test-coverage-report.json --acl public-read --region us-gov-west-1
# else
# echo 'No coverage report exists as no tests were run.'
# fi

# -------------------------
# | Unit Tests Summary |
# -------------------------

- name: Get code coverage
if: ${{ always() }}
id: code-coverage
run: echo MARKDOWN=$(node ./script/github-actions/code-coverage-format-report.js) >> $GITHUB_OUTPUT

- name: Publish Unit Test Coverage Results
if: ${{ always() }}
uses: ./.github/workflows/checks-action
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Unit Test Coverage Summary
conclusion: ${{ needs.unit-tests.result }}
output: |
{"summary":"<https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/unit-test-coverage-report/>"}
# # -------------------------
# # | Unit Tests Summary |
# # -------------------------

# - name: Get code coverage
# if: ${{ always() }}
# id: code-coverage
# run: echo MARKDOWN=$(node ./script/github-actions/code-coverage-format-report.js) >> $GITHUB_OUTPUT

# - name: Publish Unit Test Coverage Results
# if: ${{ always() }}
# uses: ./.github/workflows/checks-action
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# name: Unit Test Coverage Summary
# conclusion: ${{ needs.unit-tests.result }}
# output: |
# {"summary":"<https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/unit-test-coverage-report/>"}

testing-reports-cypress:
name: Testing Reports - Cypress E2E Tests
Expand Down
Loading
Loading