Skip to content

Commit b27e12f

Browse files
committed
simplify: integration test filtering
- docs-only: skip entire integration job (job-level if) - browser-only: skip IPC tests, run other integration tests (tests/runtime) - otherwise: run all integration tests (tests/ipc tests/runtime) Backend filter uses tests/** with !tests/e2e/** exclusion, so new test directories are automatically included.
1 parent e509e3f commit b27e12f

File tree

1 file changed

+17
-40
lines changed

1 file changed

+17
-40
lines changed

.github/workflows/pr.yml

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
outputs:
2424
docs-only: ${{ steps.filter.outputs.docs == 'true' && steps.filter.outputs.src == 'false' && steps.filter.outputs.config == 'false' }}
25-
config: ${{ steps.filter.outputs.config }}
26-
ipc: ${{ steps.filter.outputs.ipc }}
27-
runtime: ${{ steps.filter.outputs.runtime }}
25+
browser-only: ${{ steps.filter.outputs.browser == 'true' && steps.filter.outputs.backend == 'false' && steps.filter.outputs.config == 'false' }}
2826
steps:
2927
- uses: actions/checkout@v4
3028
- uses: dorny/paths-filter@v3
@@ -40,21 +38,18 @@ jobs:
4038
- 'src/**'
4139
- 'tests/**'
4240
- 'vscode/**'
43-
# IPC tests: backend services, ORPC, config, common types
44-
ipc:
45-
- 'src/node/services/**'
46-
- 'src/node/orpc/**'
47-
- 'src/node/config/**'
48-
- 'src/node/git/**'
49-
- 'src/node/utils/**'
50-
- 'src/common/**'
41+
browser:
42+
- 'src/browser/**'
43+
- 'src/styles/**'
44+
- '**/*.stories.tsx'
45+
- '.storybook/**'
46+
backend:
47+
- 'src/node/**'
5148
- 'src/cli/**'
5249
- 'src/desktop/**'
53-
- 'tests/ipc/**'
54-
# Runtime tests: runtime implementations (SSH, worktree)
55-
runtime:
56-
- 'src/node/runtime/**'
57-
- 'tests/runtime/**'
50+
- 'src/common/**'
51+
- 'tests/**'
52+
- '!tests/e2e/**'
5853
config:
5954
- '.github/**'
6055
- 'jest.config.cjs'
@@ -133,38 +128,20 @@ jobs:
133128
exit 0
134129
fi
135130
136-
# Config changes = run everything
137-
if [[ "${{ needs.changes.outputs.config }}" == "true" ]]; then
138-
echo "filter=tests/ipc tests/runtime" >> $GITHUB_OUTPUT
131+
# Browser-only PRs skip IPC tests but run other integration tests
132+
if [[ "${{ needs.changes.outputs.browser-only }}" == "true" ]]; then
133+
echo "Browser-only PR - skipping IPC tests"
134+
echo "filter=tests/runtime" >> $GITHUB_OUTPUT
139135
exit 0
140136
fi
141137
142-
# Build filter from changed paths
143-
paths=""
144-
if [[ "${{ needs.changes.outputs.ipc }}" == "true" ]]; then
145-
paths="$paths tests/ipc"
146-
fi
147-
if [[ "${{ needs.changes.outputs.runtime }}" == "true" ]]; then
148-
paths="$paths tests/runtime"
149-
fi
150-
paths=$(echo $paths | xargs) # trim whitespace
151-
152-
if [[ -z "$paths" ]]; then
153-
echo "No integration tests needed for changed paths"
154-
echo "filter=" >> $GITHUB_OUTPUT
155-
else
156-
echo "Running: $paths"
157-
echo "filter=$paths" >> $GITHUB_OUTPUT
158-
fi
138+
# Run all integration tests
139+
echo "filter=tests/ipc tests/runtime" >> $GITHUB_OUTPUT
159140
- name: Run integration tests
160-
if: ${{ steps.test-filter.outputs.filter != '' }}
161141
run: TEST_INTEGRATION=1 bun x jest --coverage --maxWorkers=100% --silent ${{ steps.test-filter.outputs.filter }}
162142
env:
163143
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
164144
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
165-
- name: Skip integration tests
166-
if: ${{ steps.test-filter.outputs.filter == '' }}
167-
run: echo "Skipping integration tests - no relevant paths changed"
168145
- uses: codecov/codecov-action@v5
169146
if: ${{ steps.test-filter.outputs.filter != '' }}
170147
with:

0 commit comments

Comments
 (0)