Skip to content

Conversation

@Honny1
Copy link
Member

@Honny1 Honny1 commented Oct 21, 2025

This PR refactors the podman search e2e tests to eliminate external network dependencies and improve test reliability by introducing a comprehensive mock registry server.

Fixes: #27304
Fixes: https://issues.redhat.com/browse/RUN-3623

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Oct 21, 2025
@Honny1 Honny1 force-pushed the search-tests-without-net branch from 1188b17 to a5e82e5 Compare October 21, 2025 07:40
@packit-as-a-service
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@Honny1 Honny1 marked this pull request as ready for review October 21, 2025 10:43
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 21, 2025
search := podmanTest.Podman([]string{"search", "quay.io/podman/stable"})
search.WaitWithDefaultTimeout()
Expect(search).Should(ExitCleanly())
registryAddress, srv, serverErr := CreateMockRegistryServer()
Copy link
Member

Choose a reason for hiding this comment

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

Can this be done in a BeforeEach?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I have changed the test to use BeforeEach and AfterEach.

@Honny1 Honny1 requested a review from mheon October 22, 2025 09:59
contentTypeJSON = "application/json"
)

var searchResults = map[string]interface{}{
Copy link
Member

Choose a reason for hiding this comment

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

s/interface{}/any everywhere please

Copy link
Member

Choose a reason for hiding this comment

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

please squash these changes into the proper commit where you added them, appending them into the last commit makes it harder to review commit for commit and isn't right, the interface{} syntax should not be introduced to begin with.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I fixed it.

Expect(search).To(ExitWithError(125, "getting repository tags: fetching tags list: StatusCode: 404"))
Expect(search.OutputToStringArray()).To(BeEmpty())
})
Describe("podman search do not crash on public registries", func() {
Copy link
Member

Choose a reason for hiding this comment

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

I think we should really not do this anymore, any public dependency will bite us. You now make us depend on at least three different registries which can still fail if the registry is down.

At the very least this should be skipped on PRs but I rather not do this at all as part of the normal CI.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I'll remove it.

@Honny1 Honny1 force-pushed the search-tests-without-net branch from de5401c to 49fc8ab Compare October 22, 2025 14:18
@Honny1 Honny1 requested a review from Luap99 October 24, 2025 08:22
@Honny1 Honny1 force-pushed the search-tests-without-net branch from 49fc8ab to fcb24aa Compare October 24, 2025 11:54
- Add comprehensive mock registry server for e2e search tests
- Replace quay.io and other external registry calls with local mock
- Improve test reliability by removing network dependencies
- Maintain full test coverage with controlled mock data

Fixes: containers#27304
Fixes: https://issues.redhat.com/browse/RUN-3623

Signed-off-by: Jan Rodák <[email protected]>
@Honny1 Honny1 force-pushed the search-tests-without-net branch from fcb24aa to af2d913 Compare October 24, 2025 11:58
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 24, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Honny1, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

podman search with wildcards fails

3 participants