-
Notifications
You must be signed in to change notification settings - Fork 81
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
Cypress on GitHub Actions #378
Conversation
to be able to install master galaxy_ng without conflicts
… changed, else load and use podman repo prefixes
push: | ||
branches: [ $default-branch stable-* ] | ||
# daily on $default-branch | ||
schedule: |
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.
is a daily job necessary? We should be pretty well covered with branch and push builds
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.
Definitely not necessary :)
Pretty much the only use for a scheduled job in our circumstances is to check that the latest galaxy_ng
changes don't break our UI.
So, I think it has some value, but maybe not quite daily?
What about weekly?
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.
Love it
I assume this can be backported to 4.2 and 4.3, right? |
podman run \ | ||
--detach \ | ||
--publish 8002:80 \ |
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.
FYI: we are planning to change the container to use https:
pulp/pulp-oci-images#73
In the future you may need to:
--publish 8002:80 \ | |
--publish 8002:443 \ |
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.
@fao89 could that be implemented as an optional setting?
I don't really see any value in generating a self-signed certificate, using it on the webserver, and running cypress in "ignore SSL certificates" mode or having to copy the certificate there, just so https works in a way that http already does.
We can probably work around that on our side, but if that feature could be made optional, it may be preferrable :). Thanks :).
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.
yes, we are discussing two options now:
- tag latest: https; tag nossl: http
- tag latest: http; tag https: https
so if we make latest
defaults to https, it is just a matter of using nossl
tag
I'll keep you informed, but if you want to follow the discussion, it is happening on pulp-dev:
https://listman.redhat.com/archives/pulp-dev/2021-May/msg00008.html
working-directory: 'pulp_galaxy_ng' | ||
run: | | ||
echo '\ | ||
FROM docker.io/pulp/pulp-ci-centos:latest |
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.
you can test the https container version by using
FROM docker.io/pulp/pulp-ci-centos:latest | |
FROM docker.io/pulp/pulp-ci-centos:https |
@himdel @newswangerd @calvin hello from the other side! I went snooping for an example of the github codecov integration and stumbled into this PR :) Please ping @tiago, @apurva, and @brum on the Ansible team. We had been using Cypress with Github Actions for a few months and I think it would be great to collaborate on some common tooling or at least get contextual PR review. Also, Apurva on the AA team may be taking over Specifically, I'd get feedback on the utility of adhoc job execution and inline Cypress Dashboard reporting |
Definitely, all the branch logic should be using the base branch of a PR, or the branch it was pushed to, so this should work for all the versions. 👍 (Not sure the non-master branches are currently passing, but we can fix any tests/failures when backporting.) |
@unlikelyzero Welcome, well, any reviews are certainly appreciated :) I'm not sure there's much overlap with other projects not based on pulp, or projects not using a split repo ui-api approach, as the bulk is about building and configuring a container, but if you have any ideas, feel free to share :). cypress-io/github-action@v2 looks interesting, though it seems we'd have to get rid of the Inline reporting defintiely looks useful, I'll look into that in a separate PR, at this point I'm not ever sure how the reporting will look without it. (The config doesn't seem to do anything related to inline reporting, so it looks like maybe the cypress action is trying to do too many things.) (I'm not sure what you mean by ad-hoc execution, but we mostly just need this to run on PRs.) |
@himdel nothing to add in terms of approach. This is awesome. The main reason that I mentioned inline reporting is that you can avoid storing test results and videos as CI artifacts. Definitely not specific to this PR; it's something which must be configured by a repo admin on github, itself. The tower-qa repo needed to have an "ad-hoc" workflow file which was separate from the "per PR" workflow file. I'd check in with that team to learn more. Anyways, glad to see GHA + Cypress being used together :) |
Backport to stable-4.2: 💚 backport PR created✅ Backport PR branch: Backported as #430 🤖 @patchback |
* workflows: manual cypress test, initial version * Switch to pulp-oci-images * Override pulp-galaxy-ng pip versions to be able to install master galaxy_ng without conflicts * Configure and run pulp/pulp * Own Containerfile, reset password replaces https://github.com/pulp/pulp-oci-images/blob/latest/pulp_galaxy_ng/Containerfile * switch to /api/galaxy, 8002 * use buildah & podman, no sudo needed for UI replace * upload on failure * cache ~/.npm, Cypress; cache container image, only build if galaxy_ng changed, else load and use podman repo prefixes * cleanup: kill container * cleanup, rename workflow to cypress (cherry picked from commit 6a5688e)
Backport to stable-4.3: 💚 backport PR created✅ Backport PR branch: Backported as #431 🤖 @patchback |
* workflows: manual cypress test, initial version * Switch to pulp-oci-images * Override pulp-galaxy-ng pip versions to be able to install master galaxy_ng without conflicts * Configure and run pulp/pulp * Own Containerfile, reset password replaces https://github.com/pulp/pulp-oci-images/blob/latest/pulp_galaxy_ng/Containerfile * switch to /api/galaxy, 8002 * use buildah & podman, no sudo needed for UI replace * upload on failure * cache ~/.npm, Cypress; cache container image, only build if galaxy_ng changed, else load and use podman repo prefixes * cleanup: kill container * cleanup, rename workflow to cypress (cherry picked from commit 6a5688e)
(Removed backport labels because there's nothing to backport, github uses the master branch to get the workflow, regardless of the branch being tested) |
Fixes https://issues.redhat.com/browse/AAH-529
This adds a Cypress workflow to github actions, configured to:
master
,stable-4.2
andstable-4.3
(stable-*
really)master
The workflow is using the Pulp in One Container images, big thanks to @fao89 for getting these running. (More docs.)
localhost:8002/api/galaxy
Branches:
for a PR from
pr_branch
against ansible-hub-uibase
:checking out
ansible-hub-ui@pr_branch
BRANCH=refs/heads/base
SHORT_BRANCH=base
pip install ...galaxy_ng@base
for a
branch
push on ansible-hub-ui:checking out
ansible-hub-ui@branch
BRANCH=refs/heads/branch
SHORT_BRANCH=branch
pip install ...galaxy_ng@branch
for manual builds, branch is whatever the user chooses, for cron builds it's master
Caching:
~/.npm
and~/.cache/Cypress
get cached with apackage-lock.json
hash key, with fallback to the last cache on the same base branchpulp_galaxy_ng/image
gets cached with a key that is the sha of the top commit on the relevant galaxy_ng branch, no fallback, if the cache doesn't exist, we build the image (~4 minutes) and save it (~1 minute), if it does, we just load it (~1 minute).Artifacts:
on failure, we upload
cypress/screenshots
andcypress/videos
(example: https://github.com/himdel/ansible-hub-ui/actions/runs/797934949)
Timing:
Cc @newswangerd