Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed Nov 5, 2024
1 parent 20a3735 commit 5880397
Show file tree
Hide file tree
Showing 8 changed files with 2,358 additions and 2,140 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ jobs:
- name: Install dependencies
run: |
pip install "jupyterlab>=4.0.0,<5"
pip install -e .
pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e projects/jupyter-server-ydoc
jlpm
jlpm install
- name: Run pre-commit
uses: pre-commit/[email protected]
Expand All @@ -55,6 +53,7 @@ jobs:
test-js:
name: Test JavaScript
runs-on: ubuntu-latest
needs: [pre-commit]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -84,13 +83,14 @@ jobs:
test-py:
name: Test Python
needs: [pre-commit]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
# PyPy is not supported because we use the file_id_manager. See:
# https://github.com/jupyter-server/jupyter_server_fileid/issues/44
#include:
Expand All @@ -108,7 +108,7 @@ jobs:
run: |
python -m pip install "jupyterlab>=4.0.0,<5"
python -m pip install -e ".[test]" codecov
python -m pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e projects/jupyter-server-ydoc
python -m pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e "projects/jupyter-server-ydoc[test]"
- name: List installed packages
run: |
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
test_minimum_versions:
name: Test Minimum Versions
needs: [pre-commit, test-js, test-py]
needs: [test-js, test-py]
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
Expand All @@ -157,21 +157,21 @@ jobs:
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
python_version: "3.8"
python_version: "3.9"
dependency_type: minimum

- name: Install the Python dependencies
run: |
pip install -e ".[test]"
pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e projects/jupyter-server-ydoc
pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e "projects/jupyter-server-ydoc[test]"
- name: Run the unit tests
run: |
pytest -vv -W default || pytest -vv -W default --lf
test_prereleases:
name: Test Prereleases
needs: [pre-commit, test-js, test-py]
needs: [test-js, test-py]
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand All @@ -184,7 +184,7 @@ jobs:
- name: Install the Python dependencies
run: |
pip install -e ".[test]"
pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e projects/jupyter-server-ydoc
pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e "projects/jupyter-server-ydoc[test]"
- name: List installed packages
run: |
Expand All @@ -197,7 +197,7 @@ jobs:
make_sdist:
name: Make SDist
needs: [pre-commit, test-js, test-py]
needs: [pre-commit]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand Down Expand Up @@ -269,16 +269,21 @@ jobs:

ui_tests:
runs-on: ubuntu-latest
needs: [pre-commit, test-js]
needs: [make_sdist]
timeout-minutes: 30
env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Download sdist
uses: actions/download-artifact@v4
with:
name: "sdist"
- name: Install dependencies
run: |
pip install jupyterlab .
pip install jupyterlab jupyter_collaboration_ui*.tar.gz jupyter_docprovider*.tar.gz jupyter_server_ydoc*.tar.gz
- name: Install playwright
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nodeLinker: node-modules
enableImmutableInstalls: false
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"strict": true,
"strictNullChecks": true,
"target": "es2018",
"types": []
"types": [],
"lib": ["DOM", "ES2018", "ES2020.Intl"]
}
}
2 changes: 1 addition & 1 deletion ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test:update": "npx playwright test --update-snapshots"
},
"devDependencies": {
"@jupyterlab/galata": "^5.1.5",
"@jupyterlab/galata": "^5.3.0",
"@jupyterlab/services": "^7.1.5",
"@playwright/test": "^1.35.0"
},
Expand Down
5 changes: 5 additions & 0 deletions ui-tests/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,10 @@ module.exports = {
url: 'http://localhost:8888/lab',
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI
},
expect: {
toMatchSnapshot: {
maxDiffPixelRatio: 0.01
}
}
};
10 changes: 5 additions & 5 deletions ui-tests/tests/notebook.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ test.describe('Initialization', () => {
await guestPage.filebrowser.refresh();
await guestPage.notebook.open(pathUntitled);

const nbPanel = await page.notebook.getNotebookInPanel();
const nbPanel = await page.notebook.getNotebookInPanelLocator();
expect.soft(await nbPanel?.screenshot()).toMatchSnapshot(
'initialization-create-notebook-host.png'
);

const nbPanelGuest = await guestPage.notebook.getNotebookInPanel();
const nbPanelGuest = await guestPage.notebook.getNotebookInPanelLocator();
expect(await nbPanelGuest?.screenshot()).toMatchSnapshot(
'initialization-create-notebook-guest.png'
);
Expand All @@ -133,12 +133,12 @@ test.describe('Initialization', () => {
await guestPage.notebook.open(exampleNotebook);
await guestPage.notebook.activate(exampleNotebook);

const nbPanel = await page.notebook.getNotebookInPanel();
const nbPanel = await page.notebook.getNotebookInPanelLocator();
expect.soft(await nbPanel?.screenshot()).toMatchSnapshot(

Check failure on line 137 in ui-tests/tests/notebook.spec.ts

View workflow job for this annotation

GitHub Actions / ui_tests

tests/notebook.spec.ts:127:7 › Initialization › Open a notebook

2) tests/notebook.spec.ts:127:7 › Initialization › Open a notebook ─────────────────────────────── Error: Screenshot comparison failed: 5742 pixels (ratio 0.02 of all image pixels) are different. Expected: /home/runner/work/jupyter-collaboration/jupyter-collaboration/ui-tests/test-results/tests-notebook-Initialization-Open-a-notebook/initialization-open-notebook-host-expected.png Received: /home/runner/work/jupyter-collaboration/jupyter-collaboration/ui-tests/test-results/tests-notebook-Initialization-Open-a-notebook/initialization-open-notebook-host-actual.png Diff: /home/runner/work/jupyter-collaboration/jupyter-collaboration/ui-tests/test-results/tests-notebook-Initialization-Open-a-notebook/initialization-open-notebook-host-diff.png 135 | 136 | const nbPanel = await page.notebook.getNotebookInPanelLocator(); > 137 | expect.soft(await nbPanel?.screenshot()).toMatchSnapshot( | ^ 138 | 'initialization-open-notebook-host.png' 139 | ); 140 | at /home/runner/work/jupyter-collaboration/jupyter-collaboration/ui-tests/tests/notebook.spec.ts:137:46
'initialization-open-notebook-host.png'
);

const nbPanelGuest = await guestPage.notebook.getNotebookInPanel();
const nbPanelGuest = await guestPage.notebook.getNotebookInPanelLocator();
expect(await nbPanelGuest?.screenshot()).toMatchSnapshot(

Check failure on line 142 in ui-tests/tests/notebook.spec.ts

View workflow job for this annotation

GitHub Actions / ui_tests

tests/notebook.spec.ts:127:7 › Initialization › Open a notebook

2) tests/notebook.spec.ts:127:7 › Initialization › Open a notebook ─────────────────────────────── Error: Screenshot comparison failed: 5742 pixels (ratio 0.02 of all image pixels) are different. Expected: /home/runner/work/jupyter-collaboration/jupyter-collaboration/ui-tests/test-results/tests-notebook-Initialization-Open-a-notebook/initialization-open-notebook-guest-expected.png Received: /home/runner/work/jupyter-collaboration/jupyter-collaboration/ui-tests/test-results/tests-notebook-Initialization-Open-a-notebook/initialization-open-notebook-guest-actual.png Diff: /home/runner/work/jupyter-collaboration/jupyter-collaboration/ui-tests/test-results/tests-notebook-Initialization-Open-a-notebook/initialization-open-notebook-guest-diff.png 140 | 141 | const nbPanelGuest = await guestPage.notebook.getNotebookInPanelLocator(); > 142 | expect(await nbPanelGuest?.screenshot()).toMatchSnapshot( | ^ 143 | 'initialization-open-notebook-guest.png' 144 | ); 145 | at /home/runner/work/jupyter-collaboration/jupyter-collaboration/ui-tests/tests/notebook.spec.ts:142:46
'initialization-open-notebook-guest.png'
);
Expand Down Expand Up @@ -245,7 +245,7 @@ test.describe('Ten clients', () => {
async () => (await page.notebook.getCellCount()) === numCells + numClients
);

const nbPanel = await page.notebook.getNotebookInPanel();
const nbPanel = await page.notebook.getNotebookInPanelLocator();
expect(await nbPanel?.screenshot()).toMatchSnapshot(
'ten-clients-add-a-new-cell.png'
);
Expand Down
Loading

0 comments on commit 5880397

Please sign in to comment.