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

Cypress helpers for local & remote EE, changing settings #1116

Merged
merged 9 commits into from
Oct 25, 2021

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Oct 21, 2021

This extracts the helper parts from #1082 & #1113 :

  • cy.addRemoteRegistry - add a remote registry via the UI (from Delete registries, add registries, edit, view registries test. #1027, moving to a helper)
  • cy.addRemoteContainer - add a remote container via the UI
  • cy.syncRemoteContainer - trigger a remote container sync using the UI
  • cy.addLocalContainer - exec podman pull/push to add a local container
  • cy.settings - change server settings, restart, and wait for it to start responding

❗ The cy.settings command needs 2 settings in cypress.env.json:

  • settings: the location of settings.py, relative to test/
  • restart: a command to run to apply any settings changes

Invoking cy.settings() without params resets settings.py to original (actually removes lines containing #CYPRESS), and restarts
Invoking cy.settings({ FOO: true }) adds a FOO = True #CYPRESS to settings.py, and restarts

Note: this will work for values like true, false, null, numbers, strings with no interpolation, an array of strings or numbers; but would need more work for passing arrays of objects and such, if we ever need it.

Also added a cypress.env.json.template - easier to copy than to create cypress.env.json from scratch.

Cc @ZitaNemeckova @ShaiahWren

the command needs 2 settings in `cypress.env.json`:
  `settings`: the location of `settings.py`, relative to `test/`
  `restart`: a command to run to apply any settings changes

invoking `cy.settings()` without params resets `settings.py` to original (actually removes lines with `#CYPRESS`), and restarts
invoking `cy.settings({ FOO: true })` adds a `FOO = True #CYPRESS` to `settings.py`, and restarts
Copy link
Contributor

@ShaiahWren ShaiahWren left a comment

Choose a reason for hiding this comment

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

LGTM

@himdel himdel merged commit 84ef1f9 into ansible:master Oct 25, 2021
@himdel himdel deleted the cypress-helpers branch October 25, 2021 17:38
@himdel himdel added the backport-4.4 This PR should be backported to stable-4.4 (2.1) label Oct 29, 2021
@patchback

This comment has been minimized.

@himdel himdel added backport-4.4 This PR should be backported to stable-4.4 (2.1) and removed backport-4.4 This PR should be backported to stable-4.4 (2.1) labels Oct 29, 2021
@patchback
Copy link

patchback bot commented Oct 29, 2021

Backport to stable-4.4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4.4/84ef1f96a0f9d7d31d4c20f557543b0e6db42b3e/pr-1116

Backported as #1146

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Oct 29, 2021
* cypress: add `cy.settings` command

the command needs 2 settings in `cypress.env.json`:
  `settings`: the location of `settings.py`, relative to `test/`
  `restart`: a command to run to apply any settings changes

invoking `cy.settings()` without params resets `settings.py` to original (actually removes lines with `#CYPRESS`), and restarts
invoking `cy.settings({ FOO: true })` adds a `FOO = True #CYPRESS` to `settings.py`, and restarts

* cypress.env.json.template: add non-gitignored version of cypress.env.json

easier to copy/rename than create :)

* cypress.yml: add settings, restart to cypress.env.json

* add sleep to github restart command, wait for 200 from api in command

* cy.settings - more wait

* cy.addRemoteRegistry - move from remote registry test, needed in containers for now

* cy.addRemoteContainer - use the add execution environment form, add a container

* cy.addLocalContainer - use cy.exec + podman pull/push to add a local container

* cy.syncRemoteContainer - use the UI to initiate a container sync

(cherry picked from commit 84ef1f9)
himdel added a commit that referenced this pull request Oct 29, 2021
* cypress: add `cy.settings` command

the command needs 2 settings in `cypress.env.json`:
  `settings`: the location of `settings.py`, relative to `test/`
  `restart`: a command to run to apply any settings changes

invoking `cy.settings()` without params resets `settings.py` to original (actually removes lines with `#CYPRESS`), and restarts
invoking `cy.settings({ FOO: true })` adds a `FOO = True #CYPRESS` to `settings.py`, and restarts

* cypress.env.json.template: add non-gitignored version of cypress.env.json

easier to copy/rename than create :)

* cypress.yml: add settings, restart to cypress.env.json

* add sleep to github restart command, wait for 200 from api in command

* cy.settings - more wait

* cy.addRemoteRegistry - move from remote registry test, needed in containers for now

* cy.addRemoteContainer - use the add execution environment form, add a container

* cy.addLocalContainer - use cy.exec + podman pull/push to add a local container

* cy.syncRemoteContainer - use the UI to initiate a container sync

(cherry picked from commit 84ef1f9)

Co-authored-by: Martin Hradil <mhradil@redhat.com>
@github-actions github-actions bot added the backported-4.4 This PR has been backported to stable-4.4 (2.1) label Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-4.4 This PR should be backported to stable-4.4 (2.1) backported-4.4 This PR has been backported to stable-4.4 (2.1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants