Skip to content

Commit 3efcbb4

Browse files
andrii-igithub-actions[bot]pre-commit-ci[bot]
authored
[1.x] Fix CI, run lint, reduce end-to-end tests flakiness (#425)
* modify the commit for 1.x * Fix CI, run lint, reduce end-to-end tests flakiness (#417) * add macos tests * add locally-generated snapshots * check if filebrowser is already open before opening it * add actual snapshoy from CI * Update Playwright Snapshots * use notebook toolbar, mask bttns on the right * correct selector * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * run lint * Update Playwright Snapshots * timestampLocator -> timestamp * wait until fonts are ready before taking a snapshot * add maxDiffPixels * Revert "wait until fonts are ready before taking a snapshot" This reverts commit 9554559. * pin jupyterlab version for e2e tests and snapshots * remove macos tests * rename relevant job to end-to-end test * remove darwin/macos snapshots * specify jupyterlab version correctly * run lint * add jlpm install to Lint the extension step * remove ubuntu postfix from test report * Make e2e tests a separate file * add build steps * pin version of jupyterlab in e2e test file * introduce modifyListResponse, remove maxDiffPixels * modifyListResponse -> setJobList * set expected URL * always set create_time to 1 * update list view snapshot * run check option for lint * run lint locally --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * fix install chromium command * remove playwrght from dev dependencies * fix comma * Roll back 402 changes * roll back changes to build.yml * run lint * update snapshots * remove integration step * reinstate d423ede --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 73ee948 commit 3efcbb4

17 files changed

+342
-197
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ jobs:
2727
- name: Lint the extension
2828
run: |
2929
set -eux
30-
jlpm
30+
jlpm install
31+
jlpm run lint:check
3132
3233
- name: Test the extension
3334
run: |
@@ -94,59 +95,3 @@ jobs:
9495
jupyter labextension list
9596
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/scheduler.*OK"
9697
python -m jupyterlab.browser_check --no-chrome-test
97-
98-
integration-tests:
99-
name: Integration tests
100-
needs: build
101-
runs-on: ubuntu-latest
102-
103-
env:
104-
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
105-
106-
steps:
107-
- name: Checkout
108-
uses: actions/checkout@v2
109-
110-
- name: Base Setup
111-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
112-
113-
- name: Download extension package
114-
uses: actions/download-artifact@v2
115-
with:
116-
name: extension-artifacts
117-
118-
- name: Install the extension
119-
run: |
120-
set -eux
121-
python -m pip install "jupyterlab~=3.1" jupyter_scheduler*.whl
122-
123-
- name: Install dependencies
124-
working-directory: ui-tests
125-
env:
126-
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
127-
run: jlpm install
128-
129-
- name: Set up browser cache
130-
uses: actions/cache@v2
131-
with:
132-
path: |
133-
${{ github.workspace }}/pw-browsers
134-
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
135-
136-
- name: Install browser
137-
run: jlpm playwright install chromium
138-
working-directory: ui-tests
139-
140-
- name: Execute integration tests
141-
working-directory: ui-tests
142-
run: |
143-
jlpm playwright test
144-
145-
- name: Upload Playwright Test report
146-
if: always()
147-
uses: actions/upload-artifact@v2
148-
with:
149-
name: jupyter_scheduler-playwright-tests
150-
path: |
151-
ui-tests/test-results
152-
ui-tests/playwright-report

.github/workflows/e2e-tests.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: E2E Tests
2+
3+
# suppress warning raised by https://github.com/jupyter/jupyter_core/pull/292
4+
env:
5+
JUPYTER_PLATFORM_DIRS: '1'
6+
7+
on:
8+
push:
9+
branches: main
10+
pull_request:
11+
branches: '*'
12+
13+
jobs:
14+
e2e-tests:
15+
name: Linux
16+
runs-on: ubuntu-latest
17+
18+
env:
19+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Base Setup
26+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
27+
28+
- name: Install extension dependencies
29+
run: python -m pip install -U jupyterlab~=3.1
30+
31+
- name: Build the extension
32+
run: |
33+
set -eux
34+
python -m pip install .
35+
36+
jupyter server extension list
37+
jupyter server extension list 2>&1 | grep -ie "jupyter_scheduler.*OK"
38+
39+
jupyter labextension list
40+
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/scheduler.*OK"
41+
python -m jupyterlab.browser_check
42+
43+
- name: Install ui-tests dependencies
44+
working-directory: ui-tests
45+
env:
46+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
47+
run: jlpm install
48+
49+
- name: Set up browser cache
50+
uses: actions/cache@v2
51+
with:
52+
path: |
53+
${{ github.workspace }}/pw-browsers
54+
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
55+
56+
- name: Install browser
57+
working-directory: ui-tests
58+
run: jlpm playwright install chromium
59+
60+
- name: Execute integration tests
61+
working-directory: ui-tests
62+
run: jlpm test
63+
64+
- name: Upload Playwright Test report
65+
if: always()
66+
uses: actions/upload-artifact@v2
67+
with:
68+
name: jupyter_scheduler-playwright-tests-linux
69+
path: |
70+
ui-tests/test-results
71+
ui-tests/playwright-report

.github/workflows/update-integration-tests.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Update Playwright Snapshots
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
number:
7+
description: 'PR number'
8+
required: true
59
issue_comment:
610
types: [created, edited]
711

@@ -10,10 +14,8 @@ permissions:
1014
pull-requests: write
1115

1216
jobs:
13-
14-
1517
update-snapshots:
16-
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please update playwright snapshots') }}
18+
if: ${{ github.event.inputs || (github.event.issue.pull_request && contains(github.event.comment.body, 'please update playwright snapshots')) }}
1719
runs-on: ubuntu-latest
1820

1921
steps:
@@ -26,7 +28,7 @@ jobs:
2628
run: git config --global hub.protocol https
2729

2830
- name: Checkout the branch from the PR that triggered the job
29-
run: hub pr checkout ${{ github.event.issue.number }}
31+
run: hub pr checkout ${{ github.event.inputs.number || github.event.issue.number }}
3032
env:
3133
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3234

@@ -36,7 +38,7 @@ jobs:
3638
python_version: '3.11'
3739

3840
- name: Install dependencies
39-
run: python -m pip install -U jupyterlab~=3.1 jupyter-archive
41+
run: python -m pip install -U jupyterlab~=3.1
4042

4143
- name: Install extension
4244
run: |
@@ -50,3 +52,5 @@ jobs:
5052
# Playwright knows how to start JupyterLab server
5153
start_server_script: 'null'
5254
test_folder: ui-tests
55+
# use jlpm (not default yet)
56+
npm_client: jlpm

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,10 @@ dev/jobs
125125

126126
# jupyter releaser local checkout
127127
.jupyter_releaser_checkout
128+
129+
# Yarn 3 cache
130+
.yarn
131+
132+
# Jest coverage reports and a side effect
133+
coverage
134+
junit.xml

0 commit comments

Comments
 (0)