Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
- name: Test Examples
run: |
pixi run -e ${{ matrix.environment }} test-example
- uses: codecov/codecov-action@v5
- uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -201,14 +201,10 @@ jobs:
run: |
jupyter server extension enable panel.io.jupyter_server_extension --sys-prefix
(jupyter lab --config panel/tests/ui/jupyter_server_test_config.py --port 8887 > /tmp/jupyterlab_server.log 2>&1) &
curl -fsS --retry 180 --retry-delay 1 --retry-connrefused http://localhost:8887/lab >/dev/null
- name: Build JupyterLite
shell: pixi run -e test-ui bash -e {0}
run: pixi run -e lite lite-build
- name: Wait for JupyterLab
uses: ifaxity/wait-on-action@v1.2.1
with:
resource: http-get://localhost:8887/lab
timeout: 180000
- name: Check if auth should run
if: '!github.event.pull_request.head.repo.fork'
run: |
Expand All @@ -231,7 +227,7 @@ jobs:
shell: pixi run -e test-ui bash -e {0}
run: |
jupyter lab stop 8887 || true
- uses: codecov/codecov-action@v5
- uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down
3 changes: 2 additions & 1 deletion panel/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,14 @@ def pytest_generate_tests(metafunc):
def pytest_collection_modifyitems(config, items):
skipped, selected = [], []
markers = [m for m in optional_markers if config.getoption(f"--{m}")]
not_markers = [m for m in optional_markers if not config.getoption(f"--{m}")]
empty = not markers
for item in items:
if empty and any(m in item.keywords for m in optional_markers):
skipped.append(item)
elif empty:
selected.append(item)
elif not empty and any(m in item.keywords for m in markers):
elif any(m in item.keywords for m in markers) and not any(m in item.keywords for m in not_markers):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to ignore the jupyter marked test when --jupyter marker is not set.

Image

selected.append(item)
else:
skipped.append(item)
Expand Down
15 changes: 10 additions & 5 deletions panel/tests/ui/io/test_jupyter_server_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

from panel.tests.util import wait_until

pytestmark = [pytest.mark.jupyter, pytest.mark.flaky(max_runs=3)]
pytestmark = pytest.mark.jupyter


def test_jupyter_server(page, jupyter_preview):
page.goto(f"{jupyter_preview}/app.py", timeout=30000)
page.goto(f"{jupyter_preview}/app.py")
page.wait_for_load_state('networkidle')

assert page.text_content('pre') == '0'

Expand All @@ -28,14 +29,17 @@ def test_jupyter_server(page, jupyter_preview):


def test_jupyter_server_custom_resources(page, jupyter_preview):
page.goto(f"{jupyter_preview}/app.py", timeout=30000)
page.goto(f"{jupyter_preview}/app.py")
page.wait_for_load_state('networkidle')

assert page.locator('.bk-Row').evaluate("""(element) =>
window.getComputedStyle(element).getPropertyValue('background-color')""") == 'rgb(128, 0, 128)'


@pytest.mark.flaky(reruns=3, reruns_delay=5)
def test_jupyter_server_kernel_error(page, jupyter_preview):
page.goto(f"{jupyter_preview}/app.py?kernel=blah", timeout=30000)
page.goto(f"{jupyter_preview}/app.py?kernel=blah")
page.wait_for_load_state('networkidle')

expect(page.locator('#error-type')).to_have_text("Kernel Error")
expect(page.locator('#error')).to_have_text("No such kernel 'blah'")
Expand All @@ -50,7 +54,8 @@ def test_jupyter_server_kernel_error(page, jupyter_preview):


def test_jupyter_server_session_arg_theme(page, jupyter_preview):
page.goto(f"{jupyter_preview}/app.py?theme=dark", timeout=30000)
page.goto(f"{jupyter_preview}/app.py?theme=dark")
page.wait_for_load_state('networkidle')

expect(page.locator('body')).to_have_css('color', 'rgb(0, 0, 0)')

Expand Down
16 changes: 9 additions & 7 deletions panel/tests/ui/io/test_jupyterlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,26 @@ def launch_jupyterlite():
process.wait()


@pytest.mark.flaky(reruns=3, reruns_delay=5)
@pytest.mark.filterwarnings("ignore::ResourceWarning")
def test_jupyterlite_execution(launch_jupyterlite, page):
# INFO: Needs TS changes uploaded to CDN. Relevant when
# testing a new version of Bokeh.
page.goto("http://localhost:8123/index.html")
page.wait_for_load_state('networkidle')

page.locator('text="Getting_Started.ipynb"').first.dblclick()

# Select the kernel
if page.locator('.jp-Dialog').count() == 1:
page.locator('.jp-select-wrapper > select').select_option('Python (Pyodide)')
page.locator('.jp-Dialog-footer > button').nth(1).click()
page.wait_for_load_state('networkidle')

for _ in range(6):
page.locator('jp-button[data-command="notebook:run-cell-and-select-next"]').click()
page.wait_for_timeout(500)
if page.locator('.jp-Dialog').count() == 1: # Select the kernel if pop-up
Copy link
Copy Markdown
Member Author

@hoxbro hoxbro Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be triggered when the first python cell is encountered.

image

page.locator('.jp-select-wrapper > select').select_option('Python (Pyodide)')
page.locator('.jp-Dialog-footer > button').nth(1).click()
page.wait_for_load_state('networkidle')
expect(page.locator('.jp-Notebook-ExecutionIndicator')).to_have_attribute('data-status', 'idle', timeout=60_000)

page.locator('.noUi-handle').click(timeout=120 * 1000)
page.locator('.noUi-handle').click()

page.keyboard.press('ArrowRight')

Expand Down
1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ jupyterlab-myst = "*"
jupyterlite-core = "<0.7.0"
jupyterlite-pyodide-kernel = "*"
python-build = "*"
python-libarchive-c = "*"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed it when looking at the CI:

Image


[feature.lite.tasks]
lite-build = "bash scripts/jupyterlite/build.sh"
Expand Down
Loading