diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index fffa32f..0000000 --- a/.eslintignore +++ /dev/null @@ -1,8 +0,0 @@ -node_modules -dist -coverage -**/*.d.ts -tests - -**/__tests__ -ui-tests diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 665374b..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = { - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:prettier/recommended' - ], - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - sourceType: 'module' - }, - plugins: ['@typescript-eslint'], - rules: { - '@typescript-eslint/naming-convention': [ - 'error', - { - selector: 'interface', - format: ['PascalCase'], - custom: { - regex: '^I[A-Z]', - match: true - } - } - ], - '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }], - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-namespace': 'off', - '@typescript-eslint/no-use-before-define': 'off', - '@typescript-eslint/quotes': [ - 'error', - 'single', - { avoidEscape: true, allowTemplateLiterals: false } - ], - curly: ['error', 'all'], - eqeqeq: 'error', - 'prefer-arrow-callback': 'error' - } -}; diff --git a/.github/workflows/update-integration-tests.yml b/.github/workflows/update-integration-tests.yml deleted file mode 100644 index 0939768..0000000 --- a/.github/workflows/update-integration-tests.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Update Playwright Snapshots - -on: - issue_comment: - types: [created, edited] - -permissions: - contents: write - pull-requests: write - -jobs: - - - update-snapshots: - if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please update playwright snapshots') }} - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Configure git to use https - run: git config --global hub.protocol https - - - name: Checkout the branch from the PR that triggered the job - run: hub pr checkout ${{ github.event.issue.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install dependencies - run: | - set -eux - jlpm - python -m pip install . - - - uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - # Playwright knows how to start JupyterLab server - start_server_script: 'null' - test_folder: ui-tests - \ No newline at end of file diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index d0824a6..0000000 --- a/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "none", - "arrowParens": "avoid", - "endOfLine": "auto" -} diff --git a/.stylelintrc b/.stylelintrc deleted file mode 100644 index 0e1ff30..0000000 --- a/.stylelintrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": [ - "stylelint-config-recommended", - "stylelint-config-standard", - "stylelint-prettier/recommended" - ], - "rules": { - "property-no-vendor-prefix": null, - "selector-no-vendor-prefix": null, - "value-no-vendor-prefix": null - } -} diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 6236023..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,32 +0,0 @@ -include LICENSE -include *.md -include pyproject.toml -recursive-include jupyter-config *.json -include conftest.py - -include package.json -include install.json -include ts*.json -include *.config.js -include yarn.lock - -graft jupyter_app_launcher/labextension -graft jupyter_app_launcher/schema - -# Javascript files -graft src -graft style -graft ui-tests -prune **/node_modules -prune lib -prune binder - -# Patterns to exclude from any directory -global-exclude *~ -global-exclude *.pyc -global-exclude *.pyo -global-exclude .git -global-exclude .ipynb_checkpoints - -# Documentation -prune docs \ No newline at end of file diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 8b5c764..0000000 --- a/babel.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@jupyterlab/testutils/lib/babel.config'); diff --git a/conftest.py b/conftest.py deleted file mode 100644 index 215c523..0000000 --- a/conftest.py +++ /dev/null @@ -1,8 +0,0 @@ -import pytest - -pytest_plugins = ("jupyter_server.pytest_plugin", ) - - -@pytest.fixture -def jp_server_config(jp_server_config): - return {"ServerApp": {"jpserver_extensions": {"jupyter_app_launcher": True}}} diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index 514c380..0000000 --- a/jest.config.js +++ /dev/null @@ -1,42 +0,0 @@ -const jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config'); - -const esModules = [ - '@jupyterlab/', - 'lib0', - 'y\\-protocols', - 'y\\-websocket', - 'yjs' -].join('|'); - -const jlabConfig = jestJupyterLab(__dirname); - -const { - moduleFileExtensions, - moduleNameMapper, - preset, - setupFilesAfterEnv, - setupFiles, - testPathIgnorePatterns, - transform -} = jlabConfig; - -module.exports = { - moduleFileExtensions, - moduleNameMapper, - preset, - setupFilesAfterEnv, - setupFiles, - testPathIgnorePatterns, - transform, - automock: false, - collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts'], - coverageDirectory: 'coverage', - coverageReporters: ['lcov', 'text'], - globals: { - 'ts-jest': { - tsconfig: 'tsconfig.json' - } - }, - testRegex: 'src/.*/.*.spec.ts[x]?$', - transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`] -}; diff --git a/jupyter-config/nb-config/jupyter_app_launcher.json b/jupyter-config/nb-config/jupyter_app_launcher.json deleted file mode 100644 index bf74356..0000000 --- a/jupyter-config/nb-config/jupyter_app_launcher.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "NotebookApp": { - "nbserver_extensions": { - "jupyter_app_launcher": true - } - } -} diff --git a/jupyter_app_launcher/tests/__init__.py b/jupyter_app_launcher/tests/__init__.py deleted file mode 100644 index 9cc4a55..0000000 --- a/jupyter_app_launcher/tests/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Python unit tests for jupyter_app_launcher.""" diff --git a/jupyter_app_launcher/tests/test_handlers.py b/jupyter_app_launcher/tests/test_handlers.py deleted file mode 100644 index df5440b..0000000 --- a/jupyter_app_launcher/tests/test_handlers.py +++ /dev/null @@ -1,3 +0,0 @@ -async def test_get_example(jp_fetch): - # When - assert True diff --git a/src/__tests__/jupyter_app_launcher.spec.ts b/src/__tests__/jupyter_app_launcher.spec.ts deleted file mode 100644 index 12e5d5f..0000000 --- a/src/__tests__/jupyter_app_launcher.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Example of [Jest](https://jestjs.io/docs/getting-started) unit tests - */ - -describe('jupyter_app_launcher', () => { - it('should be tested', () => { - expect(1 + 1).toEqual(2); - }); -}); diff --git a/ui-tests/README.md b/ui-tests/README.md deleted file mode 100644 index 3544aec..0000000 --- a/ui-tests/README.md +++ /dev/null @@ -1,148 +0,0 @@ -# Integration Testing - -This folder contains the integration tests of the extension. - -They are defined using [Playwright](https://playwright.dev/docs/intro) test runner -and [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) helper. - -The Playwright configuration is defined in [playwright.config.js](./playwright.config.js). - -The JupyterLab server configuration to use for the integration test is defined -in [jupyter_server_test_config.py](./jupyter_server_test_config.py). - -The default configuration will produce video for failing tests and an HTML report. - -## Run the tests - -> All commands are assumed to be executed from the root directory - -To run the tests, you need to: - -1. Compile the extension: - -```sh -jlpm install -jlpm build:prod -``` - -> Check the extension is installed in JupyterLab. - -2. Install test dependencies (needed only once): - -```sh -cd ./ui-tests -jlpm install -jlpm playwright install -cd .. -``` - -3. Execute the [Playwright](https://playwright.dev/docs/intro) tests: - -```sh -cd ./ui-tests -jlpm playwright test -``` - -Test results will be shown in the terminal. In case of any test failures, the test report -will be opened in your browser at the end of the tests execution; see -[Playwright documentation](https://playwright.dev/docs/test-reporters#html-reporter) -for configuring that behavior. - -## Update the tests snapshots - -> All commands are assumed to be executed from the root directory - -If you are comparing snapshots to validate your tests, you may need to update -the reference snapshots stored in the repository. To do that, you need to: - -1. Compile the extension: - -```sh -jlpm install -jlpm build:prod -``` - -> Check the extension is installed in JupyterLab. - -2. Install test dependencies (needed only once): - -```sh -cd ./ui-tests -jlpm install -jlpm playwright install -cd .. -``` - -3. Execute the [Playwright](https://playwright.dev/docs/intro) command: - -```sh -cd ./ui-tests -jlpm playwright test -u -``` - -> Some discrepancy may occurs between the snapshots generated on your computer and -> the one generated on the CI. To ease updating the snapshots on a PR, you can -> type `please update playwright snapshots` to trigger the update by a bot on the CI. -> Once the bot has computed new snapshots, it will commit them to the PR branch. - -## Create tests - -> All commands are assumed to be executed from the root directory - -To create tests, the easiest way is to use the code generator tool of playwright: - -1. Compile the extension: - -```sh -jlpm install -jlpm build:prod -``` - -> Check the extension is installed in JupyterLab. - -2. Install test dependencies (needed only once): - -```sh -cd ./ui-tests -jlpm install -jlpm playwright install -cd .. -``` - -3. Execute the [Playwright code generator](https://playwright.dev/docs/codegen): - -```sh -cd ./ui-tests -jlpm playwright codegen localhost:8888 -``` - -## Debug tests - -> All commands are assumed to be executed from the root directory - -To debug tests, a good way is to use the inspector tool of playwright: - -1. Compile the extension: - -```sh -jlpm install -jlpm build:prod -``` - -> Check the extension is installed in JupyterLab. - -2. Install test dependencies (needed only once): - -```sh -cd ./ui-tests -jlpm install -jlpm playwright install -cd .. -``` - -3. Execute the Playwright tests in [debug mode](https://playwright.dev/docs/debug): - -```sh -cd ./ui-tests -PWDEBUG=1 jlpm playwright test -``` diff --git a/ui-tests/jupyter_server_test_config.py b/ui-tests/jupyter_server_test_config.py deleted file mode 100644 index 5ba7a91..0000000 --- a/ui-tests/jupyter_server_test_config.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Server configuration for integration tests. - -!! Never use this configuration in production because it -opens the server to the world and provide access to JupyterLab -JavaScript objects through the global window variable. -""" -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" diff --git a/ui-tests/package.json b/ui-tests/package.json deleted file mode 100644 index f1691aa..0000000 --- a/ui-tests/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "jupyter_app_launcher-ui-tests", - "version": "1.0.0", - "description": "JupyterLab jupyter_app_launcher Integration Tests", - "private": true, - "scripts": { - "start": "jupyter lab --config jupyter_server_test_config.py", - "test": "jlpm playwright test" - }, - "devDependencies": { - "@jupyterlab/galata": "^4.3.0" - } -} diff --git a/ui-tests/playwright.config.js b/ui-tests/playwright.config.js deleted file mode 100644 index 9ece6fa..0000000 --- a/ui-tests/playwright.config.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Configuration for Playwright using default from @jupyterlab/galata - */ -const baseConfig = require('@jupyterlab/galata/lib/playwright-config'); - -module.exports = { - ...baseConfig, - webServer: { - command: 'jlpm start', - url: 'http://localhost:8888/lab', - timeout: 120 * 1000, - reuseExistingServer: !process.env.CI - } -}; diff --git a/ui-tests/tests/jupyter_app_launcher.spec.ts b/ui-tests/tests/jupyter_app_launcher.spec.ts deleted file mode 100644 index 0f22cb9..0000000 --- a/ui-tests/tests/jupyter_app_launcher.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect, test } from '@jupyterlab/galata'; - -/** - * Don't load JupyterLab webpage before running the tests. - * This is required to ensure we capture all log messages. - */ -test.use({ autoGoto: false }); - -test('should emit an activation console message', async ({ page }) => { - const logs: string[] = []; - - page.on('console', message => { - logs.push(message.text()); - }); - - await page.goto(); - - expect( - logs.filter( - s => s === 'JupyterLab extension jupyter_app_launcher is activated!' - ) - ).toHaveLength(1); -});