Skip to content

Fix test infrastructure: enable test execution and fix TestHelper path resolution#171

Merged
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/fix-test-infrastructure
Apr 28, 2026
Merged

Fix test infrastructure: enable test execution and fix TestHelper path resolution#171
rolfbjarne merged 2 commits into
mainfrom
dev/rolf/fix-test-infrastructure

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Set 'IsTestProject=true' in tests.csproj so that the arcade build
system actually runs the tests.

Fix TestHelper.ProjectDir resolving to artifacts/bin/tests/ instead of
the source tests/ directory. With the arcade build system, the test
assembly output goes to artifacts/bin/tests/Debug/net10.0/. The old
logic walked up from the assembly location and stopped at the first
directory named 'tests', which matched artifacts/bin/tests/ — a
directory that doesn't contain the actual test data files.

Add an IsTestsProjectDir helper that also checks for tests.csproj,
ensuring we find the source tests/ directory with the real TestData.

…h resolution

Set 'IsTestProject=true' in tests.csproj so that the arcade build
system actually runs the tests.

Fix TestHelper.ProjectDir resolving to artifacts/bin/tests/ instead of
the source tests/ directory. With the arcade build system, the test
assembly output goes to artifacts/bin/tests/Debug/net10.0/. The old
logic walked up from the assembly location and stopped at the first
directory named 'tests', which matched artifacts/bin/tests/ — a
directory that doesn't contain the actual test data files.

Add an IsTestsProjectDir helper that also checks for tests.csproj,
ensuring we find the source tests/ directory with the real TestData.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 fixes test execution under the Arcade build by correctly marking the tests project as a test project and making TestHelper.ProjectDir resolve to the source tests/ directory (instead of artifacts/bin/tests/...) so that test data files are found reliably.

Changes:

  • Mark tests/tests.csproj with IsTestProject=true so Arcade test discovery/execution runs this project.
  • Update TestHelper’s project-directory discovery to require both a tests/ directory name and the presence of tests.csproj.

Reviewed changes

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

File Description
tests/tests.csproj Enables Arcade to treat this as a runnable test project.
tests/TestHelper.cs Makes ProjectDir resolution robust against artifacts/bin/tests/... paths by validating tests.csproj presence.

The net472 test target verifies netstandard2.0 compatibility with .NET
Framework consumers, but it cannot run on macOS since the .NET SDK
doesn't include the net472 test host there. Condition the target so
bare 'dotnet test' works on all platforms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rolfbjarne rolfbjarne merged commit 0c544e8 into main Apr 28, 2026
7 checks passed
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