diff --git a/.github/workflows/test_and_release.yml b/.github/workflows/test_and_release.yml index 336763d..2bcff95 100644 --- a/.github/workflows/test_and_release.yml +++ b/.github/workflows/test_and_release.yml @@ -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 diff --git a/tests/baseline-scene-export-github.png b/tests/baseline-scene-export-github.png new file mode 100644 index 0000000..88c5c5b Binary files /dev/null and b/tests/baseline-scene-export-github.png differ diff --git a/tests/test_export.py b/tests/test_export.py index 7246947..6fbbc70 100644 --- a/tests/test_export.py +++ b/tests/test_export.py @@ -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) @@ -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")