mirror of
https://github.com/gogrlx/snack.git
synced 2026-04-02 05:08:42 -07:00
Add integration test files for all providers (apt, dpkg, pacman, apk, dnf, rpm, flatpak, snap, pkg, detect) behind the 'integration' build tag. Tests exercise real package operations: update, search, info, install, verify, list, remove, and capability interfaces. Add GitHub Actions workflow running unit tests on ubuntu-latest and integration tests on Debian, Ubuntu, Fedora, Alpine, Arch Linux, and Ubuntu+Flatpak containers/runners.
30 lines
584 B
Go
30 lines
584 B
Go
//go:build integration
|
|
|
|
package detect_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/gogrlx/snack"
|
|
"github.com/gogrlx/snack/detect"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestIntegration_Detect(t *testing.T) {
|
|
mgr, err := detect.Default()
|
|
require.NoError(t, err)
|
|
require.NotNil(t, mgr)
|
|
t.Logf("Detected: %s", mgr.Name())
|
|
|
|
all := detect.All()
|
|
require.NotEmpty(t, all)
|
|
for _, m := range all {
|
|
t.Logf("Available: %s", m.Name())
|
|
}
|
|
|
|
caps := snack.GetCapabilities(mgr)
|
|
t.Logf("Capabilities: %+v", caps)
|
|
assert.NotEmpty(t, mgr.Name())
|
|
}
|