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
8 changes: 5 additions & 3 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ jobs:

- name: Install and Run Tests
run: |
uv sync --dev
uv sync --all-extras --dev
source .venv/bin/activate
uv pip install -r tests/requirements.txt
uv run playwright install
uv run pytest -s ./tests --cov=src --cov-report=xml
uv pip install . # pyvista revert trame-vtk to another version
playwright install
pytest -s ./tests --cov=src --cov-report=xml

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
Binary file added tests/baseline-scene-export-github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 13 additions & 3 deletions tests/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
from playwright.async_api import async_playwright
from pyvista import examples

EXPECTED_SCREENSHOT = Path(__file__).with_name("baseline-scene-export.png")
EXPECTED_SCREENSHOTS = [
Path(__file__).with_name(f)
for f in ("baseline-scene-export.png", "baseline-scene-export-github.png")
]

TEST_BASE = (Path(__file__).with_name("refs") / "test_export").resolve()
TEST_BASE.mkdir(exist_ok=True, parents=True)

Expand Down Expand Up @@ -46,5 +50,11 @@ async def test_export():
await browser.close()

# Test image
error = pv.compare_images(screenshot_export_file, EXPECTED_SCREENSHOT)
assert error < 200
for expected in EXPECTED_SCREENSHOTS:
if (
expected.exists()
and pv.compare_images(screenshot_export_file, expected) < 200
):
return

pytest.fail("No matching baseline")
Loading