Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

test(defaults): add MSBuild evaluation test coverage for NetEvolve.Defaults - #477

#477
Merged
samtrion merged 3 commits into
maindailydevops/defaults:mainfrom
test/msbuild-defaults-propsdailydevops/defaults:test/msbuild-defaults-propsCopy head branch name to clipboard
Jul 22, 2026
Merged

test(defaults): add MSBuild evaluation test coverage for NetEvolve.Defaults#477
samtrion merged 3 commits into
maindailydevops/defaults:mainfrom
test/msbuild-defaults-propsdailydevops/defaults:test/msbuild-defaults-propsCopy head branch name to clipboard

Conversation

@samtrion

Copy link
Copy Markdown
Contributor

Summary

  • Add NetEvolve.Defaults.Tests.Unit, a TUnit project that evaluates the props/targets under src/NetEvolve.Defaults via the MSBuild API (Microsoft.Build.Evaluation.Project) rather than running a full build. Covers project categorization (IsTestableProject, IsXampleProject), the CI-detection precedence chain across ~15 CI systems plus branch/PR-ref resolution, NoWarn/severity matrices, and the remaining Support*.props/.targets files — including edge cases beyond the happy path.
  • Add Microsoft.Build and Microsoft.Build.Locator package versions to Directory.Packages.props (new entries only).
  • Remove NetEvolve.Defaults.Tests.Integration — superseded by the new coverage; it only contained a single placeholder "always true" test.

Bugs found (flagged, not fixed here)

  • src/NetEvolve.Defaults/buildMultiTargeting/SupportNuGetAudit.targets:6WarningsAsErrors is appended as (WarningsAsErrors);NU1900;... missing the leading $, so the literal text "(WarningsAsErrors)" replaces any prior $(WarningsAsErrors) value instead of preserving it. Covered by SupportNuGetAuditTests.Release_WarningsAsErrors_ObservedBehaviorDiffersFromDocumentedIntent_LiteralParenthesesTokenInsteadOfPriorValue, which asserts the current (buggy) behavior.
  • SupportAdditionalFiles.targetsIsCrossTargetingProject has no unconditioned default, so it evaluates to "" rather than "false" when TargetFrameworks is unset (minor, likely harmless). Covered by SupportAdditionalFilesTests.TargetFrameworksNotSet_IsCrossTargetingProject_ObservedBehaviorDiffersFromDocumentedIntent_StaysEmptyNotFalse.

Test plan

  • dotnet build — clean
  • dotnet test in tests/NetEvolve.Defaults.Tests.Unit — 86/86 passed
  • git status confirms nothing under src/ was modified

🤖 Generated with Claude Code

https://claude.ai/code/session_013cR8rWVwvVY2bfM4QyKvtw

@samtrion
samtrion requested a review from a team as a code owner July 22, 2026 18:00
@samtrion
samtrion requested review from Spacemonkay and removed request for a team July 22, 2026 18:00
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • state:ready for merge

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40ed1b56-a8b5-429c-9395-efbcae2b560e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

samtrion and others added 2 commits July 22, 2026 20:08
…faults

Add a NetEvolve.Defaults.Tests.Unit TUnit project that evaluates the
props/targets under src/NetEvolve.Defaults via the MSBuild API instead of
running a full build. Covers project categorization (IsTestableProject,
IsXampleProject), the CI-detection precedence chain across ~15 CI systems
and branch/PR-ref resolution, NoWarn/severity matrices, and the remaining
Support*.props/.targets files, including edge cases beyond the happy path.

Add Microsoft.Build and Microsoft.Build.Locator package versions to
Directory.Packages.props to support MSBuild-API-based evaluation tests.

chore(tests): remove NetEvolve.Defaults.Tests.Integration

Superseded by the new unit test coverage; it only contained a single
placeholder "always true" test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013cR8rWVwvVY2bfM4QyKvtw
…onfig

SupportNuGetAudit.targets appended the audit warning codes with a missing
'$' before "(WarningsAsErrors)", so the literal text replaced any
pre-existing WarningsAsErrors value instead of preserving and appending
to it.

Also give IsCrossTargetingProject an explicit "false" default in
SupportAdditionalFiles.targets, consistent with IsTestableProject/
IsXampleProject in SupportGeneral.props, instead of evaluating to an
empty string when TargetFrameworks is unset.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013cR8rWVwvVY2bfM4QyKvtw
@samtrion
samtrion force-pushed the test/msbuild-defaults-props branch from 1bb0eab to 5b9852d Compare July 22, 2026 18:08
MSBuildProjectFixture only overrode the CI/branch-detection variables
that a given test cared about, so any variable it didn't set fell back
to the real process environment. On an actual GitHub Actions PR runner
this leaked GITHUB_ACTIONS/GITHUB_REF/etc. into every evaluation,
making several SupportDetectContinuousIntegration tests pass locally
but fail in CI. Neutralize the full set of known CI-detection
variables to empty by default, overridable per test via globalProperties.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013cR8rWVwvVY2bfM4QyKvtw
@samtrion
samtrion merged commit f5a4914 into main Jul 22, 2026
12 checks passed
@samtrion
samtrion deleted the test/msbuild-defaults-props branch July 22, 2026 18:18
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (42c8f69) to head (4c74736).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #477   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           16        16           
  Branches         1         1           
=========================================
  Hits            16        16           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.