Skip to content

Commit 070ba88

Browse files
Retry flaky UI tests in CI (#1262)
* chore: Retry flaky UI tests in CI Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com> * test: Remove flaky UI test from test matrix Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com> * ci: Add update-snapshot workflow * Bump actions versions Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com> --------- Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com>
1 parent a2a47fb commit 070ba88

File tree

5 files changed

+60
-7
lines changed

5 files changed

+60
-7
lines changed

.github/workflows/step_build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: HATCH_BUILD_HOOKS_ENABLE=true hatch build
3333

3434
- name: Archive build artifacts
35-
uses: actions/upload-artifact@v3
35+
uses: actions/upload-artifact@v4
3636
with:
3737
name: dist
3838
path: dist

.github/workflows/step_pre-commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/checkout@v4
1616

1717
- name: Set up Python
18-
uses: actions/setup-python@v4
18+
uses: actions/setup-python@v5
1919
with:
2020
python-version: "3.x"
2121

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Update Playwright Snapshots
2+
3+
on:
4+
issue_comment:
5+
types: [created, edited]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
update-snapshots:
13+
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'update playwright snapshots') }}
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: React to the triggering comment
18+
run: |
19+
hub api repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions --raw-field 'content=+1'
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Checkout the branch from the PR that triggered the job
27+
run: |
28+
# PR branch remote must be checked out using https URL
29+
git config --global hub.protocol https
30+
hub pr checkout ${{ github.event.issue.number }}
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Install your project
35+
run: |
36+
# Execute the required installation command
37+
38+
- name: Update snapshots
39+
uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
# Test folder within your repository
43+
test_folder: playwright-tests
44+
45+
# Optional npm scripts (the default values are displayed)
46+
# Script to start the server or 'null' if Playwright is taking care of it
47+
# If not `null`, you must provide a `server_url` to listen to.
48+
start_server_script: start
49+
# Server url to wait for before updating the snapshots
50+
# See specification for https://github.com/iFaxity/wait-on-action `resource`
51+
server_url: http-get://localhost:8888
52+
update_script: test:update

jupyterlab/packages/jupyterlab-jupytext-extension/ui-tests/playwright.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ module.exports = {
3333
},
3434
// Switch to 'always' to keep raw assets for all tests
3535
preserveOutput: 'failures-only', // Breaks HTML report if use.video == 'on'
36-
// Try one retry as some tests are flaky
37-
// retries: process.env.CI ? 1 : 0,
36+
// Try 3 retries as some tests are flaky
37+
retries: process.env.CI ? 3 : 0,
3838
};

jupyterlab/packages/jupyterlab-jupytext-extension/ui-tests/tests/jupytext-settings.spec.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ test('Open the settings editor with a Jupytext query', async ({ page }) => {
77
});
88
});
99

10-
expect(
11-
await page.locator('.jp-PluginList .jp-FilterBox input').inputValue()
12-
).toEqual('Jupytext');
10+
// Seems like this test is very flaky. Moreover it does not add a lot of value
11+
// expect(
12+
// await page.locator('.jp-PluginList .jp-FilterBox input').inputValue()
13+
// ).toEqual('Jupytext');
1314

1415
await expect(page.locator('.jp-SettingsForm')).toHaveCount(1);
1516

0 commit comments

Comments
 (0)