Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
90e7ab6
Linting updates
ColtonPayne Oct 5, 2025
0db9878
Final updates and CI/CD
ColtonPayne Oct 5, 2025
e15a4bc
Rm debug
ColtonPayne Oct 5, 2025
2db5fb6
Add linter to pre-commit hooks
ColtonPayne Oct 9, 2025
5a6f250
More lint fixes
ColtonPayne Oct 9, 2025
cd124e1
EOF fixer
ColtonPayne Oct 9, 2025
3e1a6f2
Exuse main pyreason from broad import lint fail
ColtonPayne Oct 9, 2025
b2e04ea
add back import
ColtonPayne Oct 9, 2025
5cc0ca1
Upd
ColtonPayne Oct 18, 2025
dd0904c
Add consistency check for interpretation and interpreation_parallel
ColtonPayne Oct 18, 2025
6a09ab1
Merge branch 'combine-functional' of https://github.com/ColtonPayne/p…
ColtonPayne Oct 18, 2025
f718204
Del check var names
ColtonPayne Oct 18, 2025
05e566d
Remove consistency check from push stage
ColtonPayne Oct 18, 2025
98ac373
Remove debug scripts
ColtonPayne Oct 18, 2025
90ec930
Remove print
ColtonPayne Oct 18, 2025
b775c82
Run unit tests in parrallel on make test
ColtonPayne Oct 18, 2025
07fc33c
Don't skip slow tests in pre-commit hooks
ColtonPayne Oct 18, 2025
e088709
Revert import order and function redefinition
ColtonPayne Oct 20, 2025
7c3357a
Merge pull request #46 from ColtonPayne/fix-linting
ColtonPayne Oct 21, 2025
5cef36b
Fix eof
ColtonPayne Oct 23, 2025
db51d5b
Update tests
ColtonPayne Oct 23, 2025
23d0209
Parameterize functional test
ColtonPayne Oct 23, 2025
5c0e435
Remove debug scripts
ColtonPayne Oct 23, 2025
5a16be7
Rem rule trace csv
ColtonPayne Oct 23, 2025
08b531a
Merge pull request #50 from ColtonPayne/sync-main
ColtonPayne Oct 23, 2025
3792a6b
Fix merge conflicts
ColtonPayne Oct 23, 2025
218247c
Move parrallel consistency
ColtonPayne Oct 23, 2025
8f8dc6c
Run full functional test suite on push
ColtonPayne Oct 23, 2025
7bb31a9
Make parallel check more flexible
ColtonPayne Oct 23, 2025
a7702df
Update path functional tests
ColtonPayne Oct 23, 2025
546f8fa
Update sync function
ColtonPayne Oct 23, 2025
067fd14
Delete duplicate file
ColtonPayne Oct 23, 2025
37a3e1b
Move API tests to thier own folder
ColtonPayne Oct 23, 2025
c3d0494
Fix typo
ColtonPayne Oct 23, 2025
3540cfb
Upd contributing.md
ColtonPayne Oct 23, 2025
7e6fd2f
Merge pull request #51 from ColtonPayne/combine-functional
ColtonPayne Oct 23, 2025
11b5469
Add scripts to api docs
ColtonPayne Oct 26, 2025
291f2c6
Merge pull request #52 from ColtonPayne/combine-functional
ColtonPayne Oct 26, 2025
c95621d
Delete fp test folder
ColtonPayne Oct 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/python-package-version-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:
python -m ruff check pyreason/scripts
- name: Pytest Unit Tests with JIT Disabled
run: |
pytest tests/unit/disable_jit -m "not slow" --tb=short -q
pytest tests/unit/disable_jit --tb=short -q
- name: Pytest Unit Tests with JIT Enabled
run: |
pytest tests/unit/dont_disable_jit -m "not slow" --tb=short -q
pytest tests/unit/dont_disable_jit --tb=short -q
- name: Pytest API Tests
run: |
pytest tests/unit/api_tests --tb=short -q
pytest tests/api_tests --tb=short -q
- name: Pytest Functional Tests
run: |
pytest tests/functional/ --tb=short
pytest tests/functional/ --tb=short -q
14 changes: 11 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ repos:
pass_filenames: false
stages: [pre-commit]

- id: sync-interpretation-parallel
name: Sync interpretation_parallel.py from interpretation.py
entry: .venv/bin/python sync_interpretation_parallel.py
language: system
pass_filenames: false
files: 'pyreason/scripts/interpretation/interpretation\.py'
stages: [pre-commit]

- id: pytest-unit-no-jit
name: Run JIT-disabled unit tests
entry: .venv/bin/python -m pytest tests/unit/disable_jit -m "not slow" --tb=short -q
Expand All @@ -34,15 +42,15 @@ repos:

# --- PUSH STAGE: Complete test suite ---
- id: pytest-unit-api
name: Run pyreason api unit tests
entry: .venv/bin/python -m pytest tests/unit/api_tests --tb=short -q
name: Run pyreason api tests
entry: .venv/bin/python -m pytest tests/api_tests --tb=short -q
language: system
pass_filenames: false
stages: [pre-push]

- id: pytest-functional-complete
name: Run functional test suite
entry: .venv/bin/python -m pytest tests/functional/ --tb=short
entry: .venv/bin/python -m pytest tests/functional/ --tb=short -q
language: system
pass_filenames: false
stages: [pre-push]
28 changes: 16 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Provides convenient shortcuts for running different test configurations

.PHONY: help test test-all test-fast test-api test-jit test-no-jit test-consistency \
test-parallel test-no-coverage coverage-report coverage-html coverage-xml \
test-parallel test-sequential test-no-coverage coverage-report coverage-html coverage-xml \
clean clean-coverage clean-reports install-deps lint check-deps

