Skip to content

Commit acdb99b

Browse files
committed
Add DbWriter mutation testing for #1669
1 parent 8606923 commit acdb99b

4 files changed

Lines changed: 81 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Mutation testing
2+
3+
on:
4+
schedule:
5+
- cron: "17 3 * * 1"
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
dbwriter:
13+
name: DbWriter mutation testing
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 60
16+
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up .NET
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: |
25+
8.0.x
26+
9.0.x
27+
28+
- name: Restore
29+
run: dotnet restore CodeIndex.sln --locked-mode
30+
31+
- name: Install Stryker.NET
32+
run: dotnet tool install --global dotnet-stryker
33+
34+
- name: Run DbWriter mutation tests
35+
run: dotnet stryker --config-file stryker-config.json

DEVELOPER_GUIDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ failures from pass-on-retry flakes. For test suite structure, shared helpers,
3939
state-isolation rules, timeout diagnostics, and test-writing conventions, see
4040
[TESTING_GUIDE.md](TESTING_GUIDE.md).
4141

42+
The weekly `Mutation testing` workflow runs Stryker.NET against
43+
`src/CodeIndex/Database/DbWriter.cs` using `stryker-config.json`. Keep this
44+
scope focused on transaction, savepoint, rollback, and batch-write behavior
45+
unless the runtime budget is intentionally expanded. The mutation score gates
46+
are high 75, low 70, and break 65 so changes that weaken rollback or savepoint
47+
coverage fail outside the regular PR test path.
48+
4249
## CI / Artifact Distribution
4350

4451
Query commands accept `--read-only` (alias `--immutable`) to open an existing
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
category: internal
3+
issues:
4+
- 1669
5+
affected:
6+
- stryker-config.json
7+
- .github/workflows/mutation-testing.yml
8+
- DEVELOPER_GUIDE.md
9+
---
10+
11+
## English
12+
13+
- **Added weekly DbWriter mutation testing (#1669)** — Stryker.NET now runs against the DbWriter transaction and rollback surface on a scheduled workflow with documented score gates.
14+
15+
## 日本語
16+
17+
- **DbWriter の週次 mutation testing を追加しました (#1669)** — Stryker.NET が DbWriter の transaction / rollback 周辺を定期 workflow で検査し、score gate も文書化されました。

stryker-config.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"stryker-config": {
3+
"solution": "CodeIndex.sln",
4+
"project": "src/CodeIndex/CodeIndex.csproj",
5+
"test-projects": [
6+
"tests/CodeIndex.Tests/CodeIndex.Tests.csproj"
7+
],
8+
"mutate": [
9+
"src/CodeIndex/Database/DbWriter.cs"
10+
],
11+
"thresholds": {
12+
"high": 75,
13+
"low": 70,
14+
"break": 65
15+
},
16+
"reporters": [
17+
"progress",
18+
"cleartext",
19+
"html"
20+
]
21+
}
22+
}

0 commit comments

Comments
 (0)