Skip to content

TST add comprehensive headless WebGL rendering tests#606

Merged
mvdoc merged 3 commits intogallantlab:mainfrom
mvdoc:test-webgl-headless
Mar 22, 2026
Merged

TST add comprehensive headless WebGL rendering tests#606
mvdoc merged 3 commits intogallantlab:mainfrom
mvdoc:test-webgl-headless

Conversation

@mvdoc
Copy link
Copy Markdown
Contributor

@mvdoc mvdoc commented Mar 22, 2026

Summary

  • Adds cortex/tests/test_webgl_headless.py with 32 parametrized tests that exercise the headless WebGL viewer across all supported data types, camera angles, surface states, and panel layouts
  • Uses class-scoped pytest fixtures to share browser sessions, keeping total runtime to ~6 minutes
  • All tests skip gracefully when playwright is not installed

Test coverage

Group Tests What's covered
Data types 6 Volume, Vertex, VolumeRGB, VertexRGB, Volume2D, Vertex2D
Camera angles 13 All entries in angle_view_params
Surface types 5 fiducial, inflated_less, inflated, inflated_cut, flatmap
Panel presets 5 All params_* layouts
View roundtrip 1 _set_view_capture_view parameter verification
Overlay toggle 1 With/without ROI overlays produce different images
addData 1 (xfail) Dataset switching — blocked by _convert_dataset closure

Test plan

  • pytest cortex/tests/test_webgl_headless.py -v — 31 passed, 1 xfail
  • pytest cortex/tests/test_headless.py cortex/tests/test_export.py -v — existing 7 tests still pass

mvdoc added 2 commits March 21, 2026 18:33
Add test_webgl_headless.py with 32 parametrized tests covering:
- All 6 data types (Volume, Vertex, VolumeRGB, VertexRGB, Volume2D, Vertex2D)
- All 13 predefined camera angles
- All 5 surface morph states (fiducial to flatmap)
- All 5 predefined panel layouts
- _capture_view roundtrip verification
- Overlay visibility comparison (with/without ROIs)
- addData dataset switching (xfail: closure not available in headless path)

Uses class-scoped fixtures to share browser sessions across angle and
surface tests, reducing total runtime from ~15 min to ~6 min.
@mvdoc mvdoc force-pushed the test-webgl-headless branch from 07a9c85 to caed40c Compare March 22, 2026 01:33
The file is created (touched) by the POST handler before image data is
written.  In CI with slow software rendering, _wait_for_file was
returning too early on a 0-byte file.
@mvdoc mvdoc merged commit 4bf6d75 into gallantlab:main Mar 22, 2026
12 checks passed
@mvdoc mvdoc deleted the test-webgl-headless branch March 22, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant