Skip to content

Commit

Permalink
Backport PR #10796 to 3.2.x: Add Galata in JupyterLab (#11179)
Browse files Browse the repository at this point in the history
* Backport PR #10796: Add Galata in JupyterLab

* Update @jupyterlab/galata version

* Correct galata repository urls

* Undo changes to notebook example

* Address CI errors

* Fix `vega-lite` error

* Upgrade vega-lite to v5

* Upgrade screenshots

* Fix check release
  • Loading branch information
fcollonval committed Sep 30, 2021
1 parent 81b1a31 commit 18f953f
Show file tree
Hide file tree
Showing 258 changed files with 10,251 additions and 6,155 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ examples/

junit.xml

galata
jupyterlab/geckodriver
jupyterlab/static
jupyterlab/schemas
Expand All @@ -41,4 +42,3 @@ tests/**/coverage
tests/**/.cache-loader

**/node_modules
ui-tests/
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ packages/ui-components/storybook-static
jupyterlab/staging/yarn.js
jupyterlab/staging/index.js
tsconfigdoc.json
galata/playwright-report
examples/federated/core_package/index.js
examples/federated/labextensions
ui-tests/test-output

# jetbrains IDE stuff
.idea/
Expand Down
10 changes: 5 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Design System CSS:
- '**/*.css'
- '*.css'

documentation:
- docs/**/*
- docs/*
Expand All @@ -21,8 +21,8 @@ tag:Examples:
tag:Testing:
- tests/**/*
- tests/*
- ui-tests/**/*
- ui-tests/*
- galata/**/*
- galata/*

######################
# Package Labels #
Expand Down Expand Up @@ -103,7 +103,7 @@ pkg:docprovider:
- packages/docprovider/*
- packages/docprovider-extension/**/*
- packages/docprovider-extension/*

pkg:docregistry:
- packages/docregistry/**/*
- packages/docregistry/*
Expand Down Expand Up @@ -281,7 +281,7 @@ pkg:toc:
- packages/toc/*
- packages/toc-extension/**/*
- packages/toc-extension/*

pkg:tooltip:
- packages/tooltip/**/*
- packages/tooltip/*
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/galata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: UI Tests

on:
push:
branches:
- master
pull_request:
branches:
- '*'

jobs:
build:
name: Visual Regression Tests
timeout-minutes: 40
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Cache pip on Linux
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-3.8-${{ hashFiles('**/requirements.txt', 'setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-3.8
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn
uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: |
bash ./scripts/ci_install.sh
- name: Launch JupyterLab
run: |
cd galata
# Mount a volume to overwrite the server configuration
jlpm start 2>&1 > /tmp/jupyterlab_server.log &
- name: Install browser
run: |
cd galata
# Install only Chromium browser
jlpm playwright install chromium
jlpm run build
- name: Wait for JupyterLab
uses: ifaxity/wait-on-action@v1
with:
resource: http-get://localhost:8888/lab
timeout: 360000

- name: Test
run: |
cd galata
jlpm run test
- name: Upload Galata Test assets
if: always()
uses: actions/upload-artifact@v2
with:
name: galata-test-assets
path: |
galata/test-results
- name: Upload Galata Test report
if: always()
uses: actions/upload-artifact@v2
with:
name: galata-report
path: |
galata/playwright-report
- name: Print JupyterLab logs
if: always()
run: |
cat /tmp/jupyterlab_server.log
54 changes: 0 additions & 54 deletions .github/workflows/ui-tests.yml

This file was deleted.

11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ packages/theme-*/static
tests/**/coverage
tests/**/.cache-loader

# galata
galata/benchmark-results
galata/playwright-report
galata/test-results

package_json.tar.gz

# javascript/typescript
lib
node_modules
Expand Down Expand Up @@ -113,8 +120,4 @@ junit.xml
.vscode
.vs

ui-tests/test-output
ui-tests/jlab_root

package_json.tar.gz
.jupyter_releaser_checkout
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jupyterlab/staging/index.js
packages/ui-components/src/icon/iconimports.ts
packages/extensionmanager/examples/listings
tsconfigdoc.json
galata/playwright-report
examples/federated/core_package/index.js
examples/federated/labextensions
ui-tests/test-output

