Skip to content

Comments

chore: centralize environment variable constants (#4882)#4909

Merged
thomhurst merged 1 commit intomainfrom
chore/environment-constants
Feb 19, 2026
Merged

chore: centralize environment variable constants (#4882)#4909
thomhurst merged 1 commit intomainfrom
chore/environment-constants

Conversation

@thomhurst
Copy link
Owner

Summary

  • Introduces TUnit.Engine/Configuration/EnvironmentConstants.cs containing all environment variable names used across the engine as const string fields
  • Replaces 15 scattered magic string literals in 7 files with references to the new constants class
  • Groups constants by purpose: reporters, execution, display/diagnostics, JUnit output, legacy/deprecated, and external CI variables

Closes #4882

Test plan

  • dotnet build TUnit.Engine/TUnit.Engine.csproj passes across all target frameworks (net8.0, net9.0, net10.0, netstandard2.0) with zero warnings and zero errors
  • Verify no behavioral changes — all constants map to the exact same string values as before
  • Confirm CI passes end-to-end

Replace scattered environment variable magic strings across TUnit.Engine
with references to a new EnvironmentConstants class, improving
maintainability and discoverability.
@claude
Copy link
Contributor

claude bot commented Feb 19, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

This is a clean, well-executed refactoring. All 15 environment variable constants map exactly to their original string literals, and the new EnvironmentConstants class is appropriately scoped as internal static. The PR improves maintainability by eliminating magic strings scattered across 7 files without introducing any behavioral changes.

@thomhurst thomhurst merged commit 23e3500 into main Feb 19, 2026
13 of 14 checks passed
@thomhurst thomhurst deleted the chore/environment-constants branch February 19, 2026 01:06
This was referenced Feb 22, 2026
This was referenced Feb 23, 2026
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.

chore: centralize environment variable magic strings

1 participant