test(ci): add dcgm-exporter compatibility unit test to validate-components workflow#8368
Open
test(ci): add dcgm-exporter compatibility unit test to validate-components workflow#8368
dcgm-exporter compatibility unit test to validate-components workflow#8368Conversation
…mponents` workflow - Add `TestDCGMExporterCompatibility` unit test in `e2e/components/` that downloads `dcgm-exporter` `.deb`/`.rpm` packages from PMC and verifies declared dependencies on `datacenter-gpu-manager-4-core` and `datacenter-gpu-manager-4-proprietary` match versions in `components.json` - Parse package metadata natively in Go using `blakesmith/ar` + `klauspost/compress/zstd` for `.deb` and `cavaliergopher/rpm` for `.rpm`, eliminating need for `dpkg-deb`/`rpm` CLI tools or VM infrastructure - Add `dcgm-compatibility` job to `.github/workflows/validate-components.yml` so the test runs automatically on every PR (including Renovate dependency bumps) Signed-off-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
Cover `dcgm-exporter` compatibility check for all OS variants in `components.json` — Ubuntu 22.04 was previously missing, so a Renovate bump on that variant would bypass the version skew detection. Signed-off-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
…n assertions Future-proof against `previousLatestVersion` being added to `components.json` — `GetExpectedPackageVersions` returns both `latestVersion` and `previousLatestVersion` when present, so asserting `len == 1` would break with a confusing error message. Signed-off-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
Log epoch, version, and release separately when parsing RPM dependencies to verify `cavaliergopher/rpm` library correctly decomposes the EVR fields used by `formatRPMVersion`. Signed-off-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a lightweight, infra-free compatibility check to ensure dcgm-exporter package dependencies match the DCGM versions pinned in parts/common/components.json, and wires it into CI so Renovate bumps don’t bypass the validation.
Changes:
- Added
TestDCGMExporterCompatibilityine2e/components/components_test.goto download.deb/.rpmartifacts and parse dependency metadata in Go. - Added new Go module dependencies in
e2e/go.mod/e2e/go.sumto support.deb(ar+tar+zstd) and.rpmparsing. - Added a
dcgm-compatibilityjob to.github/workflows/validate-components.ymlto run the new test on every PR.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
e2e/components/components_test.go |
Introduces the new DCGM exporter compatibility test and package-metadata parsers. |
e2e/go.mod |
Adds required libraries for parsing .deb and .rpm metadata in Go tests. |
e2e/go.sum |
Records checksums for the newly added Go dependencies. |
.github/workflows/validate-components.yml |
Adds CI job to run the new compatibility unit test on PRs. |
- Add `downloadWithRetry` helper with 60s `http.Client` timeout and 3 retries with exponential backoff to prevent CI hangs on transient network failures - Extract `parseDebControlField` to correctly parse RFC822-style continuation lines in `.deb` control files, where long `Depends:` values may wrap across multiple lines Signed-off-by: Suraj Deshmukh <suraj.deshmukh@microsoft.com>
djsly
approved these changes
Apr 21, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
Adds a
TestDCGMExporterCompatibilityunit test that validatesdcgm-exporterpackage dependencies (datacenter-gpu-manager-4-coreanddatacenter-gpu-manager-4-proprietary) match the versions pinned incomponents.json— without requiring GPU VMs or any infrastructure.Problem
The existing
Test_DCGM_Exporter_Compatibilitye2e test in the GPU E2E pipeline only triggers on changes toe2e/**or**/*.gofiles. Renovate PRs that bump DCGM package versions inparts/common/components.jsondon't match those path filters, so the compatibility check is silently skipped (as seen in #8354).Solution
TestDCGMExporterCompatibilityunit test ine2e/components/components_test.gothat downloads.deb/.rpmpackages from PMC and parses their dependency metadata natively in Go usingblakesmith/ar+klauspost/compress/zstd(for.deb) andcavaliergopher/rpm(for.rpm) — nodpkg-deborrpmCLI tools neededdcgm-compatibilityjob to.github/workflows/validate-components.ymlso the test runs automatically on every PR, including Renovate dependency bumps