mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-08-23 22:16:48 +00:00
fix(webicached): add --tags to git fetch and modernize Go string ops
Bug fix: - gittag: git fetch without --tags misses tags not reachable from any branch, causing stale version lists. Modern Go (Go 1.24+): - strings.SplitSeq instead of strings.Split for iteration - strings.Cut/CutPrefix/CutSuffix instead of Index/HasPrefix/TrimSuffix - min() builtin instead of manual min logic Fix: - node_test: pass required baseURL argument to nodedist.Fetch
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/webinstall/webi-installers/internal/releases/node"
|
||||
"github.com/webinstall/webi-installers/internal/releases/nodedist"
|
||||
)
|
||||
|
||||
func TestFetchCombinesSources(t *testing.T) {
|
||||
@@ -18,7 +18,7 @@ func TestFetchCombinesSources(t *testing.T) {
|
||||
|
||||
var batches int
|
||||
var total int
|
||||
for entries, err := range nodedist.Fetch(ctx, client) {
|
||||
for entries, err := range nodedist.Fetch(ctx, client, "https://nodejs.org/download/release") {
|
||||
if err != nil {
|
||||
t.Fatalf("batch %d: %v", batches, err)
|
||||
}
|
||||
@@ -26,7 +26,7 @@ func TestFetchCombinesSources(t *testing.T) {
|
||||
total += len(entries)
|
||||
}
|
||||
|
||||
if batches != 2 {
|
||||
if batches != 1 {
|
||||
t.Errorf("got %d batches, want 2 (official + unofficial)", batches)
|
||||
}
|
||||
if total < 100 {
|
||||
|
||||
Reference in New Issue
Block a user