Skip to content

Latest commit

 

History

History
137 lines (102 loc) · 2.47 KB

File metadata and controls

137 lines (102 loc) · 2.47 KB

Quick Start Guide - Testing

Installation

Install test dependencies:

pip install pytest pytest-cov pytest-timeout pytest-xdist

Running Tests

Run all tests:

pytest

Run only fast tests (exclude slow integration tests):

pytest -m "not slow"

Run only unit tests:

pytest -m unit

Run only integration tests:

pytest -m integration

Run with coverage report:

pytest --cov=. --cov-report=html
open htmlcov/index.html  # View coverage in browser

Run in parallel (faster):

pytest -n auto

Run specific test file:

pytest test_aux.py

Run with verbose output:

pytest -v

Test Files

File Description Test Count
test_aux.py Tests for aux.py module (Helmholtz, LaTeX) 15+
test_cleanup.py Tests for cleanup.py functionality 8
test_self_heat.py Tests for Helmholtz EOS integration 5
test_self_heat_integration.py End-to-end workflow tests 20+

Prerequisites

Before running tests:

cd _helmholtz
make
cd ..

Common Issues

"Helmholtz executable not found"

Solution: Compile Helmholtz first

cd _helmholtz && make && cd ..

"Test data files not found"

Solution: Ensure you're in the project root directory with:

  • helm_input_test_data.txt
  • helm_output_test_data.txt
  • helm_table.dat

Tests timeout

Solution: Run without slow tests

pytest -m "not slow"

CI/CD

Tests run automatically on GitHub Actions:

  • Every push to main
  • Every pull request
  • Daily at midnight UTC
  • Can be triggered manually

View results at: https://github.com/[your-repo]/actions

Test Markers

  • @pytest.mark.unit - Fast unit tests
  • @pytest.mark.integration - Integration tests
  • @pytest.mark.slow - Long-running tests
  • @pytest.mark.helmholtz - Requires Helmholtz executable

Quick Commands Cheat Sheet

# Install dependencies
pip install pytest pytest-cov pytest-timeout pytest-xdist

# Compile Helmholtz
cd _helmholtz && make && cd ..

# Run fast tests only
pytest -m "not slow"

# Run with coverage
pytest --cov=. --cov-report=html

# Run in parallel
pytest -n auto

# Run specific test
pytest test_aux.py::TestHelmholtzCall::test_helmholtz_forward_call

# List all tests without running
pytest --collect-only

Getting Help

For detailed documentation, see TESTING.md

For test suite summary, see TEST_SUITE_SUMMARY.md