-
Notifications
You must be signed in to change notification settings - Fork 541
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
Add .github/workflows/e2e.yml #2968
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #2968 +/- ##
============================================
- Coverage 62.18% 48.61% -13.57%
============================================
Files 250 227 -23
Lines 45507 33359 -12148
Branches 319 319
============================================
- Hits 28297 16217 -12080
+ Misses 17210 17142 -68
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
e2e/index.ts
Outdated
// if (!options.headed) { | ||
// throw new Error( | ||
// "Cypress is running in headless mode, but screenshotting doesn't work as expected in this mode with looker. See https://github.com/cypress-io/cypress/issues/15605 for more details." | ||
// ); | ||
// } |
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.
could you uncomment these?
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.
@benjaminpkane @aidavoxel51 I couldn't get headless mode to work with screenshotting canvases. If it works, then great!!
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.
Yeah, headed is required. Reverted
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 good! A couple small comments. I am looking into fixing the tests themselves right now
.github/workflows/e2e.yml
Outdated
@@ -0,0 +1,80 @@ | |||
name: Test e2e | |||
|
|||
on: |
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.
Following the existing pattern, can we have this workflow run via on: workflow_call
?
The idea would be we add the workflow call to the PR and Publish workflows.
- https://github.com/voxel51/fiftyone/blob/develop/.github/workflows/pr.yml
- https://github.com/voxel51/fiftyone/blob/develop/.github/workflows/publish.yml
And add it to the needs
lists so the workflows fail/reject when e2e tests fail
fiftyone/.github/workflows/pr.yml
Line 18 in 327789b
needs: [build, test] fiftyone/.github/workflows/publish.yml
Line 19 in 327789b
needs: [build, test] fiftyone/.github/workflows/publish.yml
Line 43 in 327789b
needs: [build, test]
- name: FFmpeg | ||
uses: FedericoCarboni/setup-ffmpeg@v2 | ||
|
||
- name: Run 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.
The test step is currently passing when tests fail. Ideally this will fail when tests fail so the workflow calls can then fail
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 saw you made the changes, were you able to test it?
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, it works. The process will exit nonzero if 1 or more tests fail
|
||
- name: Run e2e tests | ||
run: | | ||
FIFTYONE_DATABASE_NAME=cypress python ../fiftyone/server/main.py --address 0.0.0.0 --port 8787 & |
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.
@benjaminpkane Is this supposed to replace the fake server? 🥳 that's cool, but yarn start
will no longer start cypress correctly locally, no?
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 guess we could add something like:
"cy:run": "FIFTYONE_DATABASE_NAME=cypress python ../fiftyone/server/main.py --address 0.0.0.0 --port 8787 & cypress 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.
Yes, I'll tweak it
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'm proposing the background server is started manually by the developer when testing locally with yarn start-test-server
. I updated the readme. Trying to avoid creating orphaned processes
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. I'm comfortable merging. I did end up removing some of the existing cypress subprocess code in favor of a blocking approach to the Python subprocess execution. @sashankaryal @aidavoxel51
* Add .github/workflows/e2e.yml * Update yml name .github/workflows/e2e.yml * Update from workflow_dispatch to on:push:branches:e2e-ci in .github/workflows/e2e.yml * Remove yarn build .github/workflows/e2e.yml * Add env ELECTRON_EXTRA_LAUNCH_ARGS to e2e.yml * Add .github/workflows/e2e.yml * Update yml name .github/workflows/e2e.yml * Update from workflow_dispatch to on:push:branches:e2e-ci in .github/workflows/e2e.yml * Remove yarn build .github/workflows/e2e.yml * Add env ELECTRON_EXTRA_LAUNCH_ARGS to e2e.yml * use 0.0.0.0 * remove wait-on * use 0.0.0.0 in ghost server as well * improve test resilience * increase ghost server timeout * increase app wait timeout * increase app wait timeout even more :( * run without cypress actions workflow * correct syntax-error on working-directory * use ubuntu latest * use ubuntu latest * Add npm install --save-dev tsconfig-paths * Add yarn install =) * Change DEFAULT_APP_HOSTNAME in e2e/lib/constants.ts * Change DEFAULT_APP_HOSTNAME in e2e * Add debug logs * Switch --headful to --headless in e2e/index.ts * Comment out options.headed{} * Add fiftyone app connect command * Fix line * Add debugging * Correct connect * Add set -x * Set remote to false * Update DEFAULT_APP_ADDRESS * Add debugging * make local tests pass * use event driven way to shut ghost server * background server * update name * testing * testing * cypress * experiment * mv startup * tweaks * path fix * no wait * typo * wait * upload artifacts * node change * edit * Add build steps * Add step Install fiftyone in e2e.yml * 0.0.0.0 * Add trigger and cleanup * short circuit * fix modal * headed * cleanup * update workflows * edits * Add e2e to pr.yml and publish.yml * edits * exit code * update e2e readme --------- Co-authored-by: Sashank Aryal <[email protected]> Co-authored-by: Benjamin Kane <[email protected]>
What changes are proposed in this pull request?
Added e2e.yml to run e2e/* tests in pull requests to develop.
How is this patch tested? If it is not, please explain why.
Test job run https://github.com/voxel51/fiftyone/actions/runs/4887646675/jobs/8724476236
Release Notes
Is this a user-facing change that should be mentioned in the release notes?
notes for FiftyOne users.
(Details in 1-2 sentences. You can just refer to another PR with a description
if this PR is part of a larger change.)
What areas of FiftyOne does this PR affect?
fiftyone
Python library changes