Skip to content

fix: Add automated end-to-end testing using playground in CI/CD workflows#49

Open
mfogliatto wants to merge 5 commits into
mainfrom
fix/issue-43
Open

fix: Add automated end-to-end testing using playground in CI/CD workflows#49
mfogliatto wants to merge 5 commits into
mainfrom
fix/issue-43

Conversation

@mfogliatto
Copy link
Copy Markdown
Owner

Summary

Adds automated end-to-end testing that validates ReferenceCop rule detection using the existing playground infrastructure, integrated into both PR and official build CI/CD workflows.

Changes

  • playground/Run-E2ETests.ps1 — PowerShell test runner that exercises all three rule types plus a valid-build scenario
  • playground/TestProject/InternalLib/ — Test fixture for ProjectPath rule validation
  • playground/TestProject/ToolsProject/ — Test fixture for ProjectTag rule validation
  • playground/TestProject/ValidApp/ — Test fixture for valid (no-violation) scenario
  • .github/workflows/pr-build.yaml — Added e2e test step after unit tests
  • .github/workflows/official-build.yaml — Added e2e test step after unit tests
  • playground/TEST-SCENARIOS.md — Documents all test scenarios
  • playground/playground.slnx — Updated to include new projects

Testing

The test runner validates:

  1. AssemblyName rule: SampleLibrary referencing Newtonsoft.Json triggers violation
  2. ProjectPath rule: SampleApp referencing InternalLib triggers violation
  3. ProjectTag rule: App-tagged project referencing Tools-tagged project triggers warning
  4. Valid build: ValidApp with no violations builds successfully

Run locally: ./playground/Run-E2ETests.ps1 -PackFirst

Fixes #43

Adds a PowerShell test runner (Run-E2ETests.ps1) that validates all three
ReferenceCop rule types (AssemblyName, ProjectTag, ProjectPath) plus a
valid-build scenario. Integrates into both PR and official build workflows.

New test projects: InternalLib, ToolsProject, ValidApp provide test fixtures
for the ProjectPath, ProjectTag, and valid-build scenarios respectively.

Fixes #43
In .NET 8, System.Web.HttpUtility is a legitimate shared framework
assembly. The wildcard pattern System.Web* incorrectly flags it in
ValidApp which has no actual System.Web dependency.
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.

Add automated end-to-end testing using playground in CI/CD workflows

1 participant