refactor: migrate login_linux_test.go to nerdtest.Setup#4907
Open
ogulcanaydogan wants to merge 2 commits into
Open
refactor: migrate login_linux_test.go to nerdtest.Setup#4907ogulcanaydogan wants to merge 2 commits into
ogulcanaydogan wants to merge 2 commits into
Conversation
46 tasks
12056ef to
0b0fc3d
Compare
Contributor
Author
|
The latest push fixes the lint failures caught by CI:
The |
sathiraumesh
suggested changes
May 16, 2026
| (&Client{configPath: configPath}). | ||
| Cmd(helpers, host). | ||
| Run(&test.Expected{ExitCode: 0}) | ||
|
|
Contributor
There was a problem hiding this comment.
can change the status codes to the constants as previous
| username := utils.RandomStringBase64(30) + "∞" | ||
| password := utils.RandomStringBase64(30) + ":∞" | ||
|
|
||
| basicReg = nerdtest.RegistryWithBasicAuth(data, helpers, username, password, 0, false) |
Contributor
There was a problem hiding this comment.
probably put the constant 0 to named variable so it has a meaning full name here (what actually it its)
Replace testutil.NewBase-based test helpers with the Tigron test framework (nerdtest.Setup). Key changes: - Client.Run(base, host) replaced with Client.Cmd(helpers, host) returning test.TestableCommand; DOCKER_CONFIG set via Setenv. - testregistry.NewRegistry / testca.New replaced with nerdtest.RegistryWithBasicAuth, nerdtest.RegistryWithTokenAuth, and lower-level registry.NewCesantaAuthServer + registry.NewDockerRegistry for the token-auth/no-TLS case (HTTP registry, matching original behaviour). - TestLoginPersistence: two SubTests (basic, token) each owning their registry lifecycle via Setup/Cleanup. - TestLoginAgainstVariants: dynamically generated SubTests from the existing test-case table; inner regHost and assertion loops run sequentially inside Setup (equivalent coverage without nested t.Run). - testutil.DockerIncompatible replaced with require.Not(nerdtest.Docker). - TestAgainstNoAuth remains commented out, unchanged. Closes containerd#4613 Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
0b0fc3d to
efc8f73
Compare
Contributor
Author
|
Thanks for the review! Pushed fixes:
|
Signed-off-by: Ogulcan Aydogan <ogulcanaydogan@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate
login_linux_test.goto thenerdtest.Setup()/test.Casepattern, consistent with the ongoing effort tracked in #4613.
Changes
testutil.NewBase(t)withnerdtest.Setup()+test.CaseSetup/Cleanupcallbackshelpers.Ensure/helpers.Anyhowfor container-lifecycle callsexpectconstants for exit codes (ExitCodeSuccess,ExitCodeGenericFail) rather than bare integer literals
variants, insecure-registry flag, hostname variants
Testing
Existing
TestLoginPersistenceandTestLoginAgainstVariantscover thefull matrix. CI runners (rootful/rootless, canary/v1.7.30) validate the
migration.
Part of #4613.