# Default target
Expand Down Expand Up @@ -37,16 +37,16 @@ help: ## Show this help message
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " $(GREEN)%-20s$(RESET) %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo ""
@echo "$(BLUE)Examples:$(RESET)"
@echo " make test # Run all test suites with coverage and open report"
@echo " make test # Run all test suites in parallel with coverage"
@echo " make test-sequential # Run all test suites sequentially (slower)"
@echo " make test-fast # Run only fast test suites"
@echo " make test-api # Run only API tests"
@echo " make test-parallel # Run tests in parallel where possible"
@echo " make coverage-html # Generate HTML coverage report"

# Main test targets
test: ## Run all test suites with coverage and open report
@echo "$(BOLD)$(BLUE)Running all test suites...$(RESET)"
$(RUN_TESTS)
test: ## Run all test suites with coverage and open report (in parallel)
@echo "$(BOLD)$(BLUE)Running all test suites in parallel...$(RESET)"
$(RUN_TESTS) --parallel
@echo "$(BOLD)$(GREEN)Opening coverage report in browser...$(RESET)"
@if [ -f test_reports/htmlcov/index.html ]; then \
open test_reports/htmlcov/index.html 2>/dev/null || \
Expand All @@ -58,8 +58,12 @@ test: ## Run all test suites with coverage and open report

test-all: test ## Alias for 'test' target

test-only: ## Run all test suites with coverage (no browser)
@echo "$(BOLD)$(BLUE)Running all test suites...$(RESET)"
test-only: ## Run all test suites with coverage (no browser, in parallel)
@echo "$(BOLD)$(BLUE)Running all test suites in parallel...$(RESET)"
$(RUN_TESTS) --parallel

test-sequential: ## Run all test suites sequentially (no parallelization)
@echo "$(BOLD)$(BLUE)Running all test suites sequentially...$(RESET)"
$(RUN_TESTS)

test-fast: ## Run only fast test suites (api_tests, dont_disable_jit)
Expand All @@ -75,7 +79,7 @@ test-no-coverage: ## Run all tests without coverage collection
$(RUN_TESTS) --no-coverage

# Individual test suite targets
test-api: ## Run only API tests (tests/unit/api_tests)
test-api: ## Run only API tests (tests/api_tests)
@echo "$(BOLD)$(BLUE)Running API tests...$(RESET)"
$(RUN_TESTS) --suite api_tests

Expand All @@ -96,9 +100,9 @@ test-functional: ## Run functional/end-to-end tests
$(RUN_TESTS) --suite functional


test-all-suites: ## Run all test suites including functional tests
@echo "$(BOLD)$(BLUE)Running all test suites including functional...$(RESET)"
$(RUN_TESTS)
test-all-suites: ## Run all test suites including functional tests (in parallel)
@echo "$(BOLD)$(BLUE)Running all test suites including functional in parallel...$(RESET)"
$(RUN_TESTS) --parallel

# Coverage targets
coverage-report: ## Show coverage report in terminal
Expand Down
40 changes: 4 additions & 36 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Install the project requirements and the pre-commit framework:

```bash
pip install -r requirements.txt
pip install pre-commit
```

## Setting up Pre-Commit Hooks
Expand Down Expand Up @@ -36,7 +35,7 @@ this command to view linting results:

PyReason uses a unified test runner that handles multiple test configurations automatically. The test suite is organized into four directories:

- **`tests/unit/api_tests/`** - Tests for main pyreason.py API functions (JIT enabled, real pyreason)
- **`tests/api_tests/`** - Tests for main pyreason.py API functions (JIT enabled, real pyreason)
- **`tests/unit/disable_jit/`** - Tests for internal interpretation logic (JIT disabled, stubbed environment)
- **`tests/unit/dont_disable_jit/`** - Tests for components that benefit from JIT (JIT enabled, lightweight stubs)
- **`tests/functional/`** - End-to-end functional tests (JIT enabled, real pyreason, longer running)
Expand All @@ -57,33 +56,12 @@ make test-fast
make coverage-html
```

### Individual Test Suites

```bash
# API tests (real pyreason, JIT enabled)
make test-api

# JIT disabled tests (stubbed environment)
make test-jit

# JIT enabled tests (lightweight stubs)
make test-no-jit

# Consistency tests
make test-consistency

# Functional/end-to-end tests
make test-functional
```

### Advanced Options

```bash
# Run with parallel execution where possible
make test-parallel
# Run with sequential execution
make make test-sequential

# Run without coverage collection (faster)
python run_tests.py --no-coverage

# Run specific suites
python run_tests.py --suite api_tests --suite dont_disable_jit
Expand All @@ -99,10 +77,7 @@ You can still run pytest directly on individual directories:

```bash
# API tests
pytest tests/unit/api_tests/ -v

# JIT disabled tests
NUMBA_DISABLE_JIT=1 pytest tests/unit/disable_jit/ -v
pytest tests/api_tests/ -v

# JIT enabled tests
pytest tests/unit/dont_disable_jit/ -v
Expand Down Expand Up @@ -138,10 +113,3 @@ pytest tests/functional/test_hello_world.py -v
# Clean up generated files
make clean
```

**Common Issues:**
- **Functional tests fail with warnings**: The pytest.ini has been updated to ignore expected warnings from numba and networkx
- **Tests time out**: Functional tests have longer timeouts (600s) and global timeout is disabled
- **Import errors**: Ensure pytest and dependencies are installed with `make install-deps`

Running tests locally before committing or pushing helps catch issues early and speeds up code review. The unified test runner ensures consistent behavior across different development environments.
100 changes: 0 additions & 100 deletions debug.py

This file was deleted.

Loading