Skip to content

Commit

Permalink
Add Galata in JupyterLab (#10796)
Browse files Browse the repository at this point in the history
* Initial import of galata

Homogeneous version

Fix tests

WIP drop jest

WIP playwright

First working version

WIP mock state and settings

Use node-fetch instead of axios

Add temporary server test folder fixture

Remove html report assets

Track sessions and terminals related to a test

Finalize notebook tests

Set up CI

Don't use a single worker by default

Delete data.csv

Increase timeout to wait for JLab in dev-mode

Build the galata assets before the tests

Install chromium

Upload galata artifacts

Bump playwright test runner

enhance settings fixture

Correct tests

Fix integrity

Split assests into two artifacts

Fix regex and settings setting

Fix mockSettings test

WIP Convert contextmenu tests

galata refactoring

All contents helpers use the REST API

Correct linter ignore files

Correct contextmenu test

Migrate debugger tests

Start converting general tests

Convert general tests

convert notebook-run

Improve temporary server folder name

Convert toc tests

Convert notebook create

Convert notebook-edit

Convert notebook-toolbar

Improve test:report
Open browser
Don't expose local port

Fix galata tests

Improve test partitioning for sessions and terminals

Use Playwright project feat. to merge galata and ui-tests

Update test using project structure

Fix jupyterlab/galata#69

Upgrade newly added tests

Add install

Fix build inpage

Fix tests

More fix

Try to fix typedoc

Update reference screenshots

Use galata.newContentsHelper

More robust `page.waitIsReady`

Fix types for typedoc

Revert change for integrity testing

Auto review

* Don't use docker to speed up tests

* Fix linter
More robust test

* Correct test

* Various fix
Add fixtures documentation

* Use playwright image for Galata test
Correct integrity

* Don't use pwuser

* Revert running in Playwright image

* Update galata/package.json

Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>

Co-authored-by: Steven Silvester <ssilvester@apple.com>
Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
  • Loading branch information
3 people committed Aug 28, 2021
1 parent 9c592fc commit 0b6f1d7
Show file tree
Hide file tree
Showing 249 changed files with 8,520 additions and 6,149 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
3 changes: 2 additions & 1 deletion .eslintrc.typecheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
project: 'tsconfig.eslint.json'
},
rules: {
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }]
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
'jest/no-done-callback': 'off'
}
};
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ tag:Examples:
tag:Testing:
- tests/**/*
- tests/*
- ui-tests/**/*
- ui-tests/*
- galata/**/*
- galata/*

######################
# Package Labels #
Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/galata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Galata Tests

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

jobs:
build:
name: Galata
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: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ packages/theme-*/static
tests/**/coverage
tests/**/.cache-loader

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

package_json.tar.gz

# javascript/typescript
lib
node_modules
Expand Down Expand Up @@ -111,10 +117,5 @@ junit.xml
*.code-workspace
.history
.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 0b6f1d7

Please sign in to comment.