Ralph cleanup#450
Conversation
…y and security concerns
…reorg Closes #448 - CRITICAL: ClearCommandAppFixture.DisposeAsync — null-safe App?.DisposeAsync() (unconditional call caused NullReferenceException in CI where App=null!) - Package upgrades in Directory.Packages.props: Auth0.AspNetCore.Authentication 1.8.0 → 1.9.0 Auth0.ManagementApi 8.6.0 → 9.0.0 MongoDB.Driver/Bson 3.9.0 → 3.10.0 NSubstitute 5.3.0 → 6.0.0 OpenTelemetry suite 1.16.0 → 1.17.0 Microsoft.NET.Test.Sdk 18.7.0 → 18.8.1 Microsoft.Extensions.Http.Resilience/ServiceDiscovery 10.7 → 10.8 - AppHost.cs: namespace AppHost (was MyBlog.AppHost); startup resource ordering - MongoDbResourceBuilderExtensions.cs: partial class, bodyless LoggerMessage methods - AppHost.Tests.csproj: RootNamespace=AppHost - Test files moved: Tests/Auth/, Tests/Layout/, Tests/Pages/ → Auth/, Layout/, Pages/ - Copyright headers: 10 files corrected IssueManager → MyBlog - AspireManager retry log corrected: '/3' → '/5' - Web.Tests.Bunit: NSubstitute 6 null-safe Arg.Is predicates + TestSender helper - Directory.Packages.props: trailing newline restored - decisions.md: Decision 5 (AppHost.Tests CI-Safety Pattern) - docs/build-log.txt: verification entries Build: 0 errors, 0 warnings Tests: 557/557 passed (61/61 AppHost.Tests on warm DCP) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t patterns - Documents ClearCommandAppFixture rules (no pre-warm, StopAsync before Dispose, WaitForResourceAsync inside retry boundary) - Documents BasePlaywrightTests.RetryOnNetworkChangedAsync pattern - Documents ThemeToggleTestRuntime trustworthy-state probe pattern - Corrects 'No Playwright project exists' claim — AppHost.Tests now ships E2E coverage Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🏗️ PR Added to Squad Triage QueueThis PR has been labeled with Next steps:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #450 +/- ##
=======================================
Coverage 76.78% 76.78%
=======================================
Files 71 71
Lines 1775 1775
Branches 214 214
=======================================
Hits 1363 1363
Misses 336 336
Partials 76 76 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR performs a broad “cleanup” pass across the solution: updating package/tooling versions, normalizing test namespaces/root namespaces, improving test determinism in bUnit by introducing a custom ISender test double, and hardening Aspire/Playwright test infrastructure against common transient failures.
Changes:
- Added
TestSenderand migrated several bUnit tests away from NSubstituteISendersetups to deterministic registrations (including sequential responses). - Normalized test project namespaces/root namespaces (Domain.Tests and AppHost.Tests) and corrected stale “IssueManager” header/doc references.
- Updated dependencies/tooling (NuGet packages, Aspire AppHost SDK, .NET SDK via global.json, markdownlint-cli2) and improved AppHost test reliability (timeouts/retry behaviors).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Web.Tests.Bunit/Testing/TestSender.cs | Adds deterministic MediatR test sender |
| tests/Web.Tests.Bunit/Features/ObjectIdWorkflowTests.cs | Null-safe predicates + sender adjustments |
| tests/Web.Tests.Bunit/Features/EditCategoryRegressionTests.cs | Swap to TestSender + registrations |
| tests/Web.Tests.Bunit/Features/EditAclTests.cs | Swap to TestSender + registrations |
| tests/Web.Tests.Bunit/Components/RazorSmokeTests.cs | Swap to TestSender + sequence registrations |
| tests/Domain.Tests/Entities/CategoryTests.cs | Namespace normalization |
| tests/Domain.Tests/Entities/BlogPostTests.cs | Namespace normalization |
| tests/Domain.Tests/Entities/BlogPostCategoryTests.cs | Namespace normalization |
| tests/Domain.Tests/Domain.Tests.csproj | RootNamespace change |
| tests/Domain.Tests/Behaviors/ValidationBehaviorTests.cs | Namespace normalization |
| tests/Domain.Tests/Abstractions/ResultTests.cs | Namespace normalization |
| tests/AppHost.Tests/WebPlaywrightTests.cs | Namespace/using/header corrections |
| tests/AppHost.Tests/Pages/NotFoundPageTests.cs | Namespace/using/header corrections |
| tests/AppHost.Tests/Pages/HomePageTests.cs | Namespace/using/header corrections |
| tests/AppHost.Tests/MongoShowStatsIntegrationTests.cs | Namespace/using corrections |
| tests/AppHost.Tests/MongoSeedDataIntegrationTests.cs | Timeout plumbing + minor wording fixes |
| tests/AppHost.Tests/MongoDbStatsCommandTests.cs | Namespace normalization |
| tests/AppHost.Tests/MongoDbSeedCommandTests.cs | Namespace normalization |
| tests/AppHost.Tests/MongoDbContainerConfigurationTests.cs | Namespace normalization |
| tests/AppHost.Tests/MongoDbClearCommandTests.cs | Namespace normalization |
| tests/AppHost.Tests/MongoClearDataIntegrationTests.cs | Namespace/using corrections |
| tests/AppHost.Tests/Layout/ThemeToggleTestRuntime.cs | Namespace normalization |
| tests/AppHost.Tests/Layout/ThemeToggleInteractionTests.cs | Namespace/using corrections |
| tests/AppHost.Tests/Layout/LayoutThemeToggleTests.cs | Namespace/using corrections |
| tests/AppHost.Tests/Layout/LayoutAuthenticatedTests.cs | Stronger assertion + header fixes |
| tests/AppHost.Tests/Layout/LayoutAnonymousTests.cs | Namespace/using/header corrections |
| tests/AppHost.Tests/Infrastructure/SkipInCITheoryAttribute.cs | Namespace normalization |
| tests/AppHost.Tests/Infrastructure/SkipInCIFactAttribute.cs | Namespace normalization |
| tests/AppHost.Tests/Infrastructure/PlaywrightManager.cs | Namespace normalization + header fixes |
| tests/AppHost.Tests/Infrastructure/MongoStatsIntegrationCollection.cs | Namespace normalization |
| tests/AppHost.Tests/Infrastructure/MongoSeedIntegrationCollection.cs | Namespace normalization |
| tests/AppHost.Tests/Infrastructure/MongoClearIntegrationCollection.cs | Namespace normalization |
| tests/AppHost.Tests/Infrastructure/ClearCommandAppFixture.cs | Retry/cleanup behavior adjustments |
| tests/AppHost.Tests/Infrastructure/AspireManager.cs | Retry tuning + timeout adjustments |
| tests/AppHost.Tests/Infrastructure/AppHostTestCollection.cs | Namespace normalization + header fixes |
| tests/AppHost.Tests/EnvVarTests.cs | Namespace normalization + header fixes |
| tests/AppHost.Tests/BasePlaywrightTests.cs | Add retry wrapper + HttpClient timeout tweak |
| tests/AppHost.Tests/Auth/LoginFallbackTests.cs | Namespace/using corrections |
| tests/AppHost.Tests/AppHostStartupSmokeTests.cs | HttpClient timeout set before polling |
| tests/AppHost.Tests/AppHost.Tests.csproj | RootNamespace added |
| src/Web/package-lock.json | markdownlint-cli2 bump |
| src/AppHost/MongoDbResourceBuilderExtensions.cs | Namespace change + comment punctuation tweak |
| src/AppHost/AppHost.csproj | Aspire AppHost SDK version bump |
| src/AppHost/AppHost.cs | Reference/wait ordering adjustments |
| global.json | .NET SDK patch bump |
| docs/build-log.txt | Adds build repair/verification log entry |
| Directory.Packages.props | Dependency updates (Auth0/MongoDB/OTel/etc.) |
| .squad/skills/webapp-testing/SKILL.md | Updates testing-skill content (but still inconsistent) |
| .squad/log/20260417-092921-transactions-concurrency.md | Markdown spacing cleanup |
| .squad/decisions/inbox/boromir-release-board-selection.md | Removes inbox decision file |
| .squad/decisions/decisions.md | Markdown formatting cleanup |
| .squad/decisions.md | Adds “Decision 5” CI-safety pattern doc |
| .squad/agents/ralph/history.md | Trailing whitespace cleanup |
| .squad/agents/legolas/history.md | Adds blank line for readability |
| .github/workflows/squad-dependabot-auto-merge.yml | Adds retry for transient auto-merge enable failures |
| .github/workflows/project-board-automation.yml | Token fallback expression added |
| .github/agents/squad.agent.md | Minor formatting (blank line) |
| - `tests/Unit.Tests/Features/UserManagement/ProfileTests.cs` — Profile component claim assertions | ||
| - bUnit tests use `BunitContext` (base class from bUnit; test-specific helpers in `TestAuthorizationService.cs`) | ||
|
|
||
| - **No** Playwright or dedicated browser-test project exists today. |
Automated squad workflow PR