Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Galata tests: use webServer in the Playwright config to start JupyterLab #13650

Open
jtpio opened this issue Dec 22, 2022 · 0 comments
Open

Galata tests: use webServer in the Playwright config to start JupyterLab #13650

jtpio opened this issue Dec 22, 2022 · 0 comments

Comments

@jtpio
Copy link
Member

jtpio commented Dec 22, 2022

Problem

Currently we need to start JupyterLab separately to run the Galata tests:

- name: Launch JupyterLab
run: |
cd galata
jlpm start 2>&1 > /tmp/jupyterlab_server.log &

And wait for it to be ready:

- name: Wait for JupyterLab
uses: ifaxity/wait-on-action@v1
with:
resource: http-get://localhost:8888/lab
timeout: 360000

Proposed Solution

Playwright added support for starting web servers via the playwright.config.js in 1.24:

https://github.com/microsoft/playwright/releases/tag/v1.24.0

// playwright.config.ts
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
  webServer: [
    {
      command: 'npm run start',
      port: 3000,
      timeout: 120 * 1000,
      reuseExistingServer: !process.env.CI,
    },
    {
      command: 'npm run backend',
      port: 3333,
      timeout: 120 * 1000,
      reuseExistingServer: !process.env.CI,
    }
  ],
  use: {
    baseURL: 'http://localhost:3000/',
  },
};
export default config;

We could leverage this to streamline how the JupyterLab application is started for the UI tests. Playwright handles waiting for the application to be ready (port and url are configurable).

Additional context

Docs: https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests

@jtpio jtpio added enhancement status:Needs Triage Applied to new issues that need triage tag:Testing labels Dec 22, 2022
@krassowski krassowski removed the status:Needs Triage Applied to new issues that need triage label Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants