Skip to content

Port arcade-validation RepoTests into arcade (1/3) - #17066

Merged
mmitche merged 17 commits into
dotnet:mainfrom
mmitche:dev/arcade-validation-removal/port-validation-tests
Jul 6, 2026
Merged

mmitche merged 17 commits into
dotnet:mainfrom
mmitche:dev/arcade-validation-removal/port-validation-tests

Conversation

@mmitche

@mmitche mmitche commented Jun 30, 2026 •

Copy link
Copy Markdown
Member

Part 1 of removing the Arcade -> arcade-validation promotion/validation gate (#17046).

This increment ports arcade-validation's RepoTests into arcade as an in-repo test project, so a later increment can run them in the PR and official builds against the newly produced Arcade SDK. No pipeline runs these tests yet — wiring follows in separate PRs.

What's here

  • src/Microsoft.DotNet.Arcade.Validation.Tests/ — ported from dotnet/arcade-validation src/Validation/tests (RepoTests, TestRepoBuilder/RepoResources, fixtures, Command helpers, README).
  • New-SDK injection: the produced Arcade SDK version + local package feeds are flowed to the test host via runtimeconfig.json (read with AppContext.GetData) and injected into each synthetic repo's global.json/NuGet.config; falls back to global.json + public feeds when unset. Override via the ValidationArcadeSdkVersion / ValidationLocalPackageFeeds MSBuild properties.
  • Directory.Packages.props — add MSBuild.ProjectCreation 10.0.0 (17.x+ break arcade's central Microsoft.Build/CodeAnalysis pins).
  • Arcade.slnx — register the project.
  • tests/UnitTests.proj — exclude from Helix submission (these tests spawn full build sub-processes and must run on a build agent with a local feed).

Validation

  • Project compiles clean (Build.cmd -projects ... Release) and the runtimeconfig options are emitted as expected.
  • Test inputs (eng/common + global.json) copy to output as the harness expects.
  • The tests build and pass locally via Build.cmd -test -projects ....

Full end-to-end execution happens in the PR/official pipelines (subsequent increments).

Part of #17046.

Add an in-repo validation test project (src/Microsoft.DotNet.Arcade.Validation.Tests)
ported from dotnet/arcade-validation (src/Validation/tests). These tests build small
synthetic repositories using the Arcade SDK and assert on Arcade's signing/build
infrastructure behavior.

This is the first increment of moving arcade-validation's functional validation into
arcade's own PR and official builds. To validate the newly produced SDK rather than the
bootstrap version pinned in global.json, the harness reads ARCADE_VALIDATION_SDK_VERSION /
ARCADE_VALIDATION_DOTNET_VERSION / ARCADE_VALIDATION_LOCAL_FEEDS and injects the local
package feed into each synthetic repo's NuGet.config, falling back to global.json + public
feeds when unset.

Includes eng/run-arcade-validation-tests.ps1, which discovers the produced Arcade SDK
version and local feeds and runs the tests. No pipeline invokes these tests yet; PR and
official wiring follow in subsequent increments.

- Add MSBuild.ProjectCreation 10.0.0 to Directory.Packages.props (17.x+ transitively
  require Microsoft.Build.Utilities.Core 18.x / CodeAnalysis.CSharp 4.14, conflicting with
  arcade's central pins).
- Register the project in Arcade.slnx.
- Exclude it from the Helix unit-test submission in tests/UnitTests.proj: it spawns full
  build sub-processes and must run on a build agent with a local package feed.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings June 30, 2026 17:56

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

Ports the arcade-validation RepoTests into dotnet/arcade as an in-repo test project so future pipeline work can validate the newly produced Arcade SDK/packages without promoting to a separate repo.

Changes:

  • Adds new Microsoft.DotNet.Arcade.Validation.Tests project that synthesizes repos and runs build/signing validation scenarios.
  • Introduces eng/run-arcade-validation-tests.ps1 to discover the locally produced SDK/package feeds and run the new tests.
  • Wires the new project into the solution and package set, and excludes it from Helix unit test submission.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
tests/UnitTests.proj Excludes the new validation tests from Helix submission.
src/Microsoft.DotNet.Arcade.Validation.Tests/TestRepoBuilder.cs Harness for creating synthetic repos and invoking Arcade build scripts.
src/Microsoft.DotNet.Arcade.Validation.Tests/RepoTests.cs Validation tests covering signing and build behaviors.
src/Microsoft.DotNet.Arcade.Validation.Tests/README.md Documentation for purpose and execution/injection model.
src/Microsoft.DotNet.Arcade.Validation.Tests/Microsoft.DotNet.Arcade.Validation.Tests.csproj New test project definition and input-file copying.
src/Microsoft.DotNet.Arcade.Validation.Tests/CommonRepoResourcesFixture.cs Shared fixture for common resources across tests.
src/Microsoft.DotNet.Arcade.Validation.Tests/Command.cs Process execution helper for nested builds.
src/Microsoft.DotNet.Arcade.Validation.Tests/CommandResult.cs Execution result container and failure reporting.
src/Microsoft.DotNet.Arcade.Validation.Tests/ArgumentEscaper.cs Argument escaping utilities for process invocation.
eng/run-arcade-validation-tests.ps1 Runner script to set env vars and execute the validation test project.
Directory.Packages.props Adds MSBuild.ProjectCreation package version pin.
Arcade.slnx Adds the new validation test project to the solution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/UnitTests.proj Resolved
Comment thread eng/run-arcade-validation-tests.ps1 Resolved
Comment thread eng/run-arcade-validation-tests.ps1 Resolved
ViktorHofer and others added 2 commits July 1, 2026 15:19
- Fix RepoResources.Dispose: inverted null check, guard CommonDotnetRoot, delete CommonRoot itself instead of its parent
- Fix ArgumentEscaper.ShouldSurroundWithQuotes to return false when no whitespace
- Remove unused usings (CS8019) and unused envVars locals (TreatWarningsAsErrors)
- Fix XML doc typo 'expecte ddefault'
- Align README/UnitTests.proj wording: tests not yet run by any pipeline
- run-arcade-validation-tests.ps1: report default feed paths in error when -packageFeeds omitted

Co-authored-by: Copilot <[email protected]>
Make the Arcade.Validation.Tests project build and pack the SDK packages it
validates via Targets="Build;Pack" ProjectReferences, so it can run with a
plain build.cmd -test / dotnet test without a separate -pack. The Arcade SDK in
turn builds+packs the other in-repo packages its targets consume. Flow the SDK
version and local feed to the test host through runtimeconfig.json, overridable
via the ValidationArcadeSdkVersion and ValidationLocalPackageFeeds properties.
Make temp-directory teardown best-effort to avoid build-server file locks.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 1, 2026 14:30
ViktorHofer
ViktorHofer previously approved these changes Jul 1, 2026

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.

Copilot's findings

  • Files reviewed: 12/12 changed files
  • Comments generated: 5

- Command.Execute: drain async stdout/stderr readers before reading captured output
- Command.EnvironmentVariable: remove the variable when value is null/empty instead of setting a null entry
- TestRepoBuilder: XML-escape local feed paths written into NuGet.config
- RepoTests: fix "Certifcate" typo in test method name and align AssetManifest comment with actual directory name

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 1, 2026 15:16

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.

Copilot's findings

  • Files reviewed: 12/12 changed files
  • Comments generated: 1

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings July 1, 2026 15:25

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.

Copilot's findings

  • Files reviewed: 12/12 changed files
  • Comments generated: 4

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI review requested due to automatic review settings July 2, 2026 10:43

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.

Copilot's findings

  • Files reviewed: 12/12 changed files
  • Comments generated: 6

The NuGet file-lock issue this works around only manifests on Windows, so only add /p:DeterministicTimestamp=false there rather than changing build behavior on all platforms.

Co-authored-by: Copilot <[email protected]>

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

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

Copilot AI review requested due to automatic review settings July 2, 2026 11:10

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

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

ViktorHofer and others added 2 commits July 2, 2026 13:14
This project targets only a modern TFM, so the NET45 branch using StartInfo.EnvironmentVariables is unreachable; keep only StartInfo.Environment.

Co-authored-by: Copilot <[email protected]>
- Command.Execute() -> ExecuteAsync() returning Task<CommandResult>; use Process.WaitForExitAsync with a CancellationTokenSource-driven timeout and await the stdout/stderr drain tasks instead of blocking (WaitForExit + GetAwaiter().GetResult()).
- TestRepoBuilder.Build() now returns Func<Task> that awaits ExecuteAsync().
- RepoTests await the build via NotThrowAsync()/ThrowAsync(); RepoResources.Create awaits the common-repo build.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 2, 2026 11:27

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.

Copilot's findings

  • Files reviewed: 12/12 changed files
  • Comments generated: 1

ViktorHofer and others added 2 commits July 2, 2026 13:51
BasicRepoBuild passed only -restore -sign. In Arcade's Build.proj, Sign is not part of _SolutionBuildTargets, so without -build the synthetic project was never compiled and the test could pass without validating a build. Add -build so the test matches its name/intent.

Co-authored-by: Copilot <[email protected]>
Per review discussion, the lack of --build is intentional: this validates the sign path with AllowEmptySignList=true, not a full compile. Rename to RestoreAndSignSucceedsWithAllowEmptySignList and document why --build is intentionally omitted, instead of adding --build.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 2, 2026 11:54

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.

Copilot's findings

  • Files reviewed: 12/12 changed files
  • Comments generated: 2

Use <Authenticode>([^<]*)</Authenticode> instead of a greedy (.*) so multiple Authenticode elements can't collapse into a single match, ensuring the matches.Count == 1 assertions reliably detect the single-value case.

Co-authored-by: Copilot <[email protected]>

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.

Copilot's findings

  • Files reviewed: 12/12 changed files
  • Comments generated: 1

@ViktorHofer ViktorHofer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok now I'm really done :D

Comment thread tests/UnitTests.proj
<!-- Arcade SDK validation tests spawn full build.ps1/build.sh sub-builds against the newly
produced SDK and must run on a build agent with a local package feed; they are intended to
be executed directly by the validation pipeline stage, not submitted to Helix. -->
<XUnitProject Remove="..\src\Microsoft.DotNet.Arcade.Validation.Tests\Microsoft.DotNet.Arcade.Validation.Tests.csproj"/>

@mmitche mmitche Jul 6, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The PR validation does not run any tests locally. They all run in Helix right now.

@mmitche
mmitche enabled auto-merge (squash) July 6, 2026 21:07
@mmitche
mmitche disabled auto-merge July 6, 2026 21:11
@mmitche

mmitche commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

LGTM

@mmitche
mmitche merged commit e1bda7f into dotnet:main Jul 6, 2026
10 checks passed
mmitche added a commit to mmitche/arcade that referenced this pull request Jul 6, 2026
Run the ported Arcade SDK validation tests (src/Microsoft.DotNet.Arcade.Validation.Tests)
as part of the PR pipeline's Test stage, on both Windows and Linux, against the packages
this build just produced. This is the PR-side replacement for the arcade -> arcade-validation
promotion/validation gate.

Rather than a separate Windows-only step, the validation tests run inline as the non-Helix
unit tests of the existing Test-stage build (cibuild) step: the step now passes
RunNonHelixTestsOnly=true instead of Test=false. A new contained convention in
Directory.Build.targets skips the inline execution of the Helix-routed unit tests (they run
on Helix via tests/UnitTests.proj) when RunNonHelixTestsOnly is set, while the validation
project opts back in with SkipTests=false. Local �uild -test behavior is unchanged.

The run is credential-free: the test project defaults its Arcade SDK version and local feed
to the freshly built $(PackageVersion) / $(ArtifactsNonShippingPackagesDir).

Builds on the validation test project added in dotnet#17066.

Co-authored-by: Copilot <[email protected]>
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 13, 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