Added comprehensive testing for visualization components #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Visualization Tests | |
on: | |
push: | |
branches: [ main, master, dev ] | |
pull_request: | |
branches: [ main, master, dev ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9, "3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest pytest-mock pytest-cov | |
python -m pip install -e .[dev,viz] | |
- name: Run visualization tests | |
run: | | |
pytest -xvs mesa/tests/test_visualization_components.py mesa/tests/test_solara_viz.py | |
- name: Run visualization benchmarks | |
run: | | |
pytest -xvs mesa/tests/test_visualization_components.py::TestPerformanceBenchmarks | |
- name: Generate test coverage report | |
run: | | |
pytest --cov=mesa.visualization mesa/tests/test_visualization_components.py mesa/tests/test_solara_viz.py --cov-report=xml | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
flags: visualization | |
name: viz-coverage |