-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .github/workflows/e2e.yml (#2968)
* 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]>
- Loading branch information
Showing
19 changed files
with
153 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Test e2e | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
test-e2e: | ||
runs-on: ubuntu-latest | ||
env: | ||
FIFTYONE_DO_NOT_TRACK: true | ||
ELECTRON_EXTRA_LAUNCH_ARGS: "--disable-gpu" | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip setuptools wheel | ||
- name: Cache Node Modules | ||
id: node-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
app/node_modules | ||
app/.yarn/cache | ||
key: node-modules-${{ hashFiles('app/yarn.lock') }} | ||
|
||
- name: Install app | ||
if: steps.node-cache.outputs.cache-hit != 'true' | ||
run: cd app && yarn install | ||
|
||
- name: Build app | ||
run: make app | ||
|
||
- name: Install fiftyone | ||
run: pip install . | ||
|
||
- name: Configure | ||
id: test_config | ||
run: | | ||
python tests/utils/setup_config.py | ||
python tests/utils/github_actions_flags.py | ||
- name: FFmpeg | ||
uses: FedericoCarboni/setup-ffmpeg@v2 | ||
|
||
- name: Run e2e tests | ||
run: | | ||
FIFTYONE_DATABASE_NAME=cypress python ../fiftyone/server/main.py --address 0.0.0.0 --port 8787 & | ||
yarn install | ||
yarn start | ||
working-directory: ./e2e | ||
- name: Upload videos | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: videos | ||
path: e2e/cypress/videos | ||
|
||
- name: Upload snapshots | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: snapshots | ||
path: e2e/cypress/snapshots/actual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
e2e/cypress/fixtures/3d/pointcloud-only-datasets - before.cy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
import fiftyone as fo | ||
|
||
fo.delete_datasets("*") | ||
|
||
# note, using __file__ won't work because this is a cypress fixture that gets renamed in runtime | ||
dataset = fo.Dataset(name="pointcloud-only-datasets") | ||
dataset = fo.Dataset(name="pointcloud-only-datasets", persistent=True) | ||
pcd_sample = fo.Sample("cypress/fixtures/3d/resources/cone.pcd") | ||
dataset.add_sample(pcd_sample) | ||
session = fo.launch_app(dataset, remote=True) | ||
session.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,11 @@ | ||
import { DEFAULT_APP_ADDRESS } from "../../lib/constants"; | ||
import { PythonRunner } from "../../lib/python-runner"; | ||
import waitOn from "wait-on"; | ||
|
||
// note: these tasks in node context, i.e. outside of cypress | ||
// note: `cy` is not available in task context | ||
// note: https://docs.cypress.io/api/commands/task | ||
|
||
export const customTasks = { | ||
// task that executes arbitrary python process | ||
executePythonProcessTask: ({ sourceCode }: { sourceCode: string }) => { | ||
return PythonRunner.exec(sourceCode); | ||
}, | ||
// task that kills a process with the given pId | ||
killProcessTask: (props: { pId: number; signal?: string }) => { | ||
const signal = props.signal ?? "SIGTERM"; | ||
const pId = props.pId; | ||
|
||
try { | ||
console.log(`Attempting to kill process ${pId}`); | ||
process.kill(pId, signal); | ||
console.log(`${signal} sent to process ${pId}`); | ||
} catch { | ||
console.log(`Process ${pId} doesn't exist`); | ||
} | ||
|
||
// need to return null to indicate success | ||
return null; | ||
}, | ||
// cy.log logs on the browser console, not in node | ||
logTask: (message: string) => { | ||
console.log(message); | ||
|
||
// need to return null to indicate success | ||
return null; | ||
}, | ||
// poll and wait for fiftyone server to start | ||
waitForFiftyoneAppTask: (timeout: number) => { | ||
console.log(`Waiting for fiftyone app to start, timeout = ${timeout} ms`); | ||
return new Promise((resolve, reject) => | ||
waitOn({ | ||
resources: [DEFAULT_APP_ADDRESS], | ||
timeout: timeout, | ||
}) | ||
// need to return null to indicate success | ||
.then(() => resolve(null)) | ||
.catch(reject) | ||
); | ||
}, | ||
executePythonProcessTask: (sourceCode: string) => | ||
PythonRunner.exec(sourceCode), | ||
}; |
Oops, something went wrong.