Skip to content

test(ci): add dcgm-exporter compatibility unit test to validate-components workflow#8368

Open
surajssd wants to merge 6 commits intomainfrom
suraj/test-dcgm-dependency
Open

test(ci): add dcgm-exporter compatibility unit test to validate-components workflow#8368
surajssd wants to merge 6 commits intomainfrom
suraj/test-dcgm-dependency

Conversation

@surajssd
Copy link
Copy Markdown
Member

What this PR does / why we need it:

Adds a TestDCGMExporterCompatibility unit test that validates dcgm-exporter package dependencies (datacenter-gpu-manager-4-core and datacenter-gpu-manager-4-proprietary) match the versions pinned in components.json — without requiring GPU VMs or any infrastructure.

Problem

The existing Test_DCGM_Exporter_Compatibility e2e test in the GPU E2E pipeline only triggers on changes to e2e/** or **/*.go files. Renovate PRs that bump DCGM package versions in parts/common/components.json don't match those path filters, so the compatibility check is silently skipped (as seen in #8354).

Solution

  • Add TestDCGMExporterCompatibility unit test in e2e/components/components_test.go that downloads .deb/.rpm packages from PMC and parses their dependency metadata natively in Go using blakesmith/ar + klauspost/compress/zstd (for .deb) and cavaliergopher/rpm (for .rpm) — no dpkg-deb or rpm CLI tools needed
  • Cover all three OS variants: Ubuntu 22.04, Ubuntu 24.04, and Azure Linux 3.0
  • Add a dcgm-compatibility job to .github/workflows/validate-components.yml so the test runs automatically on every PR, including Renovate dependency bumps
  • The existing GPU e2e test is kept for full integration coverage on scheduled GPU runs

…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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 TestDCGMExporterCompatibility in e2e/components/components_test.go to download .deb/.rpm artifacts and parse dependency metadata in Go.
  • Added new Go module dependencies in e2e/go.mod/e2e/go.sum to support .deb (ar + tar + zstd) and .rpm parsing.
  • Added a dcgm-compatibility job to .github/workflows/validate-components.yml to 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.

Comment thread e2e/components/components_test.go
Comment thread e2e/components/components_test.go Outdated
Comment thread e2e/components/components_test.go
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants