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 715990b
Show file tree
Hide file tree
Showing 8 changed files with 2,357 additions and 2,144 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ jobs:
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- 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
- name: Run pre-commit
uses: pre-commit/[email protected]
with:
Expand All @@ -55,6 +48,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 +78,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 +103,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 +143,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 +152,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 +179,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 +192,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 +264,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(
'initialization-open-notebook-host.png'
);

const nbPanelGuest = await guestPage.notebook.getNotebookInPanel();
const nbPanelGuest = await guestPage.notebook.getNotebookInPanelLocator();
expect(await nbPanelGuest?.screenshot()).toMatchSnapshot(
'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 715990b

Please sign in to comment.