-
Notifications
You must be signed in to change notification settings - Fork 51
Add code coverage report #368
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| name: tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| workflow_dispatch: | ||
| inputs: | ||
| concurrency: | ||
| group: dashboard-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| tests: | ||
| name: Run Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: "12.22.0" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @netdata/cloud-fe should the version be that one? It's the same for every other test coverage PR, but previously it was set to node-version: '12.x' |
||
| cache: "npm" | ||
| - name: Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: Run Tests | ||
| if: github.event_name != 'pull_request' | ||
| continue-on-error: true | ||
| id: run-tests | ||
| run: npm test -- --coverage --watchAll=false > /tmp/coverage_report | ||
|
|
||
| - name: Post Test Coverage Report in PR | ||
| uses: ArtiomTr/jest-coverage-report-action@v2 | ||
| continue-on-error: true | ||
| if: github.event_name == 'pull_request' | ||
| with: | ||
| test-script: npm run test | ||
| annotations: all | ||
|
|
||
| - name: Gain access to test-reports bucket | ||
| if: (steps.run-tests.outcome == 'failure' || steps.run-tests.outcome == 'success') && github.ref == 'refs/heads/develop' | ||
| uses: google-github-actions/setup-gcloud@master | ||
| with: | ||
| project_id: "netdata-cloud-testing" | ||
| service_account_key: ${{ secrets.TEST_AUTOMATION_SERVICE_ACCOUNT }} | ||
| export_default_credentials: true | ||
|
|
||
| - name: Upload report to test-reports bucket | ||
| if: (steps.run-tests.outcome == 'failure' || steps.run-tests.outcome == 'success') && github.ref == 'refs/heads/develop' | ||
| run: | | ||
| gsutil -h "Cache-Control: max-age=0, no-store" cp /tmp/coverage_report gs://${{ secrets.TEST_AUTOMATION_STORAGE_BUCKET }}/${{ github.event.repository.name }}/coverage_report | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also the checks throw an error here for too line size!
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated in all pending workflows |
||
| gsutil acl set project-private gs://${{ secrets.TEST_AUTOMATION_STORAGE_BUCKET }}/${{ github.event.repository.name }}/coverage_report | ||
|
|
||
| - name: Publish test coverage report | ||
| if: (steps.run-tests.outcome == 'failure' || steps.run-tests.outcome == 'success') && github.ref == 'refs/heads/develop' | ||
| uses: aurelien-baudet/workflow-dispatch@v2 | ||
| with: | ||
| repo: netdata/cloud-workflows | ||
| ref: refs/heads/main | ||
| workflow: test_coverage_publisher.yml | ||
| token: ${{ secrets.TEST_AUTOMATION_TOKEN }} | ||
| inputs: '{ "service-name": "${{ github.event.repository.name }}"}' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,11 +9,7 @@ | |
| "inlineSources": true, | ||
| "sourceRoot": "/", | ||
| "noImplicitAny": false, | ||
| "lib": [ | ||
| "esnext", | ||
| "dom", | ||
| "dom.iterable" | ||
| ], | ||
| "lib": ["esnext", "dom", "dom.iterable"], | ||
| "module": "esnext", | ||
| "target": "es2018", | ||
| "jsx": "react", | ||
|
|
@@ -28,12 +24,6 @@ | |
| "noEmit": true, | ||
| "declaration": true | ||
| }, | ||
| "include": [ | ||
| "./src/**/*" | ||
| ], | ||
| "exclude": [ | ||
| "/node_modules/", | ||
| "**/*.test.ts", | ||
| "**/*.test.tsx" | ||
| ] | ||
| "include": ["./src/**/*", "src/vendor/dygraph-c91c859.min.js"], | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see this dygraph js included in the previous version of the tsconfig.json, what is the reason for this being added now? |
||
| "exclude": ["/node_modules/", "**/*.test.ts", "**/*.test.tsx"] | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It throws an error here for empty lines!
Maybe this should be removed! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, removed, update all pending workflows