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

Add .github/workflows/e2e.yml #2968

Merged
merged 74 commits into from
May 15, 2023
Merged

Add .github/workflows/e2e.yml #2968

merged 74 commits into from
May 15, 2023

Conversation

aidavoxel51
Copy link
Contributor

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?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release
    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?

  • App: FiftyOne application changes
  • Build: Build and test infrastructure changes
  • Core: Core fiftyone Python library changes
  • Documentation: FiftyOne documentation changes
  • Other

@aidavoxel51 aidavoxel51 requested review from benjaminpkane, sashankaryal and a team May 5, 2023 20:01
@aidavoxel51 aidavoxel51 self-assigned this May 5, 2023
@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Patch coverage: 73.68% and project coverage change: -13.57 ⚠️

Comparison is base (1fa069e) 62.18% compared to head (39d204c) 48.61%.

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     
Flag Coverage Δ
app 48.61% <73.68%> (+0.09%) ⬆️
python ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ages/components/src/components/Results/Results.tsx 29.80% <0.00%> (-1.20%) ⬇️
app/packages/state/src/recoil/sidebar.ts 50.53% <100.00%> (+0.46%) ⬆️

... and 29 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

e2e/index.ts Outdated
Comment on lines 29 to 33
// 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."
// );
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

could you uncomment these?

Copy link
Contributor

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!!

Copy link
Contributor

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

Copy link
Contributor

@benjaminpkane benjaminpkane left a 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

@@ -0,0 +1,80 @@
name: Test e2e

on:
Copy link
Contributor

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.

And add it to the needs lists so the workflows fail/reject when e2e tests fail

- name: FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v2

- name: Run e2e tests
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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 &
Copy link
Contributor

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?

Copy link
Contributor

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"

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

@benjaminpkane benjaminpkane left a 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

@benjaminpkane benjaminpkane merged commit c9f37ad into develop May 15, 2023
@benjaminpkane benjaminpkane deleted the e2e-ci branch May 15, 2023 14:37
lanzhenw pushed a commit that referenced this pull request May 15, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants