Skip to content

test: cover dockerinstall packages - #1074

Merged
skevetter merged 4 commits into
mainfrom
pkg-container/dockerinstall-packages-test
Aug 18, 2026
Merged

test: cover dockerinstall packages#1074
skevetter merged 4 commits into
mainfrom
pkg-container/dockerinstall-packages-test

Conversation

@devsy-app

@devsy-app devsy-app Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Package reviewed

pkg/dockerinstall — Docker installation helper (detector, validator, installer, packages).

Issue found

packages.go exposes two pure, version-gated functions with zero test coverage:

  • BuildPackageList(version, pkgVersion, cliPkgVersion, extraPkgs...) — builds the apt package list, conditionally including docker-ce-cli/containerd.io (18.09+), docker-compose-plugin (20.10+), and docker-buildx-plugin (23.0+).
  • versionGte(version, target) — numeric comparison that powers those gates, including pre-release suffix handling (-ce, -0~debian) and the empty-version fallback.

detector.go and validator.go are well covered by existing suites, but packages.go had no tests at all, leaving the package-selection logic — the part that decides which Docker components get installed per version — unverified.

Change

Added pkg/dockerinstall/packages_test.go (new file) with a PackagesTestSuite (testify, matching the package's existing test style) covering:

  • BuildPackageList: pre-18.09 (CLI/containerd absent), 18.09 with and without a pinned CLI version, compose added at 20.10, buildx added at 23.0, empty version enabling all features, and extra packages appended.
  • versionGte: empty version, equal, greater/lesser major, greater/lesser minor, fewer parts ("23" vs "23.0"), pre-release suffixes ("20.10-ce", "18.09-0~debian"), and a non-numeric component.

No behavioral change — test-only addition. All cases document the existing intended behavior.

Verification

  • task cli:format — clean.
  • task cli:lint:ci0 issues (new-from-patch against origin/main).
  • task cli:testpkg/dockerinstall passes. The only failing package is pkg/git (TestRepoClone*), a known pre-existing stale assertion on origin/main unrelated to this change (this change does not touch pkg/git).
  • go test ./pkg/dockerinstall/ok (0.057s).

Scope

One package (pkg/dockerinstall), one new test file, no source changes.

This PR was created by an AI agent as part of an automated daily package review job.

Add packages_test.go covering the previously-untested BuildPackageList and versionGte in pkg/dockerinstall. Pure test-only addition: verifies version-gated package selection (cli/containerd 18.09+, compose 20.10+, buildx 23.0+), extra-package appending, the empty-version fallback, and pre-release suffix comparison. No behavioral change.
@netlify

netlify Bot commented Aug 16, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 0183bce
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a829dc55f5dc7000812b02e

@netlify

netlify Bot commented Aug 16, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 0183bce
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a829dc40ade700008dffb49

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 10 complexity · 0 duplication

Metric Results
Complexity 10
Duplication 0

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@github-actions github-actions Bot added size/l and removed size/m labels Aug 17, 2026
Signed-off-by: Samuel K <skevetter@pm.me>
@skevetter
skevetter marked this pull request as ready for review August 17, 2026 07:06
@skevetter
skevetter merged commit d42a73b into main Aug 18, 2026
75 checks passed
@skevetter
skevetter deleted the pkg-container/dockerinstall-packages-test branch August 18, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant