Repository navigation
feat(tests): enforce project boundaries with ArchUnitNET - #172
Merged
Merged
Conversation
Add ProjectReferenceBaseline and ProjectBoundaryTests. Each production assembly may not depend on a production assembly outside its frozen transitive project-reference closure. The rules exclude the coverage tracker namespace that Microsoft.CodeCoverage injects into instrumented assemblies. Update the matching Lode files. Co-Authored-By: Claude
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executive Summary
Architecture.Testsloaded only the Core assembly, so nothing stopped one production project from depending on another. This PR adds a frozen project-boundary baseline. Each production assembly may not depend on a production assembly outside its transitive project-reference closure.Code Changes
ProjectReferenceBaselineloads the five production assemblies by name.ProjectBoundaryTestsholds one rule per assembly. The allowed graph is a literal, not computed from the current graph.Architecture.Tests.csprojreferences all five production projects, including the executables Cli and Web.Microsoft.CodeCoverage.Instrumentation.Static.Trackernamespace. Coverage injects a type with one full name into every instrumented assembly. ArchUnitNET merged it and failed 3 rules underscripts/coverage.sh.architecture-testing.mdandterminology.mddescribe the new rules.Tests and Tooling
scripts/check.sh --all: shell lint, format, build (0 warnings), and tests all pass.ProjectBoundaryTests: 5 of 5 ran and passed. The other four Architecture test classes still pass.scripts/coverage.sh --filter "": passes with the tracker exclusion.Review Guide
ProjectBoundaryTests: Analyzers and Core have no production references, CodeFixers references Analyzers, Cli and Web reference Core.Architecture.Testsnow references executable projects.lode/dotnet/analyzers.mdin this commit saysDirectory.Build.propssetsAnalysisModeSecurity,AnalysisModeReliability, andAnalysisModePerformance. That edit toDirectory.Build.propsdid not ship, so fix the Lode text or add the properties before merge.Rollback
Revert the commit. No production code changed.
🤖 Generated with Claude Code