Skip to content

Commit 99fc2f6

Browse files
authored
feat: e2e combined improvements (#1998)
Contains several changes that all touch many snapshots. Combined to reduce snapshot churn. The primary goal was to address webkit kerning issues caused by: microsoft/playwright#20203 Recommend to review using `.` vscode mode and initially collapsing all snapshot folders. 1. Moves e2e test to execute inside docker container so enviroment is consitent between ci and local - changes e2e.yml to build a docker container, then uses that for each matrix test - dockerfile remove deja vu stuff, environment is now the same and grid.tsx - dockercompose adds service that runs the image from CI with matrix config via env variables - Fixes dockerfile and compose to *actually use the node version installed by nvm* (existing code didn't actually use the version installed by nvm, only the commands inside the -i interactive session would) - Get rid of interactive mode and make source work - Sym link nvm node binaries to clobber the version installed by playwright jammy container - Churns snapshots 2. Removes deprecated ButtonOld - removed button old component - changes to style guide to no longer display that component - removed usage in chart filter overlay - renames snapshots to by id instead of index for buttons - Churns snapshots 3. Disable kerning and smoothing in webkit playwright tests: - theory is webkit kerning may be non-deterministic, disabling entirely may avoid those diffs - adds Playwright.css dynamically imported based of a env VITE_PLAYWRIGHT variable to AppRoot - initially tried using built in https://playwright.dev/docs/test-snapshots#stylepath however, results were inconsistent as canvas grids may or may not re-render after playwright appended the styles - Updated playwright version to 1.44 - Churns snapshots 4. Optimize ThemeColors section in style guide - Makes styleguide section load faster - Remove all the ContrastColor() which have poor performance and were being done of every swatch. Instead text next to swatch - Move slow NormailzeColors() call in tooltip into props so it doesn't run unless tooltip is shown - Churns snapshots 5. Run golden-layout tests in parallel - I don't see a reason why these need to be serial, so might be slightly faster in parallel BREAKING CHANGE: Removed ButtonOld component, use Button instead.
1 parent 1100519 commit 99fc2f6

793 files changed

Lines changed: 238 additions & 271 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/e2e.yml

Lines changed: 30 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- 'release/**'
1515
- 'feature/**'
1616
env:
17-
DOCKER_TAG: edge
17+
DHC_VERSION: edge
1818

1919
jobs:
2020
build:
@@ -24,40 +24,19 @@ jobs:
2424
cancel-in-progress: true
2525

2626
steps:
27-
- name: Check installed fonts
28-
run: 'fc-list : family'
27+
- name: Checkout
28+
uses: actions/checkout@v4
2929

30-
- uses: actions/checkout@v4
31-
32-
- name: Use Node.js
33-
uses: actions/setup-node@v4
34-
with:
35-
node-version-file: '.nvmrc'
36-
cache: 'npm'
37-
38-
- name: Cache node modules
39-
id: cache-node-modules
40-
uses: actions/cache@v4
41-
with:
42-
path: |
43-
node_modules
44-
packages/*/node_modules
45-
key: e2e-node-modules-${{ hashFiles('package-lock.json')}}
46-
47-
- name: Install dependencies
48-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
49-
run: npm ci --no-audit
50-
51-
- name: Build
52-
run: npm run build
30+
- name: Build and Save docker image
31+
run: |
32+
docker build -t e2e-ci:test -f ./tests/docker-scripts/Dockerfile .
33+
docker save e2e-ci -o e2e-ci.tar.gz
5334
54-
- name: Upload build for test jobs
35+
- name: Store docker build for test matrix
5536
uses: actions/upload-artifact@v4
5637
with:
57-
name: web-build
58-
path: |
59-
*
60-
!node_modules
38+
name: image-cache
39+
path: e2e-ci.tar.gz
6140
retention-days: 1
6241

6342
e2e-tests:
@@ -73,65 +52,48 @@ jobs:
7352
config: [chromium-1-1, firefox-1-1, webkit-1-2, webkit-2-2]
7453

7554
steps:
76-
- name: Download build
77-
uses: actions/download-artifact@v4
78-
with:
79-
name: web-build
80-
81-
- name: Run core server:${{ env.DOCKER_TAG }}
82-
run: |
83-
docker pull --quiet ghcr.io/deephaven/server:${{ env.DOCKER_TAG }}
84-
docker run --detach --publish 10000:10000 --name dh-core-server -v ./tests/docker-scripts/data:/data --env "START_OPTS=-Xmx4g -DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler -Ddeephaven.application.dir=./data/app.d" ghcr.io/deephaven/server:${{ env.DOCKER_TAG }}
55+
- name: Checkout
56+
uses: actions/checkout@v4
8557

86-
- name: Cache node modules
87-
id: cache-node-modules
88-
uses: actions/cache@v4
58+
- name: Download docker image for test matrix
59+
uses: actions/download-artifact@v4
8960
with:
90-
path: |
91-
node_modules
92-
packages/*/node_modules
93-
key: e2e-node-modules-${{ hashFiles('package-lock.json')}}
94-
95-
- name: Install Playwright dependencies
96-
run: PLAYWRIGHT_BROWSERS_PATH=0 npx playwright install --with-deps
97-
98-
- name: Playwright version
99-
run: npx playwright --version
61+
name: image-cache
10062

101-
- name: Install dependencies
102-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
103-
run: npm ci --no-audit
63+
- name: Load docker image
64+
run: docker load -i e2e-ci.tar.gz
10465

10566
- name: Extract browser config
10667
id: config
10768
env:
10869
MATRIX_CONFIG: ${{ matrix.config }}
10970
run: |
110-
echo "browser=${MATRIX_CONFIG:0:-4}" >> $GITHUB_OUTPUT
111-
echo "shard=${MATRIX_CONFIG: -3:1}" >> $GITHUB_OUTPUT
112-
echo "shardTotal=${MATRIX_CONFIG: -1:1}" >> $GITHUB_OUTPUT
71+
echo "BROWSER=${MATRIX_CONFIG:0:-4}" >> $GITHUB_ENV
72+
echo "SHARD=${MATRIX_CONFIG: -3:1}" >> $GITHUB_ENV
73+
echo "SHARD_TOTAL=${MATRIX_CONFIG: -1:1}" >> $GITHUB_ENV
11374
114-
- name: Run Playwright tests
115-
run: PLAYWRIGHT_BROWSERS_PATH=0 npx playwright test --config=playwright-ci.config.ts --reporter=blob --project=${{ steps.config.outputs.browser }} --shard=${{ steps.config.outputs.shard }}/${{ steps.config.outputs.shardTotal }}
75+
- name: Run tests
76+
run: './tests/docker-scripts/run.sh e2e-ci-matrix'
11677

11778
- name: Upload Playwright report
11879
uses: actions/upload-artifact@v4
119-
if: always()
80+
if: ${{ !cancelled() }}
12081
with:
12182
name: playwright-report-blob-${{ matrix.config }}
12283
path: blob-report/
12384
retention-days: 1
12485

12586
- name: Dump server logs
12687
if: failure()
127-
run: docker logs dh-core-server > /tmp/server-log.txt
88+
run: docker logs dhc-server > /tmp/server-log.txt
12889

12990
- name: Upload server logs
13091
if: failure()
13192
uses: actions/upload-artifact@v4
13293
with:
13394
name: server-logs-${{ matrix.config }}
13495
path: /tmp/server-log.txt
96+
retention-days: 14
13597

13698
merge-reports:
13799
if: ${{ !cancelled() }}
@@ -147,15 +109,15 @@ jobs:
147109
- name: Merge into HTML Report
148110
run: |
149111
mkdir -p all-blob-reports
150-
mv playwright-report-blob-chromium-1-1/report-1.zip all-blob-reports/chromium-1-1.zip
151-
mv playwright-report-blob-firefox-1-1/report-1.zip all-blob-reports/firefox-1-1.zip
152-
mv playwright-report-blob-webkit-1-2/report-1.zip all-blob-reports/webkit-1-2.zip
153-
mv playwright-report-blob-webkit-2-2/report-2.zip all-blob-reports/webkit-2-2.zip
112+
mv playwright-report-blob-chromium-1-1/report-chromium-1.zip all-blob-reports/chromium-1-1.zip
113+
mv playwright-report-blob-firefox-1-1/report-firefox-1.zip all-blob-reports/firefox-1-1.zip
114+
mv playwright-report-blob-webkit-1-2/report-webkit-1.zip all-blob-reports/webkit-1-2.zip
115+
mv playwright-report-blob-webkit-2-2/report-webkit-2.zip all-blob-reports/webkit-2-2.zip
154116
npx playwright merge-reports --reporter html,github ./all-blob-reports
155117
156118
- name: Upload HTML report
157119
uses: actions/upload-artifact@v4
158120
with:
159121
name: playwright-report
160122
path: playwright-report
161-
retention-days: 90
123+
retention-days: 30

package-lock.json

Lines changed: 55 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"@deephaven/tsconfig": "file:../tsconfig",
7070
"@deephaven/utils": "file:../utils",
7171
"@fortawesome/fontawesome-common-types": "^6.1.1",
72-
"@playwright/test": "1.37.1",
72+
"@playwright/test": "1.44.0",
7373
"@testing-library/jest-dom": "^5.16.4",
7474
"@testing-library/react": "^12.1.3",
7575
"@testing-library/react-hooks": "^8.0.1",

packages/code-studio/src/AppRoot.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import { DownloadServiceWorkerUtils } from '@deephaven/iris-grid';
66
import MonacoWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
77
import AppRouter from './main/AppRouter';
88

9+
// load addional css for playwright docker tests
10+
if (import.meta.env.VITE_PLAYWRIGHT_CSS === '1') {
11+
await import('./Playwright.css');
12+
}
13+
914
export function AppRoot(): JSX.Element {
1015
DownloadServiceWorkerUtils.register(
1116
new URL(
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* This stylesheet is only applied during playwright tests.
3+
4+
* Attempting to fix kerning issues with webkit
5+
* by disabling ligatures, kerning and smoothing for all tests
6+
* https://github.com/microsoft/playwright/issues/20203
7+
*
8+
* In theory this makes it more deterministic and consistent.
9+
*
10+
*/
11+
12+
* {
13+
-webkit-font-smoothing: none !important;
14+
font-variant-ligatures: none !important;
15+
font-feature-settings: 'liga' 0 !important;
16+
font-kerning: none !important;
17+
text-rendering: optimizespeed !important;
18+
}

0 commit comments

Comments
 (0)