-
Notifications
You must be signed in to change notification settings - Fork 2.1k
chore(ci): add code coverage collection for integration and e2e test suites #25088
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
Open
thomasqueirozb
wants to merge
25
commits into
master
Choose a base branch
from
ci/coverage-suite
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7b3b3c7
Run IT suite with coveraged on a scheduled basis
thomasqueirozb 2b74477
Add trigger
thomasqueirozb 70b374a
chore(ci): merge origin/master, add workflow_call to should_run condi…
thomasqueirozb cf5c0b0
fix(ci): add run_all input to integration.yml to force all tests when…
thomasqueirozb cfe8f4b
Format
thomasqueirozb 4585e5b
fix(ci): require all test suites to pass before coverage upload
thomasqueirozb 4c1b0d9
Merge branch 'master' into ci/coverage-suite
thomasqueirozb 02162c3
fix(ci): pass ref to integration workflow for consistent coverage builds
thomasqueirozb 999a083
Merge remote-tracking branch 'origin/master' into ci/coverage-suite
thomasqueirozb f80296f
Format
thomasqueirozb fa35541
fix(ci): preserve coverage across multi-environment integration tests
thomasqueirozb e9a4ded
fix(ci): always mount coverage volume in test runner container
thomasqueirozb 0c96e2c
fix(ci): clear stale combined coverage on retry and fix COVERAGE docs
thomasqueirozb 8d9f866
chore(ci): document E2E coverage instrumentation limitation
thomasqueirozb 3d9ca5f
fix(ci): write per-environment coverage files to prevent overwrites
thomasqueirozb 2debfbb
fix(ci): address PR review on coverage suite
thomasqueirozb 7c4006c
fix(ci): scope CLI test filter to root vector package
thomasqueirozb e0082be
fix(ci): skip make test when no nextest suites are selected
thomasqueirozb d47fb96
Merge remote-tracking branch 'origin/master' into ci/coverage-suite
thomasqueirozb 4d9b247
fix(ci): remove stale lcov.info before merging per-env coverage
thomasqueirozb 2e72af3
chore(ci): fix component-validation input and add OS-based FEATURES d…
thomasqueirozb 1156c3f
Add DD_ENV/DD_API_KEY to unit-tests.yml
thomasqueirozb b251bec
Merge remote-tracking branch 'origin/master' into ci/coverage-suite
thomasqueirozb 4ee84ae
Merge branch 'master' into ci/coverage-suite
thomasqueirozb b6e8e2c
chore(ci): grant id-token: write to coverage caller jobs
thomasqueirozb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,105 @@ | ||
| name: Code Coverage | ||
| # Coverage | ||
| # | ||
| # Runs all test suites (unit, component validation, CLI, API, behavior, | ||
| # integration) with code coverage instrumentation on a single commit. Results | ||
| # are merged into one lcov report and uploaded to Datadog. Also runs on a | ||
| # weekly schedule to ensure full baseline coverage is always fresh. | ||
| # | ||
| # Limitation: integration and E2E coverage only instruments the test runner | ||
| # (cargo-nextest), not the separately-launched Vector binary inside compose | ||
| # services. Instrumenting the service binary would require building it with | ||
| # cargo-llvm-cov and merging its runtime profdata, which is out of scope here. | ||
|
|
||
| name: Coverage | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: # Allow manual trigger from GitHub UI | ||
| workflow_call: | ||
| inputs: | ||
| ref: | ||
| description: "Git ref to checkout" | ||
| required: false | ||
| type: string | ||
|
|
||
| schedule: | ||
| - cron: "0 2 * * 0" # 2 AM UTC every Sunday | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CI: true | ||
| CARGO_INCREMENTAL: "0" # Disable incremental compilation for coverage | ||
| CI: true | ||
|
|
||
| jobs: | ||
| coverage: | ||
| tests: | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| uses: ./.github/workflows/unit-tests.yml | ||
| with: | ||
| ref: ${{ inputs.ref }} | ||
| default: true | ||
| coverage: true | ||
| cli: true | ||
| vector-api: true | ||
|
|
||
| integration-tests: | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
thomasqueirozb marked this conversation as resolved.
|
||
| id-token: write | ||
| uses: ./.github/workflows/integration.yml | ||
| with: | ||
| run_all: true | ||
| coverage: true | ||
| ref: ${{ inputs.ref }} | ||
| secrets: inherit | ||
|
|
||
| coverage-upload: | ||
| name: Merge and Upload Coverage | ||
| runs-on: ubuntu-24.04 | ||
| needs: | ||
| - tests | ||
| - integration-tests | ||
| if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }} | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: ${{ inputs.ref }} | ||
|
|
||
| - name: Download all coverage artifacts | ||
| uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 | ||
| with: | ||
| pattern: coverage-* | ||
| path: coverage-artifacts | ||
| merge-multiple: false | ||
|
|
||
| - name: Merge coverage reports | ||
| run: | | ||
| sudo apt-get install -y --no-install-recommends lcov | ||
|
|
||
| mapfile -t FILES < <(find coverage-artifacts -name '*.info') | ||
| echo "Merging ${#FILES[@]} coverage file(s)" | ||
|
|
||
| ARGS=() | ||
| for f in "${FILES[@]}"; do | ||
| ARGS+=("--add-tracefile" "$f") | ||
| done | ||
| lcov "${ARGS[@]}" --output-file merged-lcov.info | ||
|
|
||
| - uses: ./.github/actions/setup | ||
| with: | ||
| rust: true | ||
| libsasl2: true | ||
| protoc: true | ||
| cargo-llvm-cov: true | ||
| cargo-nextest: true | ||
| vdev: false | ||
| datadog-ci: true | ||
|
|
||
| - name: "Generate code coverage" | ||
| run: cargo llvm-cov nextest --workspace --lcov --output-path lcov.info | ||
|
|
||
| - uses: ./.github/actions/dd-token | ||
|
|
||
| - name: "Upload coverage to Datadog" | ||
| - name: Upload to Datadog | ||
| env: | ||
| DD_SITE: datadoghq.com | ||
| DD_ENV: ci | ||
| run: datadog-ci coverage upload lcov.info | ||
| run: datadog-ci coverage upload merged-lcov.info | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.