-
Notifications
You must be signed in to change notification settings - Fork 1
Add github action for testing #65
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| pull_request: | ||
| branches: ["main"] | ||
|
|
||
| # Allows you to run this workflow manually from the Actions tab | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
| runs-on: macos-latest | ||
| strategy: | ||
| matrix: | ||
| # TODO enable safari and firefox | ||
| browser: [chrome] | ||
| steps: | ||
| - name: Install Firefox | ||
| if: ${{ matrix.browser == 'firefox' }} | ||
| run: brew install --cask firefox | ||
|
|
||
| - name: Checkout Branch | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: "package.json" | ||
| cache: "npm" | ||
|
|
||
| - name: Install Node Packages | ||
| run: npm ci | ||
|
|
||
| - name: Download Models and Build Benchmarks | ||
| run: npm run build | ||
|
|
||
| - name: Run Unit Tests | ||
| run: | | ||
| echo "Running in $BROWSER" | ||
| npm run test:${{ matrix.browser }} | ||
| - name: Run end2end Tests | ||
| run: | | ||
| echo "Running in $BROWSER" | ||
| npm run test-e2e:${{ matrix.browser }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,10 +98,10 @@ async function testAll() { | |
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit (I unfortunately cannot add a comment to line 6, since it's too far away from the diff): Can you replace |
||
|
|
||
| async function testDeveloperMode() { | ||
| const params = ["developerMode", "iterationCount=1", "warmupBeforeSync=2", "waitBeforeSync=2", "shuffleSeed=123", "suites=Perf-Dashboard"]; | ||
| const params = ["developerMode", "iterationCount=1", "warmupBeforeSync=2", "waitBeforeSync=2", "shuffleSeed=123", "suites=Image-Classification-LiteRT.js-wasm"]; | ||
| const metrics = await testPage(`index.html?${params.join("&")}`); | ||
| suites.forEach((suite) => { | ||
| if (suite.name === "Perf-Dashboard") { | ||
| if (suite.name === "Image-Classification-LiteRT.js-wasm") { | ||
| const metric = metrics[suite.name]; | ||
| assert(metric.values.length === 1); | ||
| } else { | ||
|
|
@@ -112,7 +112,7 @@ async function testDeveloperMode() { | |
|
|
||
| async function test() { | ||
| try { | ||
| await driver.manage().setTimeouts({ script: 60000 }); | ||
| await driver.manage().setTimeouts({ script: 20 * 60000 }); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. very small nit: Could you make 60000 a Also, at a high-level: 20 minutes is a really long time out, do we have a lighter workload? |
||
| await testIterations(); | ||
| await testAll(); | ||
| await testDeveloperMode(); | ||
|
|
||
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.
side comment: I've seen that there are some resource limitations with macos so I've split the tasks in JetStream to be able to run on linux (though these are slightly slower machines).
https://github.com/WebKit/JetStream/blob/main/.github/workflows/test.yml