diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e004e84..9366064 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,6 +79,10 @@ jobs: integration-tests: name: Integration tests + strategy: + fail-fast: false + matrix: + jupyterlab: ['3.6', '4.0'] needs: build runs-on: ubuntu-latest @@ -100,13 +104,17 @@ jobs: - name: Install the extension run: | set -eux - python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_favorites*.whl + python -m pip install "jupyterlab~=${{ matrix.jupyterlab }}" jupyterlab_favorites*.whl - name: Install dependencies working-directory: ui-tests env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - run: jlpm install + run: | + if [[ "${{ matrix.jupyterlab }}" == "3.6" ]]; then + jlpm add -D "@jupyterlab/galata@^4.0.0" + fi + jlpm install - name: Set up browser cache uses: actions/cache@v3 @@ -121,8 +129,10 @@ jobs: - name: Execute integration tests working-directory: ui-tests + env: + PLAYWRIGHT_HTML_REPORT: playwright-report-${{ matrix.jupyterlab }} run: | - jlpm playwright test + jlpm playwright test --output test-results-${{ matrix.jupyterlab }} - name: Upload Playwright Test report if: always() @@ -130,8 +140,8 @@ jobs: with: name: jupyterlab_favorites-playwright-tests path: | - ui-tests/test-results - ui-tests/playwright-report + ui-tests/test-results* + ui-tests/playwright-report* check_links: name: Check Links diff --git a/ui-tests/jupyter_server_test_config.py b/ui-tests/jupyter_server_test_config.py index f2a9478..c346ddd 100644 --- a/ui-tests/jupyter_server_test_config.py +++ b/ui-tests/jupyter_server_test_config.py @@ -4,9 +4,30 @@ opens the server to the world and provide access to JupyterLab JavaScript objects through the global window variable. """ -from jupyterlab.galata import configure_jupyter_server +try: + # Available from JupyterLab 4 and later + from jupyterlab.galata import configure_jupyter_server -configure_jupyter_server(c) + configure_jupyter_server(c) + + # Option specific for notebook v7+ + # import jupyterlab + # from pathlib import Path + # c.JupyterNotebookApp.expose_app_in_browser = True + # c.LabServerApp.extra_labextensions_path = str(Path(jupyterlab.__file__).parent / "galata") + +except ImportError: + from tempfile import mkdtemp + + c.ServerApp.port = 8888 + c.ServerApp.port_retries = 0 + c.ServerApp.open_browser = False + + c.ServerApp.root_dir = mkdtemp(prefix='galata-test-') + c.ServerApp.token = "" + c.ServerApp.password = "" + c.ServerApp.disable_check_xsrf = True + c.LabApp.expose_app_in_browser = True # Uncomment to set server log level to debug level # c.ServerApp.log_level = "DEBUG"