fix(ci): update integration tests for NameNormalizer, fix lint and Windows CI

- Update apk/pacman/snap/flatpak integration tests to assert
  NameNormalize=true (all managers now implement NameNormalizer)
- Update flatpak integration test to assert VersionQuery=true
- Remove unused aur functions: rpcInfoMulti, getAURBuildDir
- Wire AUR.Clean to call clean() for consistency
- Fix Windows CI: add shell:bash to avoid PowerShell arg splitting
  on -coverprofile=coverage-windows.out
This commit is contained in:
2026-03-06 04:13:39 +00:00
parent ffbe0e12ba
commit c913d96de3
8 changed files with 9 additions and 40 deletions

View File

@@ -11,7 +11,6 @@ import (
"net/http"
"os"
"os/exec"
"path/filepath"
"strings"
"github.com/gogrlx/snack"
@@ -380,14 +379,4 @@ func upgradePackages(ctx context.Context, pkgs []snack.Target, opts ...snack.Opt
return install(ctx, pkgs, allOpts...)
}
// getAURBuildDir returns the directory to use for AUR builds.
func getAURBuildDir() string {
if dir := os.Getenv("AURDEST"); dir != "" {
return dir
}
if cache := os.Getenv("XDG_CACHE_HOME"); cache != "" {
return filepath.Join(cache, "aur")
}
home, _ := os.UserHomeDir()
return filepath.Join(home, ".cache", "aur")
}

View File

@@ -34,8 +34,8 @@ func (a *AUR) Autoremove(ctx context.Context, opts ...snack.Option) error {
}
// Clean is a no-op for AUR (builds use temp directories).
func (a *AUR) Clean(_ context.Context) error {
return nil
func (a *AUR) Clean(ctx context.Context) error {
return clean(ctx)
}
// UpgradePackages rebuilds and reinstalls specific AUR packages.

View File

@@ -7,7 +7,6 @@ import (
"io"
"net/http"
"net/url"
"strings"
"github.com/gogrlx/snack"
)
@@ -117,23 +116,3 @@ func rpcInfo(ctx context.Context, pkg string) (*snack.Package, error) {
return &p, nil
}
// rpcInfoMulti returns info about multiple AUR packages in a single request.
func rpcInfoMulti(ctx context.Context, pkgs []string) (map[string]rpcResult, error) {
if len(pkgs) == 0 {
return nil, nil
}
params := make([]string, len(pkgs))
for i, p := range pkgs {
params[i] = "arg[]=" + url.QueryEscape(p)
}
endpoint := rpcBaseURL + "/info?" + strings.Join(params, "&")
resp, err := rpcGet(ctx, endpoint)
if err != nil {
return nil, err
}
result := make(map[string]rpcResult, len(resp.Results))
for _, r := range resp.Results {
result[r.Name] = r
}
return result, nil
}