Skip to content

Optimize test performance: collection fixtures, parallel execution, disable analyzers#71

Merged
antosubash merged 6 commits intomainfrom
claude/optimize-test-performance-fS8xN
Apr 4, 2026
Merged

Optimize test performance: collection fixtures, parallel execution, disable analyzers#71
antosubash merged 6 commits intomainfrom
claude/optimize-test-performance-fS8xN

Conversation

@antosubash
Copy link
Copy Markdown
Owner

  • Share one WebApplicationFactory per test assembly via collection fixtures
    instead of spinning up a separate factory per test class
  • Add test.runsettings with MaxCpuCount=0 for parallel assembly execution
  • Disable analyzers and Roslynator in test projects via Directory.Build.targets
  • Exclude Benchmarks project from dotnet test (IsTestProject=false)
  • Import root targets in modules/Directory.Build.targets for proper inheritance

claude added 6 commits April 4, 2026 06:15
…isable analyzers

- Share one WebApplicationFactory per test assembly via collection fixtures
  instead of spinning up a separate factory per test class
- Add test.runsettings with MaxCpuCount=0 for parallel assembly execution
- Disable analyzers and Roslynator in test projects via Directory.Build.targets
- Exclude Benchmarks project from dotnet test (IsTestProject=false)
- Import root targets in modules/Directory.Build.targets for proper inheritance
…down

The main loop passed stoppingToken to FlushBatchAsync. If StopAsync
cancelled the token mid-flush (during ToDictionaryAsync or SaveChangesAsync),
entries already consumed from the channel were lost. Use CancellationToken.None
for in-loop flushes, matching the drain path that already does this.
…llection fixtures

Reverts analyzer disabling (RunAnalyzers/EnforceCodeStyleInBuild) to maintain
code quality checks in test projects. Only removes Roslynator from test projects.
Adds CA1711 pragma suppression to IntegrationTestCollection files since the
'Collection' suffix is an xUnit naming convention.
…n name, move CA1711 to editorconfig

- Add EnsureTablesCreated<EmailDbContext> (was missing after ReplaceDbContext)
- Define TestCollections.Integration constant to replace raw "Integration" string
  in 36+ locations (prevents silent typo mismatches)
- Suppress CA1711 globally in .editorconfig instead of per-file pragmas
- Fix stale comment in Tests.Shared.csproj about linked compile
Cli.Tests spawns dotnet build on generated projects, taking ~15 minutes.
Exclude from default run (same as LoadTests/Benchmarks). Run explicitly:
  dotnet test tests/SimpleModule.Cli.Tests
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: cfc859d
Status: ✅  Deploy successful!
Preview URL: https://d12327af.simplemodule-website.pages.dev
Branch Preview URL: https://claude-optimize-test-perform.simplemodule-website.pages.dev

View logs

@antosubash antosubash merged commit 9a6a90c into main Apr 4, 2026
4 checks passed
@antosubash antosubash deleted the claude/optimize-test-performance-fS8xN branch April 4, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants