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

[WIP]: Configure UI tests for Lite Deployment #689

Draft
wants to merge 57 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
68b731c
Configure UI tests for Lite Deployment
arjxn-py Feb 13, 2025
2e29114
add script to start lite server
arjxn-py Feb 13, 2025
0be32d5
not needed
arjxn-py Feb 13, 2025
ea75249
Configure lite tests
arjxn-py Feb 13, 2025
baecae3
Change playwright report name
arjxn-py Feb 13, 2025
136778c
Fix test command
martinRenou Feb 13, 2025
ac6bfb8
Fix test cmd
martinRenou Feb 13, 2025
3858772
Do jlpm install
arjxn-py Feb 13, 2025
d665b65
try correct path
arjxn-py Feb 13, 2025
78cb6b7
Try another path
arjxn-py Feb 13, 2025
e58bfde
try without cd
arjxn-py Feb 13, 2025
22d9bbc
try corrected path
arjxn-py Feb 13, 2025
a258d6d
try ls
arjxn-py Feb 13, 2025
f58ac8f
try ls ..
arjxn-py Feb 13, 2025
cb8d4d1
Update .github/workflows/build.yml
arjxn-py Feb 13, 2025
a54c3cd
Add a step to upload lite-artifacts
arjxn-py Feb 13, 2025
8c10139
prevent name conflict
arjxn-py Feb 13, 2025
6f11614
try ./lite/dist again
arjxn-py Feb 13, 2025
0c4d85f
debug path
arjxn-py Feb 13, 2025
326c32a
run lite tests on 8888 only
arjxn-py Feb 13, 2025
bc61261
try again on 8866
arjxn-py Feb 13, 2025
d82716e
try defining only port
arjxn-py Feb 13, 2025
be3fb42
port 8888
arjxn-py Feb 13, 2025
fb68f00
could this be it?
arjxn-py Feb 13, 2025
aa75ad2
use some options same as jupyterlite
arjxn-py Feb 13, 2025
1586cdd
add option to Galata take control of the app object
arjxn-py Feb 13, 2025
49d5cb2
try this
arjxn-py Feb 13, 2025
294253a
update lock file
arjxn-py Feb 13, 2025
77e8452
reduce timeout, comment not needed part
arjxn-py Feb 13, 2025
4eea172
increase timeout a little
arjxn-py Feb 13, 2025
200ae43
maybe not
arjxn-py Feb 14, 2025
4ad5bdf
And maybe?
arjxn-py Feb 14, 2025
3a00af4
temporarily try opening just filename
arjxn-py Feb 14, 2025
4d21d98
Bump galata
arjxn-py Feb 14, 2025
8032e61
try a test from jupyterlite
arjxn-py Feb 14, 2025
01561db
just leave one test to run for now
arjxn-py Feb 14, 2025
80a9c79
just run extension activation test
arjxn-py Feb 14, 2025
0791c02
not required
arjxn-py Feb 14, 2025
485fddb
Merge branch 'main' into ui-test-lite
arjxn-py Feb 17, 2025
f25a15e
try another test
arjxn-py Feb 18, 2025
8e8c704
let's see
arjxn-py Feb 18, 2025
0bcc28e
seems to work
arjxn-py Feb 18, 2025
918d3e7
Separate file for lite tests?
arjxn-py Feb 18, 2025
ffb0cdb
nope
arjxn-py Feb 18, 2025
3ab44fc
Uncomment tests
arjxn-py Feb 18, 2025
5686670
test:lite
arjxn-py Feb 18, 2025
e5e25b5
ignore lite test for lab
arjxn-py Feb 18, 2025
68f86b8
install jcad metapackage in update snapshots
arjxn-py Feb 18, 2025
002d378
Merge branch 'main' into ui-test-lite
arjxn-py Feb 18, 2025
c29f2a4
add updatelite script
arjxn-py Feb 20, 2025
95beda1
Update Playwright Snapshots
github-actions[bot] Feb 20, 2025
0b5e7a9
add a test for notebook
arjxn-py Feb 21, 2025
f82b843
fix test
arjxn-py Feb 21, 2025
d09bcf3
try with existing file
arjxn-py Feb 21, 2025
3a33262
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 21, 2025
8f80fbe
skip
arjxn-py Feb 21, 2025
ebe6697
increase timeout
arjxn-py Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,17 @@ jobs:
id: upload-jupyterlite-artifact
uses: actions/upload-pages-artifact@v3
with:
name: lite-artifacts
path: ./lite/dist
retention-days: 30

- name: Upload lite artifact
id: upload-lite-artifact
uses: actions/upload-artifact@v4
with:
name: lite-artifacts
path: ./lite/dist

- name: Save artifact data
uses: trungleduc/appsharingspace-pr-comment/.github/actions/save-artifact-link@v2
with:
Expand All @@ -275,3 +283,78 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

integration-tests-lite:
name: Integration tests Lite
needs: build-lite
runs-on: ubuntu-latest

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.5-0'
environment-name: cad
create-args: >-
python=3.9
jupyterlab

- name: Download extension package
uses: actions/download-artifact@v4
with:
name: lite-artifacts
- name: debug
run: ls
# - name: Install the extension
# shell: bash -l {0}
# run: |
# set -eux
# cp ./jupytercad_core/dist/jupytercad*.whl ./jupytercad_lab/dist/jupytercad*.whl ./jupytercad_app/dist/jupytercad*.whl ./jupytercad/dist/jupytercad*.whl .
# python -m pip install jupytercad*.whl

- name: Install dependencies
shell: bash -l {0}
working-directory: ui-tests
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install

- name: Set up browser cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install browser
shell: bash -l {0}
run: npx playwright install chromium
working-directory: ui-tests

- name: Execute integration tests
shell: bash -l {0}
working-directory: ui-tests
run: jlpm run test:lite

- name: Upload Playwright Test report
id: upload-galata-artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: jupytercad-lite-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report

# - name: Save artifact data
# if: always()
# uses: trungleduc/appsharingspace-pr-comment/.github/actions/save-artifact-link@v2
# with:
# output_name: galata-apss
# artifact_link: 'https://github.com/${{ github.repository }}/actions/runs/${{github.run_id}}/artifacts/${{ steps.upload-galata-artifact.outputs.artifact-id }}'
2 changes: 2 additions & 0 deletions ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"private": true,
"scripts": {
"start": "jupyter lab --config jupyter_server_test_config.py",
"start:lite": "ls .. && cd ../lite/dist && python -m http.server 8866",
"test": "npx playwright test --workers 1",
"test:lite": "npx playwright test --workers 1 --config playwright-lite.config.js",
"test:update": "npx playwright test --update-snapshots",
"test:debug": "PWDEBUG=1 npx playwright test --workers 1"
},
Expand Down
25 changes: 25 additions & 0 deletions ui-tests/playwright-lite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Configuration for Playwright using default from @jupyterlab/galata
*/
const baseConfig = require('@jupyterlab/galata/lib/playwright-config');

module.exports = {
...baseConfig,
webServer: {
command: 'jlpm start:lite',
url: 'http://localhost:8866/lab',
timeout: 120 * 1000,
reuseExistingServer: false
},
retries: 1,
use: {
...baseConfig.use,
trace: 'off',

},
expect: {
toMatchSnapshot: {
maxDiffPixelRatio: 0.002,
},
},
};
Loading