mirror of
https://github.com/gogrlx/snack.git
synced 2026-04-02 05:08:42 -07:00
feat: add integration tests and GitHub Actions CI
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.
This commit is contained in:
29
detect/detect_integration_test.go
Normal file
29
detect/detect_integration_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
//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())
|
||||
}
|
||||
Reference in New Issue
Block a user