#!/usr/bin/env bash set -euo pipefail # run.sh — Convenience wrapper for running the wiki pipeline test suite. # # Usage: # bash tests/run.sh # Run the full suite # bash tests/run.sh -v # Verbose output # bash tests/run.sh test_wiki_lib # Run one file # bash tests/run.sh -k "parse" # Run tests matching a pattern # # All arguments are passed through to pytest. TESTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${TESTS_DIR}" # Verify pytest is available if ! python3 -c "import pytest" 2>/dev/null; then echo "pytest not installed. Install with: pip install --user pytest" exit 2 fi # Clear any previous test artifacts rm -rf .pytest_cache 2>/dev/null || true # Default args: quiet with colored output if [[ $# -eq 0 ]]; then exec python3 -m pytest --tb=short else exec python3 -m pytest "$@" fi