Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c8d integration: skip TestImportWithCustomPlatform #46652

Merged

Conversation

laurazard
Copy link
Member

@laurazard laurazard commented Oct 16, 2023

- What I did

Fix TestImportWithCustomPlatform (failing in https://github.com/moby/moby/actions/runs/6506688442/job/17672826153)

Skip failing TestImportWithCustomPlatform test cases when using the containerd image store.

- How I did it

Reuse the same validation logic from here

that's already used in here

Split out the "reject" cases from TestImportWithCustomPlatform into a new test TestImportWithCustomPlatformReject, which is skipped when using the containerd image store.

- How to verify it

go test -run TestImportWithCustomPlatform ./integration/image/...
go test -run TestImportWithCustomPlatformReject ./integration/image/...

- Description for the changelog

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

image

@laurazard laurazard added area/images containerd-integration Issues and PRs related to containerd integration labels Oct 16, 2023
@laurazard laurazard added this to the 25.0.0 milestone Oct 16, 2023
@rumpl
Copy link
Member

rumpl commented Oct 16, 2023

With containerd and its shims I don't think we should be checking the platform any more, for example with this change I wouldn't be able to import a Wasm image any more. Maybe it's best to skip this test?

@laurazard
Copy link
Member Author

laurazard commented Oct 16, 2023

Oh, I totally got ahead of myself. Yeah, that makes sense – I'll skip it.

However, this goes back to the discussion about whether we want to

  1. never do any validation for the platform when using the c8d backend (and then throw an error when we try to run the image with no means for running it?) or
  2. do some kind of validation we can run the image before importing it

Regardless I'll remove the check and skip this particular test as it doesn't make sense.

@laurazard laurazard force-pushed the fix-test-import-custom-image-custom-plat branch from ec0ad51 to 27aa4c0 Compare October 16, 2023 11:54
@laurazard laurazard changed the title c8d/image_import: add platform check c8d integration: skip TestImportWithCustomPlatform Oct 16, 2023
@thaJeztah
Copy link
Member

Do we have any test to test the feature? i.e. to verify that I can import a rootfs, and specify what platform to use for it?

@thaJeztah
Copy link
Member

Because this test-table contains both "successful" (expectedErr = "") and "failing" imports, so we probably could still run the successful ones

@laurazard
Copy link
Member Author

I can split the test out into two (the "successful" cases and the ones that aren't supposed to work, and just skip the "failure" test w/ c8d image store.

@thaJeztah
Copy link
Member

Yes, it's probably worth having some tests for this. Maybe as alternative, we could have an extra field in the test-table, so that we can skip based on that one

@laurazard
Copy link
Member Author

laurazard commented Oct 16, 2023

I'd rather split the test and just straight up skip one rather than decide whether to skip dynamically based on an attribute of the test case, for readability. (but if you feel strongly about keeping it as one test I can do that 😅 )

@thaJeztah
Copy link
Member

Either one is fine

@laurazard laurazard force-pushed the fix-test-import-custom-image-custom-plat branch from 27aa4c0 to 61e78ad Compare October 16, 2023 15:15
@laurazard
Copy link
Member Author

@thaJeztah PTAL

@thaJeztah
Copy link
Member

I see this one failing https://github.com/moby/moby/actions/runs/6535667219/job/17745687263?pr=46652, but it's in "test (graphdriver) / integration (ubuntu-20.04, rootless)"; wondering what broke it, or if somehow GitHub actions is reporting results in the wrong place (or running with the wrong options)

=== FAIL: amd64.integration.image TestImportWithCustomPlatformReject/linux/sparc64 (0.01s)
    import_test.go:173: assertion failed: expected an error, got nil
    --- FAIL: TestImportWithCustomPlatformReject/linux/sparc64 (0.01s)

=== FAIL: amd64.integration.image TestImportWithCustomPlatformReject (0.02s)

We support importing images for other platforms when
using the containerd image store, so we shouldn't validate
the image OS on import.

This commit also splits the test into two, so that we can
keep running the "success" import with a custom platform tests
running w/ c8d while skipping the "error/rejection" test cases.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
@laurazard laurazard force-pushed the fix-test-import-custom-image-custom-plat branch from 61e78ad to 6f625ae Compare October 16, 2023 17:08
@laurazard
Copy link
Member Author

Ahh I slipped while copy-pasting 😅 1 sec

@laurazard
Copy link
Member Author

I don't think the remaining failures have to do with this test – @thaJeztah can you TAL?

@thaJeztah
Copy link
Member

LOL, I was trying to find the failing tests in the report (as the logs output was a bit hard to find them all), and then realised they weren't shown as Github was hiding them https://github.com/moby/moby/actions/runs/6536940074

Screenshot 2023-10-17 at 13 51 48

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit b85185e into moby:master Oct 17, 2023
119 of 139 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/images containerd-integration Issues and PRs related to containerd integration status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants