Skip to content

Add test authoring guidance for Helix compatibility and TFM properties#55388

Merged
MichaelSimons merged 1 commit into
mainfrom
michaelsimons-helix-test-authoring-guidance
Jul 23, 2026
Merged

Add test authoring guidance for Helix compatibility and TFM properties#55388
MichaelSimons merged 1 commit into
mainfrom
michaelsimons-helix-test-authoring-guidance

Conversation

@MichaelSimons

@MichaelSimons MichaelSimons commented Jul 20, 2026

Copy link
Copy Markdown
Member

Adds AI agent instructions for writing tests that work in both local and Helix CI environments, and documents the correct target framework properties to use across the repo. These gaps were self-identified by Copilot while authoring a new test project in #55166 (conditional test filtering), where multiple iterations were needed to achieve Helix compatibility.

Changes

.github/copilot-instructions.md

  • Added "Target framework properties" table to Coding Style: $(SdkTargetFramework) for .NET, .NET Framework multi-targeting guidance, and $(CurrentTargetFramework) for test assets

test/AGENTS.md

  • Added test authoring conventions: derive from SdkTest, use SdkTestContext.Current for paths, test asset placement
  • Added Helix deployment section: TestExecutionDirectoryFiles in UnitTests.proj, when to validate locally

Copilot AI review requested due to automatic review settings July 20, 2026 22:24
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates contributor/agent-facing guidance to help authors write tests and test assets that behave consistently both locally and in Helix CI, and to standardize how target frameworks are specified across the repo.

Changes:

  • Documented recommended test base classes and path-resolution APIs (SdkTest, SdkTestContext.Current) to avoid relying on local repo layout assumptions.
  • Added Helix deployment guidance for including extra runtime files via TestExecutionDirectoryFiles in test/UnitTests.proj.
  • Documented the correct MSBuild properties to use for TFMs in source/test projects vs. test assets ($(SdkTargetFramework) vs. $(CurrentTargetFramework)).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/AGENTS.md Adds test authoring conventions and Helix payload deployment guidance to prevent path/layout issues in Helix.
.github/copilot-instructions.md Documents the repo’s intended TFM property usage to avoid hardcoding TFMs and to align test assets with TestAssetsManager substitutions.

test/AGENTS.md:
- Add SdkTest, SdkTestContext, and test asset placement to Conventions
- Add Helix deployment section for TestExecutionDirectoryFiles and
  when to validate in a simulated Helix layout

.github/copilot-instructions.md:
- Add Target framework properties table to Coding Style covering
  SdkTargetFramework, .NET Framework multi-targeting, and
  CurrentTargetFramework for test assets

Learnings from PR #55166 where tests were initially written without
Helix compatibility.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 76a86ef3-d73c-451c-8f6e-cef56bf3509c
@MichaelSimons

Copy link
Copy Markdown
Member Author

Gentle ping for a code review - TIA.

@MichaelSimons

Copy link
Copy Markdown
Member Author

/ba-g intermittent failure tracked by #55358.

@MichaelSimons
MichaelSimons merged commit cbb5d5a into main Jul 23, 2026
27 of 29 checks passed
@MichaelSimons
MichaelSimons deleted the michaelsimons-helix-test-authoring-guidance branch July 23, 2026 13:49
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Jul 24, 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.

3 participants