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

Create merged coverage to html #1318

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -197,3 +197,31 @@ jobs:
with:
name: Test Results (${{ matrix.version }})
path: junit.xml

coverge-test:
name: Generate code coverage
runs-on: ubuntu-latest
needs: build-and-lint
timeout-minutes: 10
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Run Tests
run: ./run-tests.sh 6.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make much sense. vm-test has a test matrix that runs this against a wide range of kernel versions, and we need test coverage for each of them.

The point is to add coverage reporting to the existing vm-test, test-on-prev-go and test-on-arm64 jobs. Ideally, this would all be done in a single step to keep the size of the yaml a bit manageable:

      - run: go tool covdata merge -o coverage-merged.out
      - run: go tool cover -html=coverage-merged.out -o coverage.html

      - name: Upload Coverage Report
        uses: actions/upload-artifact@v3
        with:
          name: coverage-report
          path: |
            ./coverage-merged.out
            ./coverage.html

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will I have to add this to all three job or it can be done in another separate job?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want coverage for all three jobs (we do), then yes, it needs to be in all three. 🙂


- name: Merge Coverage
run: go tool covdata merge -o merged-coverage.out
- name: Upload Merged Coverage
uses: actions/upload-artifact@v3
with:
name: merged-coverage
path: merged-coverage.out

- name: Generate HTML Report
run: go tool cover -html=merged-coverage.out -o coverage.html
- name: Upload HTML coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: coverage.html