• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NVIDIA / gpu-operator / 34295575057
39%
main: 44%

Build:
Build:
LAST BUILD BRANCH: pull-request/2873
DEFAULT BRANCH: main
Ran 09 Sep 2026 12:42AM UTC
Jobs 1
Files 75
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Sep 2026 11:58PM UTC coverage: 39.437% (+1.5%) from 37.979%
34295575057

push

github

abrarshivani
add unit tests for the clusterinfo package

clusterinfo answers questions about the cluster the operator runs in: which
container runtime the GPU nodes use, whether this is OpenShift, whether there
is a cluster proxy, whether the cluster supports DRA. Other parts of the
operator use those answers to decide what to install. #2831 added tests for
getRuntimeString; the rest of the package had none.

The package builds its Kubernetes clients inside each function from a
*rest.Config, so there is nothing to inject a mock into. The tests point
rest.Config at an httptest server that serves the endpoints the package reads.
Real client-go runs against it, so URL building, decoding and 404 handling are
exercised rather than simulated. The stub fails a test if a client requests a
path it has no handler for, which matters because getOpenshiftVersion reads a
404 as "not OpenShift" — without that check a wrong URL would pass for the
wrong reason.

getRuntimeString keeps the five cases from #2831 and gains three: a bare
prefix with no version suffix, a runtime name appearing as a substring rather
than a prefix, and case sensitivity. They move from clusterinfo_test.go to
runtime_test.go, which now holds every test for the container runtime path.

Nine behaviours look wrong. None are fixed here. The tests record what the
code does today and live in clusterinfo_characterization_test.go, apart from
the tests asserting intended behaviour, so fixing one of them fails only tests
in that file. That is checked by applying each fix and confirming where the
failures land.

Coverage is 99.3% of statements. The uncovered line calls os.Exit. No
production code is changed.

Signed-off-by: Abrar Shivani <ashivani@nvidia.com>

5113 of 12965 relevant lines covered (39.44%)

0.4 hits per line

Jobs
ID Job ID Ran Files Coverage
1 34295575057.1 09 Sep 2026 12:42AM UTC 75
39.44
GitHub Action Run
Source Files on build 34295575057
  • Tree
  • List 75
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34295575057
  • d35f2d9b on github
  • Prev Build on main (#34248263199)
  • Next Build on pull-request/2869 (#34297648519)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc