Drop the deb index poll change and cite #180 in registry-token skips
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

This commit is contained in:
2026-11-02 22:19:19 +11:00
parent a161c44575
commit c1571f1960
3 changed files with 8 additions and 12 deletions
+1 -1
View File
@@ -226,7 +226,7 @@ func TestLocalDockerCLIPushPull(t *testing.T) {
must(t, nil, "pull", img+":v1")
t.Run("buildx", func(t *testing.T) {
t.Skip("buildkit fetches the registry token with an OAuth2 POST form the server ignores; fixed on benvin/registry-token-oauth-post")
t.Skip("buildkit fetches the registry token with an OAuth2 POST form the server ignores; fixed by unkin/artifactapi#180")
conf := cfg + "/buildkitd.toml"
if err := os.WriteFile(conf, []byte(fmt.Sprintf("[registry.%q]\n http = true\n", reg)), 0o644); err != nil {
t.Fatal(err)
+1 -1
View File
@@ -71,7 +71,7 @@ func TestLocalHelmRealClient(t *testing.T) {
}
t.Run("oci", func(t *testing.T) {
t.Skip("helm (oras-go) fetches the registry token with an OAuth2 POST form the server ignores; fixed on benvin/registry-token-oauth-post")
t.Skip("helm (oras-go) fetches the registry token with an OAuth2 POST form the server ignores; fixed by unkin/artifactapi#180")
createRepo(t, `{"name":"local-helm-oci","package_type":"docker","repo_type":"local"}`)
defer deleteRepo(t, "local-helm-oci")
reg := strings.TrimPrefix(internal, "http://")
+6 -10
View File
@@ -123,23 +123,19 @@ func TestLocalDebRepo(t *testing.T) {
deb := testsupport.MinimalDeb("e2e-testpkg", "1.0.0", "amd64")
uploadFile(t, "local-deb", "e2e-testpkg_1.0.0_amd64.deb", deb, "application/vnd.debian.binary-package")
// The index is served (empty) at once and lists the package only once the
// upload is parsed asynchronously; poll until it does.
var pkgs string
for deadline := time.Now().Add(15 * time.Second); !strings.Contains(pkgs, "Package: e2e-testpkg") && time.Now().Before(deadline); time.Sleep(250 * time.Millisecond) {
resp, body := doRequest(t, http.MethodGet, api("/api/v1/local/local-deb/Packages"), nil, "")
if resp.StatusCode != http.StatusOK {
t.Fatalf("Packages: status %d: %s", resp.StatusCode, body)
}
pkgs = string(body)
// The index is generated asynchronously after upload; poll for it.
resp, body := getEventually(t, api("/api/v1/local/local-deb/Packages"), 15*time.Second)
if resp.StatusCode != http.StatusOK {
t.Fatalf("Packages: status %d: %s", resp.StatusCode, body)
}
pkgs := string(body)
for _, want := range []string{"Package: e2e-testpkg", "Version: 1.0.0", "Architecture: amd64", "Filename: pool/e2e-testpkg_1.0.0_amd64.deb", "SHA256:"} {
if !strings.Contains(pkgs, want) {
t.Fatalf("Packages missing %q:\n%s", want, pkgs)
}
}
resp, body := doRequest(t, http.MethodGet, api("/api/v1/local/local-deb/Release"), nil, "")
resp, body = doRequest(t, http.MethodGet, api("/api/v1/local/local-deb/Release"), nil, "")
if resp.StatusCode != http.StatusOK {
t.Fatalf("Release: status %d: %s", resp.StatusCode, body)
}