From 387e951b863b68a64a21f23bd283cc6e267afe65 Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Thu, 26 Feb 2026 02:53:39 +0000 Subject: [PATCH] fix: use snack.Manager interface type for type assertions, drop coverpkg --- .github/workflows/integration.yml | 18 +++++++++--------- apk/apk_integration_test.go | 2 +- apt/apt_integration_test.go | 2 +- dnf/dnf_integration_test.go | 2 +- dpkg/dpkg_integration_test.go | 2 +- flatpak/flatpak_integration_test.go | 2 +- pacman/pacman_integration_test.go | 2 +- pkg/pkg_integration_test.go | 2 +- rpm/rpm_integration_test.go | 2 +- snap/snap_integration_test.go | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index fbbb3ca..70189cb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -16,7 +16,7 @@ jobs: go-version-file: go.mod - run: go build ./... - run: go vet ./... - - run: go test -race -coverprofile=coverage-unit.out -coverpkg=./... ./... + - run: go test -race -coverprofile=coverage-unit.out ./... - uses: actions/upload-artifact@v4 with: name: coverage-unit @@ -36,7 +36,7 @@ jobs: apt-get update apt-get install -y sudo tree curl - name: Integration tests - run: go test -v -tags integration -count=1 -coverprofile=coverage-debian.out -coverpkg=./... ./apt/ ./dpkg/ ./detect/ + run: go test -v -tags integration -count=1 -coverprofile=coverage-debian.out ./apt/ ./dpkg/ ./detect/ - uses: actions/upload-artifact@v4 if: always() with: @@ -57,9 +57,9 @@ jobs: sudo apt-get install -y tree sudo snap install hello-world 2>/dev/null; sudo snap remove hello-world 2>/dev/null - name: Integration tests (apt) - run: sudo -E go test -v -tags integration -count=1 -coverprofile=coverage-ubuntu-apt.out -coverpkg=./... ./apt/ ./dpkg/ ./detect/ + run: sudo -E go test -v -tags integration -count=1 -coverprofile=coverage-ubuntu-apt.out ./apt/ ./dpkg/ ./detect/ - name: Integration tests (snap) - run: sudo -E go test -v -tags integration -count=1 -coverprofile=coverage-ubuntu-snap.out -coverpkg=./... ./snap/ + run: sudo -E go test -v -tags integration -count=1 -coverprofile=coverage-ubuntu-snap.out ./snap/ - uses: actions/upload-artifact@v4 if: always() with: @@ -79,7 +79,7 @@ jobs: run: | dnf install -y tree sudo - name: Integration tests - run: go test -v -tags integration -count=1 -coverprofile=coverage-fedora39.out -coverpkg=./... ./dnf/ ./rpm/ ./detect/ + run: go test -v -tags integration -count=1 -coverprofile=coverage-fedora39.out ./dnf/ ./rpm/ ./detect/ - uses: actions/upload-artifact@v4 if: always() with: @@ -99,7 +99,7 @@ jobs: run: | dnf install -y tree sudo - name: Integration tests - run: go test -v -tags integration -count=1 -coverprofile=coverage-fedora-latest.out -coverpkg=./... ./dnf/ ./rpm/ ./detect/ + run: go test -v -tags integration -count=1 -coverprofile=coverage-fedora-latest.out ./dnf/ ./rpm/ ./detect/ - uses: actions/upload-artifact@v4 if: always() with: @@ -119,7 +119,7 @@ jobs: run: | apk add --no-cache sudo tree bash - name: Integration tests - run: go test -v -tags integration -count=1 -coverprofile=coverage-alpine.out -coverpkg=./... ./apk/ ./detect/ + run: go test -v -tags integration -count=1 -coverprofile=coverage-alpine.out ./apk/ ./detect/ - uses: actions/upload-artifact@v4 if: always() with: @@ -140,7 +140,7 @@ jobs: pacman -Syu --noconfirm pacman -S --noconfirm sudo tree - name: Integration tests - run: go test -v -tags integration -count=1 -coverprofile=coverage-arch.out -coverpkg=./... ./pacman/ ./detect/ + run: go test -v -tags integration -count=1 -coverprofile=coverage-arch.out ./pacman/ ./detect/ - uses: actions/upload-artifact@v4 if: always() with: @@ -164,7 +164,7 @@ jobs: sudo apt-get install -y flatpak sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo - name: Integration tests - run: sudo -E go test -v -tags integration -count=1 -coverprofile=coverage-flatpak.out -coverpkg=./... ./flatpak/ + run: sudo -E go test -v -tags integration -count=1 -coverprofile=coverage-flatpak.out ./flatpak/ - uses: actions/upload-artifact@v4 if: always() with: diff --git a/apk/apk_integration_test.go b/apk/apk_integration_test.go index 6e08fb9..7c2f9d2 100644 --- a/apk/apk_integration_test.go +++ b/apk/apk_integration_test.go @@ -13,7 +13,7 @@ import ( ) func TestIntegration_Apk(t *testing.T) { - mgr := apk.New() + var mgr snack.Manager = apk.New() if !mgr.Available() { t.Skip("apk not available") } diff --git a/apt/apt_integration_test.go b/apt/apt_integration_test.go index ca38161..01acba4 100644 --- a/apt/apt_integration_test.go +++ b/apt/apt_integration_test.go @@ -13,7 +13,7 @@ import ( ) func TestIntegration_Apt(t *testing.T) { - mgr := apt.New() + var mgr snack.Manager = apt.New() if !mgr.Available() { t.Skip("apt not available") } diff --git a/dnf/dnf_integration_test.go b/dnf/dnf_integration_test.go index 2f0f276..cf83442 100644 --- a/dnf/dnf_integration_test.go +++ b/dnf/dnf_integration_test.go @@ -21,7 +21,7 @@ func TestIntegration_DNF_Detection(t *testing.T) { } func TestIntegration_DNF(t *testing.T) { - mgr := dnf.New() + var mgr snack.Manager = dnf.New() if !mgr.Available() { t.Skip("dnf not available") } diff --git a/dpkg/dpkg_integration_test.go b/dpkg/dpkg_integration_test.go index 4388021..5c4e069 100644 --- a/dpkg/dpkg_integration_test.go +++ b/dpkg/dpkg_integration_test.go @@ -13,7 +13,7 @@ import ( ) func TestIntegration_Dpkg(t *testing.T) { - mgr := dpkg.New() + var mgr snack.Manager = dpkg.New() if !mgr.Available() { t.Skip("dpkg not available") } diff --git a/flatpak/flatpak_integration_test.go b/flatpak/flatpak_integration_test.go index 5d71463..ca8b368 100644 --- a/flatpak/flatpak_integration_test.go +++ b/flatpak/flatpak_integration_test.go @@ -13,7 +13,7 @@ import ( ) func TestIntegration_Flatpak(t *testing.T) { - mgr := flatpak.New() + var mgr snack.Manager = flatpak.New() if !mgr.Available() { t.Skip("flatpak not available") } diff --git a/pacman/pacman_integration_test.go b/pacman/pacman_integration_test.go index efaa2c0..fbd84be 100644 --- a/pacman/pacman_integration_test.go +++ b/pacman/pacman_integration_test.go @@ -13,7 +13,7 @@ import ( ) func TestIntegration_Pacman(t *testing.T) { - mgr := pacman.New() + var mgr snack.Manager = pacman.New() if !mgr.Available() { t.Skip("pacman not available") } diff --git a/pkg/pkg_integration_test.go b/pkg/pkg_integration_test.go index 7eb8c53..069fbd0 100644 --- a/pkg/pkg_integration_test.go +++ b/pkg/pkg_integration_test.go @@ -13,7 +13,7 @@ import ( ) func TestIntegration_Pkg(t *testing.T) { - mgr := pkg.New() + var mgr snack.Manager = pkg.New() if !mgr.Available() { t.Skip("pkg not available") } diff --git a/rpm/rpm_integration_test.go b/rpm/rpm_integration_test.go index 3157f3a..de670ec 100644 --- a/rpm/rpm_integration_test.go +++ b/rpm/rpm_integration_test.go @@ -13,7 +13,7 @@ import ( ) func TestIntegration_RPM(t *testing.T) { - mgr := rpm.New() + var mgr snack.Manager = rpm.New() if !mgr.Available() { t.Skip("rpm not available") } diff --git a/snap/snap_integration_test.go b/snap/snap_integration_test.go index 9ff537e..e3d977b 100644 --- a/snap/snap_integration_test.go +++ b/snap/snap_integration_test.go @@ -13,7 +13,7 @@ import ( ) func TestIntegration_Snap(t *testing.T) { - mgr := snap.New() + var mgr snack.Manager = snap.New() if !mgr.Available() { t.Skip("snap not available") }