Skip to content

integration-cli: migrate TestCreateByImageID to integration suite#49198

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:migrate_TestCreateByImageID
Jan 8, 2025
Merged

integration-cli: migrate TestCreateByImageID to integration suite#49198
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:migrate_TestCreateByImageID

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Jan 2, 2025

This test originally added in 4352da7,
and was a bit involved as it involved building an image, and had some
dubious test-cases, such as using wrongimage:<ID of other image> as
reference, and expecting that to produce a "not found" error. Possibly
this format was supported in the past, but currently it fails equally with
correctimage:<ID of image>.

This patch rewrites the test to an integration test, and removes the test
from integration-cli. It also removes TestCreate64ByteHexID, as it was
duplicated by this test.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added status/2-code-review area/testing kind/refactor PR's that refactor, or clean-up code labels Jan 2, 2025
@thaJeztah thaJeztah added this to the 28.0.0 milestone Jan 2, 2025
@thaJeztah thaJeztah self-assigned this Jan 2, 2025
Comment on lines +96 to +98
doc: "image ID without algorithm",
image: imgID,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is testing the same as

// #20972
func (s *DockerCLICreateSuite) TestCreate64ByteHexID(c *testing.T) {
out := inspectField(c, "busybox", "Id")
imageID := strings.TrimPrefix(strings.TrimSpace(out), "sha256:")
cli.DockerCmd(c, "create", imageID)
}

Let me remove that test, and add a comment here that it's related to #20972

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☝️ done 👍

@thaJeztah thaJeztah force-pushed the migrate_TestCreateByImageID branch from d9b9d02 to c6f0613 Compare January 2, 2025 23:11
This test originally added in 4352da7,
and was a bit involved as it involved building an image, and had some
dubious test-cases, such as  using `wrongimage:<ID of other image>` as
reference, and expecting that to produce a "not found" error. Possibly
this format was supported in the past, but currently it fails equally with
`correctimage:<ID of image>`.

This patch rewrites the test to an integration test, and removes the test
from integration-cli. It also removes TestCreate64ByteHexID, as it was
duplicated by this test.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the migrate_TestCreateByImageID branch from c6f0613 to a646467 Compare January 2, 2025 23:12
@thaJeztah thaJeztah merged commit 641e2fc into moby:master Jan 8, 2025
@thaJeztah thaJeztah deleted the migrate_TestCreateByImageID branch January 8, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants