Skip to content

feat(testing): redesign testing architecture, resolve performance warnings, and update guide#1220

Open
cesarcastrocuba wants to merge 18 commits intofullstackhero:developfrom
cesarcastrocuba:pr/testing-architecture-redesign
Open

feat(testing): redesign testing architecture, resolve performance warnings, and update guide#1220
cesarcastrocuba wants to merge 18 commits intofullstackhero:developfrom
cesarcastrocuba:pr/testing-architecture-redesign

Conversation

@cesarcastrocuba
Copy link

This Pull Request introduces a comprehensive restructuring of the framework's testing system, moving toward a more scalable, decoupled architecture aligned with modern .NET best practices. Additionally, it addresses multiple critical performance warnings and synchronizes the development environment's testing guide.

Key Changes:

  1. Testing Architecture Redesign:

    • Transitioned from a monolithic test model to a specialized modular structure:
      • Architecture.Tests: Enforces layering and dependency rules.
      • Shared.Tests: Common infrastructure and container configuration.
      • Integration.Tests: Persistence and business logic (MediatR) testing without HTTP.
      • Functional.Tests: End-to-End vertical slices via HTTP.
      • Spec.Tests: BDD Acceptance specs using Gherkin.
    • Elimination of InMemoryDatabase: Switched to Testcontainers (PostgreSQL/Redis) to ensure environment parity and eliminate "it works on my machine" issues.
    • Mocking Standardization: Transitioned from Moq to NSubstitute for cleaner syntax and improved maintainability.
  2. Performance & Code Quality:

    • Logging Performance (CA1873): Wrapped expensive logging calls with _logger.IsEnabled(LogLevel.Information) guards across the Identity, Multitenancy, and Auditing modules. This prevents unnecessary allocations and string concatenations when the logging level is disabled.
    • Dependency Updates: Updated MimeKit/MailKit to resolve vulnerabilities and improved nullability handling in mail services.
  3. Documentation & Skills Synchronization:

    • Fully updated the testing guide in .claude/skills/testing-guide/SKILL.md.
    • Restored structural references for module-specific test projects (Identity, Multitenancy, Auditing, Generic) to ensure the AI assistant remains aware of the full test suite.
  4. Functional Verification Fixes:

    • Resolved Identity endpoint path mismatches.
    • Fixed TokenResponse typing issues that were causing JsonElement deserialization errors during functional test execution.

Verification Results:

  • Build Status: 0 Errors, 0 Critical Performance Warnings.
  • Test Execution: 465+ tests passing across all projects.
  • Process: The framework is now fully consistent with the Spec-Driven Design workflow.

César Castro and others added 18 commits March 14, 2026 22:14
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.

1 participant