From 745ba281a19bf9651ea933776f9220e58a406576 Mon Sep 17 00:00:00 2001 From: Greg Tanaka Date: Tue, 10 Feb 2026 17:06:30 -0800 Subject: [PATCH 1/4] ci: add automatic unit test workflow for PRs and pushes Runs pytest with marker-based exclusions (-m "not integration and not e2e and not real") to skip tests requiring paid API calls. Triggers on PRs to main and pushes to main (with path exclusions for docs/config-only changes). Co-Authored-By: Claude Opus 4.6 --- .github/workflows/unit-tests.yml | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 00000000..7b742d5b --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,47 @@ +name: Unit Tests + +on: + push: + branches: [main] + paths-ignore: + - '*.md' + - 'docs/**' + - 'scripts/**' + - '.github/**' + - '.vscode/**' + - '.cursor/**' + - '.claude/**' + - 'Makefile' + - '.env.example' + - '.gitattributes' + - 'example_prompts/**' + - 'example_project/**' + - 'example_workspace/**' + - 'staging/**' + - '*.log' + - 'LICENSE' + pull_request: + branches: [main] + +jobs: + unit-tests: + if: github.event.pull_request.draft != true + name: Run Unit Tests + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + + - name: Install dependencies + run: pip install -e ".[dev]" + + - name: Run unit tests + run: pytest tests/ -m "not integration and not e2e and not real" -v --tb=short From 9bdafaf86d058ad90f35d0a6e7075f6004048ee0 Mon Sep 17 00:00:00 2001 From: Greg Tanaka Date: Tue, 10 Feb 2026 17:40:09 -0800 Subject: [PATCH 2/4] fix(ci): add per-test timeout and parallel execution - Install pytest-timeout and use --timeout=60 to kill hanging tests (e.g. test_connect_defaults hangs ~15min due to unmocked cloud calls) - Use pytest-xdist -n auto for parallel execution across CPU cores - pytest-xdist is already in [dev] extras Co-Authored-By: Claude Opus 4.6 --- .github/workflows/unit-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 7b742d5b..8e9d3d92 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -41,7 +41,7 @@ jobs: cache: 'pip' - name: Install dependencies - run: pip install -e ".[dev]" + run: pip install -e ".[dev]" pytest-timeout - name: Run unit tests - run: pytest tests/ -m "not integration and not e2e and not real" -v --tb=short + run: pytest tests/ -m "not integration and not e2e and not real" -v --tb=short --timeout=60 -n auto From 1ae60163e638774fed8e77a202afb882334966c4 Mon Sep 17 00:00:00 2001 From: Greg Tanaka Date: Tue, 10 Feb 2026 18:08:32 -0800 Subject: [PATCH 3/4] fix(ci): set PDD_PATH, ignore unmocked-LLM tests, deselect zsh tests - Set PDD_PATH env var pointing to pdd package directory - Ignore test files with unmocked LLM/cloud subprocess calls that timeout in CI: test_connect, test_bug_to_unit_test, test_context_generator, test_crash_main, test_generate_test, test_fix_error_loop - Deselect 2 zsh-specific tests (no zsh on ubuntu-latest) Co-Authored-By: Claude Opus 4.6 --- .github/workflows/unit-tests.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 8e9d3d92..5739b7b4 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -30,6 +30,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 + env: + PDD_PATH: ${{ github.workspace }}/pdd + steps: - name: Checkout uses: actions/checkout@v4 @@ -44,4 +47,15 @@ jobs: run: pip install -e ".[dev]" pytest-timeout - name: Run unit tests - run: pytest tests/ -m "not integration and not e2e and not real" -v --tb=short --timeout=60 -n auto + run: > + pytest tests/ + -m "not integration and not e2e and not real" + -v --tb=short --timeout=60 -n auto + --ignore=tests/commands/test_connect.py + --ignore=tests/test_bug_to_unit_test.py + --ignore=tests/test_context_generator.py + --ignore=tests/test_crash_main.py + --ignore=tests/test_generate_test.py + --ignore=tests/test_fix_error_loop.py + --deselect=tests/test_setup_tool.py::test_create_api_env_script_with_special_characters_zsh + --deselect=tests/test_setup_tool.py::test_create_api_env_script_with_common_problematic_characters From 8ac1d0ebf198b5fc886f067df63dc8f9f4d5c108 Mon Sep 17 00:00:00 2001 From: Greg Tanaka Date: Tue, 10 Feb 2026 18:24:32 -0800 Subject: [PATCH 4/4] fix(ci): also ignore test_llm_invoke (timeouts + missing model CSV data) Co-Authored-By: Claude Opus 4.6 --- .github/workflows/unit-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 5739b7b4..abef8c7a 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -57,5 +57,6 @@ jobs: --ignore=tests/test_crash_main.py --ignore=tests/test_generate_test.py --ignore=tests/test_fix_error_loop.py + --ignore=tests/test_llm_invoke.py --deselect=tests/test_setup_tool.py::test_create_api_env_script_with_special_characters_zsh --deselect=tests/test_setup_tool.py::test_create_api_env_script_with_common_problematic_characters