🐛 fix(test): 修复后端测试环境与跨平台隔离

This commit is contained in:
mango
2026-07-27 19:05:06 +08:00
parent 0e06c74b54
commit 5a16c2b201
18 changed files with 209 additions and 49 deletions

75
.github/workflows/backend-tests.yml vendored Normal file
View File

@@ -0,0 +1,75 @@
name: Backend Tests
on:
pull_request:
branches:
- dev
push:
branches:
- dev
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
full:
name: Full backend suite
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
- name: Run backend tests
run: go test ./... -count=1 -timeout=30m
platform-sensitive:
name: Platform-sensitive tests (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
- name: Test AI file errors
run: go test ./internal/ai/service -run '^(TestMCPClientInstallConfigIOFailuresUseServiceLanguage|TestAISaveSessionUsesCurrentLanguageForStructuredErrors)$' -count=1
- name: Test Claude CLI timing
run: go test ./internal/ai/provider -run '^TestClaudeCLIProvider_(ChatStreamUsesRequestTimeoutWhenNoMeaningfulResponseArrives|ChatStreamAllowsDelayedMeaningfulResponse)$' -count=1
- name: Test JVM fixtures
run: go test ./internal/jvm -run '^(TestAgentProviderRealAgentRoundTrip|TestHTTPProviderRealEndpointRoundTrip|TestJMXProviderRealJMXRoundTrip)$' -count=1 -timeout=5m
- name: Test optional driver-agent cleanup
run: go test ./internal/db -run '^TestOptionalDriverAgentUnresponsiveProcessIsReapedAfterTimeout$' -count=1