Skip to content

Support running tests locally in a helix environment on Linux#52713

Merged
MichaelSimons merged 1 commit intodotnet:mainfrom
MichaelSimons:linux-helix-repro
Feb 2, 2026
Merged

Support running tests locally in a helix environment on Linux#52713
MichaelSimons merged 1 commit intodotnet:mainfrom
MichaelSimons:linux-helix-repro

Conversation

@MichaelSimons
Copy link
Member

  1. Add execute permission to sdk-build-env.sh and RunTestsOnHelix.sh
  2. Remove the PayloadDirectory metadata from the HelixCorrelationPayload. This is not supported by Helix and is something sdk added. The CreateLocalHelixTestLayout task had a hard dependency on the PayloadDirectory yet is wasn't specified for every HelixCorrelationPayload. The CreateLocalHelixTestLayout was updated to depend on the include metadata instead.

Copilot AI review requested due to automatic review settings January 28, 2026 17:20
@MichaelSimons MichaelSimons changed the title Support running tests locally in a helix environment Support running tests locally in a helix environment on Linux Jan 28, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enables running SDK tests locally in a Helix environment by simplifying the payload handling mechanism and ensuring proper script permissions.

Changes:

  • Removed the non-standard PayloadDirectory metadata from HelixCorrelationPayload items
  • Updated CreateLocalHelixTestLayout task to use ItemSpec directly instead of PayloadDirectory metadata
  • Added execute permissions to generated sdk-build-env.sh script

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/UnitTests.proj Removed PayloadDirectory metadata from all HelixCorrelationPayload items, simplifying the configuration
test/HelixTasks/CreateLocalHelixTestLayout.cs Refactored to use ItemSpec directly, added file/directory handling logic, and improved cleanup behavior
eng/restore-toolset.sh Added chmod +x to ensure the generated build environment script is executable
build/RunTestsOnHelix.sh New script for running tests on Helix in POSIX environments

Copy link
Member

@nagilson nagilson left a comment

Choose a reason for hiding this comment

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

Solid changes, thank you!

return;
}

if (Directory.Exists(target.FullName) == false)
Copy link
Member

Choose a reason for hiding this comment

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

Good call here, since Directory.CreateDirectory already works ok if the directory exists.

"

echo "$scriptContents" > ${scriptPath}
chmod +x ${scriptPath}
Copy link
Member

Choose a reason for hiding this comment

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

I was initially concerned about this, but I don't think this crosses any trust boundary that isn't already crossable.

Copy link
Member

Choose a reason for hiding this comment

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

Something isn't working properly in GitHub here...
image

The .sh files are properly set as text here. Any idea what is going on?

*.sh text eol=lf

Copy link
Member Author

Choose a reason for hiding this comment

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

My browser shows File mode changed.

Image

// Clean the test output directory once at the start
if (Directory.Exists(TestOutputDirectory))
{
Directory.Delete(TestOutputDirectory, recursive: true);
Copy link
Member

Choose a reason for hiding this comment

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

Can this throw if it doesn't have permission (for some reason) or if any of the files are locked?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it will throw UnauthorizedAccessException for permissions and IOException if the files are locked.

@MichaelSimons
Copy link
Member Author

/ba-g known template engine networking issue

@MichaelSimons MichaelSimons merged commit e6bf57d into dotnet:main Feb 2, 2026
19 of 26 checks passed
@MichaelSimons MichaelSimons deleted the linux-helix-repro branch February 2, 2026 15:17
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.

4 participants