Skip to content

ci: Fix failing ci #116

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

Merged
merged 7 commits into from
Apr 3, 2025
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
15 changes: 8 additions & 7 deletions .github/workflows/ipywidgets-bokeh-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,27 @@ jobs:
max-parallel: 3
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [18.x]
node-version: [20.x]
python-version: ["3.12"]

defaults:
run:
shell: bash -el {0}

steps:
- name: Set up conda and install base
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
activate-environment: test
channels: conda-forge
python-version: ${{ matrix.python-version }}

- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down Expand Up @@ -65,13 +68,11 @@ jobs:
- name: Install dev Python dependencies & Playwright browsers
if: success() || failure()
run: |
conda install --channel conda-forge -y pip python
conda info
python -m pip install --editable .[dev]
python -m playwright install --with-deps
python -m playwright install chromium

- name: Run Playwright & Python tests
if: matrix.os != 'windows-latest'
run: |
pytest

Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from panel.tests.conftest import asyncio_loop, server_cleanup # noqa: F401
11 changes: 4 additions & 7 deletions tests/test_anywidget.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import time

import anywidget
import panel as pn
import traitlets
from panel.io.server import serve
from playwright.sync_api import expect, Page
from panel.tests.util import serve_and_wait
from playwright.sync_api import Page, expect


class CounterWidget(anywidget.AnyWidget):
Expand Down Expand Up @@ -33,7 +31,7 @@ class CounterWidget(anywidget.AnyWidget):
count = traitlets.Int(default_value=0).tag(sync=True)


def test_anywidget(page: Page) -> None:
def test_anywidget(page: Page, asyncio_loop) -> None:
"""Test anywidget button counter example."""
# Port to run the panel server on.
port = 5006
Expand All @@ -44,8 +42,7 @@ def test_anywidget(page: Page) -> None:

# Serve the button using panel, the time delay is necessary for panel to start and
# serve the widget.
serve(panels=panels, port=port, show=False)
time.sleep(0.2)
serve_and_wait(panels, port=port)

# Go to the page and locate the widget using playwright.
page.goto(f"http://localhost:{port}")
Expand Down
Loading