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
13 changes: 13 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-stryker": {
"version": "4.16.0",
"commands": [
"dotnet-stryker"
],
"rollForward": false
}
}
}
60 changes: 60 additions & 0 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Mutation Testing

on:
pull_request:
branches: [main]
schedule:
- cron: "0 6 * * *"

env:
DOTNET_ROLL_FORWARD: Major

permissions:
contents: read

jobs:
mutation:
name: Mutation (${{ matrix.project }})
runs-on: ubuntu-latest
timeout-minutes: 45

strategy:
fail-fast: false
matrix:
project: [domain, application, infrastructure]

steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: "10.0.x"

- name: Restore
run: dotnet restore

- name: Restore local tools
run: dotnet tool restore

- name: Run Stryker (PR — changed in-scope files only)
if: github.event_name == 'pull_request'
run: |
git fetch origin main
dotnet stryker -f stryker-config.${{ matrix.project }}.json --since:origin/main

- name: Run Stryker (nightly — full in-scope)
if: github.event_name == 'schedule'
run: dotnet stryker -f stryker-config.${{ matrix.project }}.json --concurrency 2

- name: Upload mutation report
if: always()
uses: actions/upload-artifact@v7
with:
name: mutation-report-${{ github.event_name }}-${{ matrix.project }}
path: |
StrykerOutput/**/reports/*.html
StrykerOutput/**/reports/*.json
if-no-files-found: ignore
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
## Build Results
[Bb]in/
[Oo]bj/
.config/
.config/*
!.config/dotnet-tools.json
.fake/

## JetBrains / Rider
Expand Down Expand Up @@ -31,6 +32,9 @@
TestResults/
*.trhx

## Mutation testing (Stryker)
StrykerOutput/

## Environment Variables & Secrets (CRÍTICO PARA SEU PROJETO)
.env
appsettings.Development.json
Expand All @@ -49,7 +53,7 @@ Desktop.ini

## Docker / Caddy
caddy_data/
caddy_config/.claude/worktrees/
caddy_config/

## Claude Code worktrees
.claude/worktrees/
22 changes: 22 additions & 0 deletions stryker-config.application.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"stryker-config": {
"project": "Orbit.Application.csproj",
"test-projects": ["tests/Orbit.Application.Tests/Orbit.Application.Tests.csproj"],
"mutate": [
"**/Subscriptions/Commands/VerifyPlayPurchaseCommand.cs",
"**/Subscriptions/Commands/HandlePlayNotificationCommand.cs",
"**/Subscriptions/Services/PlayReferralCouponConsumer.cs",
"**/Common/PlaySubscriptionStateExtensions.cs",
"**/Common/SubscriptionSourceExtensions.cs",
"**/Auth/Commands/*.cs",
"**/Habits/Services/HabitScheduleService.cs"
],
"mutation-level": "Standard",
"reporters": ["cleartext", "html", "json"],
"thresholds": {
"high": 80,
"low": 60,
"break": 0
}
}
}
19 changes: 19 additions & 0 deletions stryker-config.domain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"stryker-config": {
"project": "Orbit.Domain.csproj",
"test-projects": ["tests/Orbit.Domain.Tests/Orbit.Domain.Tests.csproj"],
"mutate": [
"**/Entities/Habit.cs",
"**/Entities/HabitInvariants.cs",
"**/Entities/User.cs",
"**/Entities/StreakFreeze.cs"
],
"mutation-level": "Standard",
"reporters": ["cleartext", "html", "json"],
"thresholds": {
"high": 80,
"low": 60,
"break": 0
}
}
}
24 changes: 24 additions & 0 deletions stryker-config.infrastructure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"stryker-config": {
"project": "Orbit.Infrastructure.csproj",
"test-projects": ["tests/Orbit.Infrastructure.Tests/Orbit.Infrastructure.Tests.csproj"],
"mutate": [
"**/Services/JwtTokenService.cs",
"**/Services/AuthSessionService.cs",
"**/Services/UserStreakService.cs",
"**/Services/HabitDueDateAdvancementService.cs",
"!**/Services/GooglePlayBillingService.cs",
"!**/Services/GoogleTokenService.cs",
"!**/Services/GooglePlayPushTokenValidator.cs",
"!**/Services/UserDateService.cs",
"!**/Services/StreakFreezeAutoActivationService.cs"
],
"mutation-level": "Standard",
"reporters": ["cleartext", "html", "json"],
"thresholds": {
"high": 80,
"low": 60,
"break": 0
}
}
}
Empty file.
Loading