# jetbrains IDE stuff
.idea/
Expand Down
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@ RUN list_package=$(python -c "from configparser import ConfigParser; c = ConfigP
&& rm /tmp/setup.cfg

# Install JupyterLab
COPY ./builder/ /tmp/jupyterlab-dev/builder/
COPY ./buildutils/ /tmp/jupyterlab-dev/buildutils/
COPY ./dev_mode/ /tmp/jupyterlab-dev/dev_mode/
COPY ./jupyterlab/ /tmp/jupyterlab-dev/jupyterlab/
COPY ./packages/ /tmp/jupyterlab-dev/packages/
COPY ./scripts/ /tmp/jupyterlab-dev/scripts/
COPY ./*.* ./LICENSE /tmp/jupyterlab-dev/
COPY --chown=jovyan ./builder/ /tmp/jupyterlab-dev/builder/
COPY --chown=jovyan ./buildutils/ /tmp/jupyterlab-dev/buildutils/
COPY --chown=jovyan ./dev_mode/ /tmp/jupyterlab-dev/dev_mode/
COPY --chown=jovyan ./jupyterlab/ /tmp/jupyterlab-dev/jupyterlab/
COPY --chown=jovyan ./packages/ /tmp/jupyterlab-dev/packages/
COPY --chown=jovyan ./scripts/ /tmp/jupyterlab-dev/scripts/
COPY --chown=jovyan ./*.* ./LICENSE /tmp/jupyterlab-dev/

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

USER jovyan
WORKDIR ${HOME}
Expand Down
11 changes: 9 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,16 @@ prune jupyterlab/staging/build
recursive-exclude jupyterlab *.pyc
recursive-exclude jupyterlab *.js.map

# Galata
include galata/README.md
include galata/jupyter_server_config.py
include galata/*.js
recursive-include galata/media *.*
graft galata/src
graft galata/style
graft galata/test

# Docker
include Dockerfile
include .dockerignore
recursive-include docker *.json

prune ui-tests
2 changes: 1 addition & 1 deletion buildutils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"dependency-graph": "^0.9.0",
"fs-extra": "^9.0.1",
"glob": "~7.1.6",
"inquirer": "^7.0.0",
"inquirer": "^7.1.0",
"minimatch": "~3.0.4",
"os": "~0.1.1",
"package-json": "^6.5.0",
Expand Down
2 changes: 2 additions & 0 deletions buildutils/src/ensure-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const MISSING: Dict<string[]> = {
'@jupyterlab/coreutils': ['path'],
'@jupyterlab/buildutils': ['path', 'webpack'],
'@jupyterlab/builder': ['path'],
'@jupyterlab/galata': ['fs', 'path'],
'@jupyterlab/testutils': ['fs', 'path'],
'@jupyterlab/vega5-extension': ['vega-embed']
};
Expand Down Expand Up @@ -85,6 +86,7 @@ const UNUSED: Dict<string[]> = {
],
'@jupyterlab/buildutils': ['verdaccio'],
'@jupyterlab/coreutils': ['path-browserify'],
'@jupyterlab/galata': ['node-fetch', 'http-server'],
'@jupyterlab/services': ['node-fetch', 'ws'],
'@jupyterlab/rendermime': ['@jupyterlab/mathjax2'],
'@jupyterlab/testutils': [
Expand Down
1 change: 1 addition & 0 deletions dev_mode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@
"@jupyterlab/builder": "../builder",
"@jupyterlab/buildutils": "../buildutils",
"@jupyterlab/template": "../buildutils/template",
"@jupyterlab/galata": "../galata",
"@jupyterlab/testutils": "../testutils"
}
}
Expand Down
3 changes: 0 additions & 3 deletions docker/jupyter_server_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@
},
"LabApp": {
"dev_mode": true
},
"Application": {
"log_level": "DEBUG"
}
}
9 changes: 9 additions & 0 deletions galata/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
extends: ['../.eslintrc.js'],
parserOptions: {
project: 'tsconfig.eslint.json'
},
rules: {
'jest/no-done-callback': 'off'
}
};

0 comments on commit 18f953f

Please sign in to comment.