Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,24 @@ jobs:
bandit-free.json
pip-audit-report.json

# ---------------------------------------------------------------------------
# Structural guardrail — root tests/ and src/ must not exist
# ---------------------------------------------------------------------------
check-test-structure:
name: Verify test directory structure
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v6
- name: Fail if root tests/ or src/ exist
run: |
if [ -d "tests/" ] || [ -d "src/" ]; then
echo "ERROR: root tests/ or src/ must not exist."
echo "Use packages/parser-core/tests/ for all tests."
exit 1
fi
echo "OK: root tests/ and src/ are absent."

# ---------------------------------------------------------------------------
# Test jobs (serial after their respective lint job)
# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -430,7 +448,7 @@ jobs:
name: CI Pass
runs-on: ubuntu-latest
if: always()
needs: [changes, lint-core, lint-free, security, test-core, test-free, build-docker, workflow-lint]
needs: [changes, lint-core, lint-free, security, test-core, test-free, build-docker, workflow-lint, check-test-structure]
steps:
- name: Check all jobs passed
run: |
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,6 @@ docker-compose.override.yml
marketplace/
.myob/

# Root-level legacy artefacts (old pre-restructure layout — not part of monorepo)
# Old flat src/ — replaced by packages/parser-core/src/ and packages/parser-free/src/
/src/
# Old root-level tests — replaced by packages/*/tests/
/tests/
/license.json
# Docker env files (private repo only)
/.env.remote
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ setup: ## Full development environment setup

# Testing
test: ## Run all tests with coverage
python3 -m pytest tests/ -v --cov=src --cov-report=term-missing --cov-report=xml --cov-report=html --cov-fail-under=90
python3 -m pytest packages/parser-core/tests/ -v --cov=bankstatements_core --cov-report=term-missing --cov-report=xml --cov-report=html --cov-fail-under=91

test-unit: ## Run only unit tests
python3 -m pytest tests/ -v -m "unit" --cov=src --cov-report=term-missing
python3 -m pytest packages/parser-core/tests/ -v -m "unit" --cov=bankstatements_core --cov-report=term-missing

test-integration: ## Run only integration tests
python3 -m pytest tests/ -v -m "integration" --cov=src --cov-report=term-missing
python3 -m pytest packages/parser-core/tests/ -v -m "integration" --cov=bankstatements_core --cov-report=term-missing

test-fast: ## Run tests in parallel (faster)
python3 -m pytest tests/ -v -n auto --cov=src --cov-report=term-missing
python3 -m pytest packages/parser-core/tests/ -v -n auto --cov=bankstatements_core --cov-report=term-missing

test-watch: ## Run tests in watch mode (re-run on file changes)
python3 -m ptw -- tests/ -v --cov=src
python3 -m ptw -- packages/parser-core/tests/ -v --cov=bankstatements_core

coverage: ## Generate and open coverage report
python3 -m pytest tests/ --cov=src --cov-report=html --cov-fail-under=90
python3 -m pytest packages/parser-core/tests/ --cov=bankstatements_core --cov-report=html --cov-fail-under=91
@echo "Opening coverage report in browser..."
@python3 -c "import webbrowser; webbrowser.open('htmlcov/index.html')"

Expand Down Expand Up @@ -288,7 +288,7 @@ ci-lint: ## Simulate CI linting job locally

ci-test: ## Simulate CI test job locally
@echo "🤖 Simulating CI test job..."
python3 -m pytest tests/ -v --cov=src --cov-report=term-missing --cov-report=xml --cov-report=html -n auto --tb=short
python3 -m pytest packages/parser-core/tests/ -v --cov=bankstatements_core --cov-report=term-missing --cov-report=xml --cov-report=html --cov-fail-under=91 -n auto --tb=short
@echo "✅ CI test simulation completed"

ci-docker: ## Simulate CI Docker job locally
Expand Down
Loading