-
Notifications
You must be signed in to change notification settings - Fork 53
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
Running Cypress in Docker #3688
Conversation
93bd050
to
91f6ca6
Compare
78b2a6d
to
a92d049
Compare
2cb95c2
to
554c13c
Compare
This has been tested by 3 devs locally.
#!/bin/bash | ||
|
||
echo "git config --global --add safe.directory /app" | ||
git config --global --add safe.directory /app |
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.
What does this do? Curious what problem it resolves
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.
This is a workaround to a reported bug, it resolves a "dubious" permissions error when running the frontend with docker. We run a git command on frontend startup and this is required to do that.
@@ -5,14 +5,14 @@ | |||
"url" : "/api/v1/users?activate=false", | |||
"method" : "POST", | |||
"bodyPatterns" : [ { | |||
"equalToJson" : "{\"profile\":{\"firstName\":\"Greg\",\"lastName\":\"McTester\",\"login\":\"[email protected]\",\"email\":\"[email protected]\"},\"groupIds\":[\"00g228nyd7uuGaG1L1d7\",\"00g228nrj9QDJ10y61d7\"]}", | |||
"equalToJson" : "{\"profile\":{\"firstName\":\"Greg\",\"lastName\":\"McTester\",\"login\":\"${json-unit.any-string}\",\"email\":\"${json-unit.any-string}\"},\"groupIds\":[\"00g228nyd7uuGaG1L1d7\",\"00g228nrj9QDJ10y61d7\"]}", |
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.
this is a neat trick!
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.
thought I'm realizing this is in an auto-generated file 🤣
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.
@georgehager mostly auto-generated! It's created by WireMock but this any-string
piece is hand-touched :)
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.
This was a manual update to allow for any email. Doing so lets us add more people and not need to clean the db every time.
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.
Neat! I saw in the test we type in user.email
so that makes sense!
- Run Cypress locally and open interactive mode. Do this if you're running the apps locally with docker-compose with Okta enabled. | ||
- `yarn e2e:nginx:okta` | ||
|
||
### Potential issues: |
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.
Super helpful!
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.
Looks great! this will make running e2es locally so much easier 🙌
@alismx did you decide not to add a command for running all e2e tests headless locally outside of docker? It's something I imagine wanting to do occasionally, so I don't think it's super critical and might not be worth the effort of adding another separate command since they can all be run in open mode. |
What do you say about making a follow-up ticket? I can write that up and link it here. |
Yep I think that's great! Like I said, not super critical 😁 |
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.
Couple questions for you alis! Thank you for your all your work on this! 😭 🙌
CYPRESS_OKTA_SECRET= | ||
CYPRESS_OKTA_REDIRECT_URI="https%3A%2F%2Ftest.simplereport.gov%2Fapp%2F" | ||
CYPRESS_OKTA_SCOPE="simple_report_test" | ||
CYPRESS_OKTA_CLIENT_ID="0oa1khettjHnj3EPT1d7" |
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 this ok to have checked in? 🤔
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.
Committing this value to the repo is fine. The client id is very easy to find in our auth flow as it gets passed around in the URL of the auth requests. We don't want to expose API keys or secrets.
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.
Got it! Thank you @alismx :D
@@ -0,0 +1,123 @@ | |||
## E2E tests |
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.
thank you for so thoroughly updating this!
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.
😅
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.
+1, this is awesome! Once this is merged, would you mind also adding it to the wiki? (or just linking to this README somewhere on our getting started wiki page)
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!! Thank you!! 😹
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.
Looks awesome Alis, thanks for all your work on this! 🙌
runs-on: ubuntu-latest | ||
needs: [deploy] | ||
defaults: | ||
run: |
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.
Curious why we're no longer verifying the release for dev
?
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.
This check is the first test of the cypress suite, which happens locally during the PR process and against the test
environment once a merge goes through. This was only in place until we could run the whole suite against a remote environment in its entirety.
I wouldn't mind this type of check for all of our remote environments, but it does take some time because of its dependence on spinning up cypress.
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.
I see, thanks for the explanation!
@@ -0,0 +1,123 @@ | |||
## E2E tests |
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.
+1, this is awesome! Once this is merged, would you mind also adding it to the wiki? (or just linking to this README somewhere on our getting started wiki page)
I can't seem to merge this until the sonar job is fixed. |
@alismx, it looks like "test Expected — Waiting for status to be reported" is the hold up. The sonar check is not "required" |
@snesm Sonar is the issue. There is a dependent check in the "test" workflow. PR is already in with the bypass. |
@snesm @rin-skylight @emmastephenson Not sure what I'm missing, but it seems like this "test" check is only blocking this PR. I thought it was because of the Sonar issue failing, but now that we've merged in that sonar bypass, I believe that's been ruled out. Has anybody seen this before? Does anybody see any issues with the github workflows in this PR? |
@alismx This can happen on occasion. Creating a PR with a new branch, that has all of your existing changes, will likely be the easiest thing to kick the checks into gear. I've forced a re-run of the |
Cypress PULL REQUEST
resolves #1770
resolves #3280
resolves #3637
Related Issue
Changes Proposed
Additional Information
Testing
Checklist for Primary Reviewer
Infrastructure
terraform-plan
job inside the "Terraform Checks" workflow run for this PR. Confirm that there are no unexpected changes!Security
Cloud
test
,dev
, orpentest
environment for verification