-
Notifications
You must be signed in to change notification settings - Fork 75
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
Fix cy.addLocalContainer
on github actions
#1142
Conversation
c437ea7
to
db4a5b4
Compare
cy.addLocalContainer
on github actions
…lhost:8002 when pushing containers pulp-oci-images fails when using 5001, local dev fails when using 8002, making configurable
* view-only: simple test for view-only mode * view-only: add tests * view-only: galaxykit collection upload, to ensure there's a collection both describes need it * test/README: mention cypress.env.json.template, document `settings` and `restart` * view-only: actually go to namespace detail and wait for namespace detail title * github cypress settings.py: turn off collections approval (GALAXY_REQUIRE_CONTENT_APPROVAL) GALAXY_REQUIRE_CONTENT_APPROVAL=True is the default, and causes collections added by `galaxykit collection upload` to only appear in Approvals UI, where they need to be approved first before appearing (AAH-628 is open for approval tests) * test/README: also document `containers` in `cypress.env.json`, from #1142
* view-only: simple test for view-only mode * view-only: add tests * view-only: galaxykit collection upload, to ensure there's a collection both describes need it * test/README: mention cypress.env.json.template, document `settings` and `restart` * view-only: actually go to namespace detail and wait for namespace detail title * github cypress settings.py: turn off collections approval (GALAXY_REQUIRE_CONTENT_APPROVAL) GALAXY_REQUIRE_CONTENT_APPROVAL=True is the default, and causes collections added by `galaxykit collection upload` to only appear in Approvals UI, where they need to be approved first before appearing (AAH-628 is open for approval tests) * test/README: also document `containers` in `cypress.env.json`, from #1142 (cherry picked from commit fb0a8d0)
* view-only: simple test for view-only mode * view-only: add tests * view-only: galaxykit collection upload, to ensure there's a collection both describes need it * test/README: mention cypress.env.json.template, document `settings` and `restart` * view-only: actually go to namespace detail and wait for namespace detail title * github cypress settings.py: turn off collections approval (GALAXY_REQUIRE_CONTENT_APPROVAL) GALAXY_REQUIRE_CONTENT_APPROVAL=True is the default, and causes collections added by `galaxykit collection upload` to only appear in Approvals UI, where they need to be approved first before appearing (AAH-628 is open for approval tests) * test/README: also document `containers` in `cypress.env.json`, from #1142 (cherry picked from commit fb0a8d0) Co-authored-by: Martin Hradil <mhradil@redhat.com>
No luck with podman for me. BUT it works for me with docker :) So here's my changes that worked for me diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 81935c07..f0eed4d2 100644
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -546,24 +546,24 @@ Cypress.Commands.add(
const server = Cypress.env('containers');
return cy
- .exec(shell`podman pull ${registry + remoteName}`)
+ .exec(shell`docker pull ${registry + remoteName}`)
.then(log, logFail)
.then(() =>
cy.exec(
- shell`podman image tag ${remoteName} ${server}/${localName}:latest`,
+ shell`docker image tag ${remoteName} ${server}/${localName}:latest`,
),
)
.then(log, logFail)
.then(() =>
cy.exec(
- shell`podman login ${server} --tls-verify=false --username=admin --password=admin`,
+ shell`docker login ${server} --tls-verify=false --username=admin --password=admin`,
{ failOnNonZeroExit: false },
),
)
.then(log, logFail)
.then(() =>
cy.exec(
- shell`podman push ${server}/${localName}:latest --tls-verify=false`,
+ shell`docker push ${server}/${localName}:latest`,
{ failOnNonZeroExit: false },
),
)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge it and anyone with local problems will switch to docker if needed.
Backport to stable-4.4: 💚 backport PR created✅ Backport PR branch: Backported as #1190 🤖 @patchback |
* addLocalContainer - call each command separately, with login & port 8002 * cypress.env.json: add .containers, use instead of localhost:5001/localhost:8002 when pushing containers pulp-oci-images fails when using 5001, local dev fails when using 8002, making configurable (cherry picked from commit ad376a9)
* addLocalContainer - call each command separately, with login & port 8002 * cypress.env.json: add .containers, use instead of localhost:5001/localhost:8002 when pushing containers pulp-oci-images fails when using 5001, local dev fails when using 8002, making configurable (cherry picked from commit ad376a9) Co-authored-by: Martin Hradil <mhradil@redhat.com>
Follow-up to #1116, which adds the helper
Successful run using the container: https://github.com/ansible/ansible-hub-ui/runs/4053371839?check_suite_focus=true (had an extra commit with a version of the test being added in #1141)
Without this, the command fails on
podman push
for 2 reasons:podman login
firstlocalhost:5001
works in dev, but not with pulp-oci-images, and vice versalocalhost:8002
on pulp-oci-images while keepinglocalhost:5001
incypress.env.json.template
This also switches from running one shell to run 3 commands, to running 4 commands separately in a row, to better catch error codes and stdout/stderr of each command. This should mean better error messages if something breaks again.
Should unblock: #1113, #1141
❕ Note: when testing locally, most likely you first need to add
"containers": "localhost:5001"
to yourtest/cypress.env.json
(seetest/cypress.env.json.template
) (documented in #1082, to prevent conflicts)