Skip to content

Commit

Permalink
Split build tests and integration tests in 2 workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Jan 29, 2025
1 parent 8de473a commit 5ee292d
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 114 deletions.
114 changes: 0 additions & 114 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,120 +102,6 @@ jobs:
path: python/jupyterlab-chat/dist/jupyterlab_chat*
if-no-files-found: error

integration-tests:
name: Integration tests
needs: build_extension
runs-on: ubuntu-latest

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Download extension package
uses: actions/download-artifact@v3
with:
name: jupyterlab_chat-artifacts

- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_chat*.whl
- name: Install dependencies
working-directory: ui-tests
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install

- name: Set up browser cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install browser
run: jlpm playwright install chromium
working-directory: ui-tests

- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm test --retries=2
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v3
with:
name: jupyterlab_chat-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report
integration-tests-notebook:
name: Integration tests notebook
needs: build_extension
runs-on: ubuntu-latest

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Download extension package
uses: actions/download-artifact@v3
with:
name: jupyterlab_chat-artifacts

- name: Install the extension
run: |
set -eux
python -m pip install "notebook>=7.0.0,<8" jupyterlab_chat*.whl
- name: Install dependencies
working-directory: ui-tests
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install

- name: Set up browser cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install browser
run: jlpm playwright install chromium
working-directory: ui-tests

- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm test:notebook --retries=2
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v3
with:
name: jupyterlab_chat-notebook-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report
typing-tests:
name: Typing test
runs-on: ubuntu-latest
Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Build

on:
push:
branches: main
pull_request:
branches: '*'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
jupyterlab:
name: Integration tests jupyterlab
runs-on: ubuntu-latest

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.0.0,<5"
./scripts/dev_install.sh
- name: Install tests dependencies
working-directory: ui-tests
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install

- name: Set up browser cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install browser
run: jlpm playwright install chromium
working-directory: ui-tests

- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm test --retries=2
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v3
with:
name: integration-jupyterlab
path: |
ui-tests/test-results
ui-tests/playwright-report
notebook:
name: Integration tests notebook
runs-on: ubuntu-latest

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install the extension
run: |
set -eux
python -m pip install "notebook>=7.0.0,<8"
./scripts/dev_install.sh
- name: Install dependencies
working-directory: ui-tests
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install

- name: Set up browser cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install browser
run: jlpm playwright install chromium
working-directory: ui-tests

- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm test:notebook --retries=2
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v3
with:
name: integration-notebook
path: |
ui-tests/test-results
ui-tests/playwright-report

0 comments on commit 5ee292d

Please sign in to comment.