diff --git a/e2e-docker/docker_local_test.go b/e2e-docker/docker_local_test.go index 0b219d7..d022010 100644 --- a/e2e-docker/docker_local_test.go +++ b/e2e-docker/docker_local_test.go @@ -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) diff --git a/e2e-docker/helm_local_test.go b/e2e-docker/helm_local_test.go index b7debcc..d19fddd 100644 --- a/e2e-docker/helm_local_test.go +++ b/e2e-docker/helm_local_test.go @@ -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://") diff --git a/e2e-docker/local_test.go b/e2e-docker/local_test.go index ecd4409..d6a571e 100644 --- a/e2e-docker/local_test.go +++ b/e2e-docker/local_test.go @@ -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) }