Integrate Visualization Testing in Mesa CI
Goal
Add comprehensive testing for Mesa's visualization components (SolaraViz) to our CI pipeline to ensure visualization functionality works correctly across all example models.
What's Been Tried
- Basic model testing exists in
test_examples.pybut doesn't validate visualization components - PR #2491 started testing example app initialization by importing and accessing
app.page - PR #215 in mesa-examples attempted more thorough SolaraViz testing but encountered import issues
Current Status
- No systematic testing of visualization functionality exists in our CI
- No performance benchmarks for visualizations
- Basic tests only confirm models run but don't verify visualization correctness
- The
viz.pyapproach shows promise but needs integration with existing test infrastructure
The Solara docs might be useful: Testing with Solara
Part of #2364.
Hey @EwoutH, I would like some clarification on the 'visualization correctness' part you mention, does it mean correct model behaviour?
I would like some clarification on the 'visualization correctness' part you mention, does it mean correct model behaviour?
I would say it means that what happens in the models is correctly visualized.
But don't overcomplicate this issue. Most important thing is that no runtime errors occur in example models. Currently we have zero example testing of visualisation, leading to frequent hard errors.
If that's the case I think PR #2767 covers those cases pretty well.
Hello @EwoutH Good Morning sir, i would like to work on this issue is it open or it has been merged?
Hi everyone,
I was just working on issue #2535 (PR #2871) and @EwoutH pointed out that the bug I fixed wasn't caught by the current CI.
What I found is that our current ReadTheDocs CI for tutorials successfully runs the 0_first_model.ipynb notebook. However, the MoneyModel defined in that tutorial fails with a ValueError: Missing required model parameter: "n" if you try to pass it to ModelPage(MoneyModel) from Solara, because it's missing default parameter values.
The CI doesn't test this "visualization" step, it only tests if the notebook runs on its own. It would be great if our CI could also try to render the tutorial models with ModelPage to catch this kind of visualization-specific bug in the future.