Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: kimsungmin1 <142377392+kimsungmin1@users.noreply.github.com>
- Use (*net.ListenConfig).Listen with the test context instead of
net.Listen (noctx).
- Use suite.NoError instead of suite.Nil for the error check
(testifylint).
- Drop the unnecessary leading blank lines in the scope test funcs
(whitespace).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: kimsm28 <sm28.kim@samsung.com>
The scope test configured a TLS registry while advertising an http token
realm. oras refuses to send credentials to an http token realm when the
registry itself was contacted over https, so the auth server was never
reached and the test timed out ("timeout waiting for auth request").
Use a plain-http registry so the registry and token-realm schemes match;
the scope carried in the token request is what this test verifies, and
that is independent of TLS.
Also make the auth handler's channel send non-blocking so that a client
retry can never block the handler and stall the push/pull flow, which
addresses the review comment about a potential deadlock.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: kimsm28 <sm28.kim@samsung.com>
- Fix data race by using channel instead of shared variable for requestURL
- Make assertions more robust by parsing URL and checking query parameters instead of exact string matching
Signed-off-by: kimsm28 <sm28.kim@samsung.com>
- Change 'bellow' to 'below' (spelling correction in multiple places)
- Change 'WithScopeHint' to 'withScopeHint' to match actual function name
Signed-off-by: kimsm28 <sm28.kim@samsung.com>
- Change DockerRegistryHost to use 127.0.0.1 for HTTP tests and helm-test-registry for TLS tests to match certificate hostname
- Add defer ln.Close() to prevent resource leak in token auth server setup
- Restore requestURL variable and assertion in test body instead of handler to avoid potential race condition
Signed-off-by: kimsm28 <sm28.kim@samsung.com>
Replace native Go testing patterns (t.Errorf, t.Fatalf, t.Error,
t.Fatal) with github.com/stretchr/testify equivalents (assert.X,
require.X) for improved test readability and error messages.
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
Replace native Go testing patterns (t.Errorf, t.Fatalf, t.Error,
t.Fatal) with github.com/stretchr/testify equivalents (assert.X,
require.X) for improved test readability and error messages.
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
Replace native Go testing patterns (t.Errorf, t.Fatalf, t.Error,
t.Fatal) with github.com/stretchr/testify equivalents (assert.X,
require.X) for improved test readability and error messages.
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
Replace native Go testing patterns (t.Errorf, t.Fatalf, t.Error,
t.Fatal) with github.com/stretchr/testify equivalents (assert.X,
require.X) for improved test readability and error messages.
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
Replace native Go testing patterns (t.Errorf, t.Fatalf, t.Error,
t.Fatal) with github.com/stretchr/testify equivalents (assert.X,
require.X) for improved test readability and error messages.
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
Replace native Go testing patterns (t.Errorf, t.Fatalf, t.Error,
t.Fatal) with github.com/stretchr/testify equivalents (assert.X,
require.X) for improved test readability and error messages.
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
Convert pkg/gates, pkg/kubeenv, pkg/ignore, and pkg/helmpath test
files from native Go testing patterns (t.Errorf, t.Fatalf, t.Error,
t.Fatal) to github.com/stretchr/testify equivalents (assert.X,
require.X).
Signed-off-by: George Jenkins <gvjenkins@gmail.com>