Skip to content

Commit 0420ad2

Browse files
committed
Backport PR jupyterlab#10796: Add Galata in JupyterLab
1 parent a441a37 commit 0420ad2

File tree

258 files changed

+10289
-6078
lines changed

Some content is hidden

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

258 files changed

+10289
-6078
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ examples/
2121

2222
junit.xml
2323

24+
galata
2425
jupyterlab/geckodriver
2526
jupyterlab/static
2627
jupyterlab/schemas
@@ -41,4 +42,3 @@ tests/**/coverage
4142
tests/**/.cache-loader
4243

4344
**/node_modules
44-
ui-tests/

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ packages/ui-components/storybook-static
2828
jupyterlab/staging/yarn.js
2929
jupyterlab/staging/index.js
3030
tsconfigdoc.json
31+
galata/playwright-report
3132
examples/federated/core_package/index.js
3233
examples/federated/labextensions
33-
ui-tests/test-output
3434

3535
# jetbrains IDE stuff
3636
.idea/

.github/labeler.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Design System CSS:
22
- '**/*.css'
33
- '*.css'
4-
4+
55
documentation:
66
- docs/**/*
77
- docs/*
@@ -21,8 +21,8 @@ tag:Examples:
2121
tag:Testing:
2222
- tests/**/*
2323
- tests/*
24-
- ui-tests/**/*
25-
- ui-tests/*
24+
- galata/**/*
25+
- galata/*
2626

2727
######################
2828
# Package Labels #
@@ -103,7 +103,7 @@ pkg:docprovider:
103103
- packages/docprovider/*
104104
- packages/docprovider-extension/**/*
105105
- packages/docprovider-extension/*
106-
106+
107107
pkg:docregistry:
108108
- packages/docregistry/**/*
109109
- packages/docregistry/*
@@ -281,7 +281,7 @@ pkg:toc:
281281
- packages/toc/*
282282
- packages/toc-extension/**/*
283283
- packages/toc-extension/*
284-
284+
285285
pkg:tooltip:
286286
- packages/tooltip/**/*
287287
- packages/tooltip/*

.github/workflows/galata.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: UI Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
name: Visual Regression Tests
14+
timeout-minutes: 40
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Install node
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: '14.x'
23+
- name: Install Python
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: 3.8
27+
28+
- name: Cache pip on Linux
29+
uses: actions/cache@v1
30+
with:
31+
path: ~/.cache/pip
32+
key: ${{ runner.os }}-pip-3.8-${{ hashFiles('**/requirements.txt', 'setup.cfg') }}
33+
restore-keys: |
34+
${{ runner.os }}-pip-3.8
35+
36+
- name: Get yarn cache directory path
37+
id: yarn-cache-dir-path
38+
run: echo "::set-output name=dir::$(yarn cache dir)"
39+
- name: Cache yarn
40+
uses: actions/cache@v1
41+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
42+
with:
43+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
44+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
45+
restore-keys: |
46+
${{ runner.os }}-yarn-
47+
48+
- name: Install dependencies
49+
run: |
50+
bash ./scripts/ci_install.sh
51+
52+
- name: Launch JupyterLab
53+
run: |
54+
cd galata
55+
# Mount a volume to overwrite the server configuration
56+
jlpm start 2>&1 > /tmp/jupyterlab_server.log &
57+
58+
- name: Install browser
59+
run: |
60+
cd galata
61+
# Install only Chromium browser
62+
jlpm playwright install chromium
63+
jlpm run build
64+
65+
- name: Wait for JupyterLab
66+
uses: ifaxity/wait-on-action@v1
67+
with:
68+
resource: http-get://localhost:8888/lab
69+
timeout: 360000
70+
71+
- name: Test
72+
run: |
73+
cd galata
74+
jlpm run test
75+
76+
- name: Upload Galata Test assets
77+
if: always()
78+
uses: actions/upload-artifact@v2
79+
with:
80+
name: galata-test-assets
81+
path: |
82+
galata/test-results
83+
84+
- name: Upload Galata Test report
85+
if: always()
86+
uses: actions/upload-artifact@v2
87+
with:
88+
name: galata-report
89+
path: |
90+
galata/playwright-report
91+
92+
- name: Print JupyterLab logs
93+
if: always()
94+
run: |
95+
cat /tmp/jupyterlab_server.log

.github/workflows/ui-tests.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.gitignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ packages/theme-*/static
3939
tests/**/coverage
4040
tests/**/.cache-loader
4141

42+
# galata
43+
galata/benchmark-results
44+
galata/playwright-report
45+
galata/test-results
46+
47+
package_json.tar.gz
48+
4249
# javascript/typescript
4350
lib
4451
node_modules
@@ -113,8 +120,4 @@ junit.xml
113120
.vscode
114121
.vs
115122

116-
ui-tests/test-output
117-
ui-tests/jlab_root
118-
119-
package_json.tar.gz
120123
.jupyter_releaser_checkout

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jupyterlab/staging/index.js
2626
packages/ui-components/src/icon/iconimports.ts
2727
packages/extensionmanager/examples/listings
2828
tsconfigdoc.json
29+
galata/playwright-report
2930
examples/federated/core_package/index.js
3031
examples/federated/labextensions
31-
ui-tests/test-output
3232

3333
# jetbrains IDE stuff
3434
.idea/

Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@ RUN list_package=$(python -c "from configparser import ConfigParser; c = ConfigP
2323
&& rm /tmp/setup.cfg
2424

2525
# Install JupyterLab
26-
COPY ./builder/ /tmp/jupyterlab-dev/builder/
27-
COPY ./buildutils/ /tmp/jupyterlab-dev/buildutils/
28-
COPY ./dev_mode/ /tmp/jupyterlab-dev/dev_mode/
29-
COPY ./jupyterlab/ /tmp/jupyterlab-dev/jupyterlab/
30-
COPY ./packages/ /tmp/jupyterlab-dev/packages/
31-
COPY ./scripts/ /tmp/jupyterlab-dev/scripts/
32-
COPY ./*.* ./LICENSE /tmp/jupyterlab-dev/
26+
COPY --chown=jovyan ./builder/ /tmp/jupyterlab-dev/builder/
27+
COPY --chown=jovyan ./buildutils/ /tmp/jupyterlab-dev/buildutils/
28+
COPY --chown=jovyan ./dev_mode/ /tmp/jupyterlab-dev/dev_mode/
29+
COPY --chown=jovyan ./jupyterlab/ /tmp/jupyterlab-dev/jupyterlab/
30+
COPY --chown=jovyan ./packages/ /tmp/jupyterlab-dev/packages/
31+
COPY --chown=jovyan ./scripts/ /tmp/jupyterlab-dev/scripts/
32+
COPY --chown=jovyan ./*.* ./LICENSE /tmp/jupyterlab-dev/
3333

3434
RUN pushd /tmp/jupyterlab-dev \
35-
&& pip install -e .[ui-tests] \
36-
&& chown -R jovyan /tmp/jupyterlab-dev
35+
&& pip install -e .[ui-tests]
3736

3837
USER jovyan
3938
WORKDIR ${HOME}

MANIFEST.in

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,16 @@ prune jupyterlab/staging/build
3232
recursive-exclude jupyterlab *.pyc
3333
recursive-exclude jupyterlab *.js.map
3434

35+
# Galata
36+
include galata/README.md
37+
include galata/jupyter_server_config.py
38+
include galata/*.js
39+
recursive-include galata/media *.*
40+
graft galata/src
41+
graft galata/style
42+
graft galata/test
43+
3544
# Docker
3645
include Dockerfile
3746
include .dockerignore
3847
recursive-include docker *.json
39-
40-
prune ui-tests

buildutils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"dependency-graph": "^0.9.0",
4949
"fs-extra": "^9.0.1",
5050
"glob": "~7.1.6",
51-
"inquirer": "^7.0.0",
51+
"inquirer": "^7.1.0",
5252
"minimatch": "~3.0.4",
5353
"os": "~0.1.1",
5454
"package-json": "^6.5.0",

buildutils/src/ensure-repo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const MISSING: Dict<string[]> = {
4343
'@jupyterlab/coreutils': ['path'],
4444
'@jupyterlab/buildutils': ['path', 'webpack'],
4545
'@jupyterlab/builder': ['path'],
46+
'@jupyterlab/galata': ['fs', 'path'],
4647
'@jupyterlab/testutils': ['fs', 'path'],
4748
'@jupyterlab/vega5-extension': ['vega-embed']
4849
};
@@ -85,6 +86,7 @@ const UNUSED: Dict<string[]> = {
8586
],
8687
'@jupyterlab/buildutils': ['verdaccio'],
8788
'@jupyterlab/coreutils': ['path-browserify'],
89+
'@jupyterlab/galata': ['node-fetch', 'http-server'],
8890
'@jupyterlab/services': ['node-fetch', 'ws'],
8991
'@jupyterlab/rendermime': ['@jupyterlab/mathjax2'],
9092
'@jupyterlab/testutils': [

dev_mode/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@
400400
"@jupyterlab/builder": "../builder",
401401
"@jupyterlab/buildutils": "../buildutils",
402402
"@jupyterlab/template": "../buildutils/template",
403+
"@jupyterlab/galata": "../galata",
403404
"@jupyterlab/testutils": "../testutils"
404405
}
405406
}

docker/jupyter_server_config.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@
88
},
99
"LabApp": {
1010
"dev_mode": true
11-
},
12-
"Application": {
13-
"log_level": "DEBUG"
1411
}
1512
}

examples/notebooks/OutputExamples.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@
782782
],
783783
"metadata": {
784784
"kernelspec": {
785-
"display_name": "Python 3",
785+
"display_name": "Python 3 (ipykernel)",
786786
"language": "python",
787787
"name": "python3"
788788
},
@@ -796,7 +796,7 @@
796796
"name": "python",
797797
"nbconvert_exporter": "python",
798798
"pygments_lexer": "ipython3",
799-
"version": "3.7.4"
799+
"version": "3.9.5"
800800
}
801801
},
802802
"nbformat": 4,

galata/.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
extends: ['../.eslintrc.js'],
3+
parserOptions: {
4+
project: 'tsconfig.eslint.json'
5+
},
6+
rules: {
7+
'jest/no-done-callback': 'off'
8+
}
9+
};

0 commit comments

Comments
 (0)