Skip to content

Add playground environment for end-to-end testing#44

Merged
mfogliatto merged 1 commit intomainfrom
optimize-fix-detectors
Dec 20, 2025
Merged

Add playground environment for end-to-end testing#44
mfogliatto merged 1 commit intomainfrom
optimize-fix-detectors

Conversation

@mfogliatto
Copy link
Copy Markdown
Owner

@mfogliatto mfogliatto commented Dec 20, 2025

Description

This PR adds a self-contained playground environment for end-to-end testing of ReferenceCop changes during development.

The playground provides a fast inner-loop workflow where developers can:

  • Build the ReferenceCop package
  • Test it against sample projects with various rule configurations
  • Validate changes end-to-end without impacting the main solution

Key features:

  • Offline dev feed: NuGet config points directly to package build output (../../src/ReferenceCop.Package/bin/Debug)
  • Automatic version detection: Package version is written to package-version.txt during pack and automatically read by Directory.Build.props
  • Centralized package reference: ReferenceCop referenced via Directory.Build.props for all playground projects
  • Example configurations: Includes all three rule types (AssemblyName, ProjectTag, ProjectPath) in ReferenceCop.config

Type of change

  • Enhancement (e.g. new feature, functional improvement, etc.)
  • Bug fix
  • Chore (e.g. refactoring, documentation, etc.)

Related Issue

Related to #43 - This playground environment serves as preparation for automated E2E testing in CI/CD workflows

How Has This Been Tested?

  • Manually tested the workflow:
    1. Built ReferenceCop package: dotnet pack -c Debug in src/ReferenceCop.Package
    2. Restored playground project: dotnet restore in playground/TestProject/SampleApp
    3. Built playground: dotnet build in playground/TestProject/SampleApp
  • Verified that violations are detected:
    • SampleLibrary includes Newtonsoft.Json reference which triggers the "NoNewtonsoftJson" warning rule
    • Build output shows expected diagnostic message

Screenshots (if applicable)

N/A

Additional context

Structure:

  • playground/ - Root directory
    • TestProject/ - Sample projects
      • SampleApp/ - Console app (ProjectTag: App)
      • SampleLibrary/ - Class library (ProjectTag: Library, includes Newtonsoft.Json)
      • Directory.Build.props - Centralized ReferenceCop package reference with auto-version
      • ReferenceCop.config - Example rules for all three rule types
      • nuget.config - Offline feed configuration
    • README.md - Complete workflow documentation

Workflow:

  1. Make changes to ReferenceCop source
  2. Build package: cd src\ReferenceCop.Package; dotnet pack -c Debug
  3. Test: cd playground\TestProject\SampleApp; dotnet restore; dotnet build

- Created playground directory with sample projects (SampleApp, SampleLibrary)
- Configured offline dev feed pointing to package build output
- Automatic version detection via package-version.txt
- ReferenceCop.config with examples of all rule types
- Directory.Build.props for centralized package reference
- Proper ReferenceCop setup per project README requirements
- Added Newtonsoft.Json reference to test violation detection
- Updated .gitignore to exclude auto-generated files
@mfogliatto mfogliatto merged commit d01144e into main Dec 20, 2025
2 checks passed
@mfogliatto mfogliatto deleted the optimize-fix-detectors branch December 20, 2025 08:30
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