Skip to content

Add L0 test for work directory validation failure path#4228

Closed
Copilot wants to merge 4 commits intousers/tihuang/validatedirfrom
copilot/sub-pr-4227
Closed

Add L0 test for work directory validation failure path#4228
Copilot wants to merge 4 commits intousers/tihuang/validatedirfrom
copilot/sub-pr-4227

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

Addresses review feedback requesting test coverage for the work directory validation added in #4227. The validation code (Runner.cs:410-423) returns TerminatedError when the work directory cannot be created or accessed, but lacked test coverage for this failure path.

Changes

  • Added RunCommand_ShouldReturnTerminatedError_WhenWorkDirCreationFails test in Test/L0/Listener/RunnerL0.cs
    • Simulates directory creation failure by placing a blocking file at the target path
    • Verifies runner returns Constants.Runner.ReturnCode.TerminatedError
    • Includes proper cleanup in finally block

The test exercises this code path:

try
{
    Directory.CreateDirectory(workDirectory);
    IOUtil.ValidateExecutePermission(workDirectory);
}
catch (Exception ex)
{
    Trace.Error(ex);
    _term.WriteError($"Fail to create and validate runner's work directory '{workDirectory}'.");
    return Constants.Runner.ReturnCode.TerminatedError;
}

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 9, 2026 02:32
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
…tants

Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 9, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/TingluoHuang/REDACTED_L0/tarball/CompositeBasic
    • Triggering command: /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet exec --runtimeconfig /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.runtimeconfig.json --depsfile /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.deps.json /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/testhost.dll --port 36571 --endpoint 127.0.0.1:036571 --role client --parentprocessid 6213 --telemetryoptedin false (http block)
  • https://api.github.com/repos/TingluoHuang/REDACTED_L0/tarball/CompositeLimit
    • Triggering command: /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet exec --runtimeconfig /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.runtimeconfig.json --depsfile /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.deps.json /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/testhost.dll --port 36571 --endpoint 127.0.0.1:036571 --role client --parentprocessid 6213 --telemetryoptedin false (http block)
  • https://api.github.com/repos/TingluoHuang/REDACTED_L0/tarball/RepositoryActionWithActionYamlFile_DockerHubImage
    • Triggering command: /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet exec --runtimeconfig /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.runtimeconfig.json --depsfile /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.deps.json /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/testhost.dll --port 36571 --endpoint 127.0.0.1:036571 --role client --parentprocessid 6213 --telemetryoptedin false (http block)
  • https://api.github.com/repos/TingluoHuang/REDACTED_L0/tarball/RepositoryActionWithActionfile_DockerHubImage
    • Triggering command: /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet exec --runtimeconfig /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.runtimeconfig.json --depsfile /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.deps.json /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/testhost.dll --port 36571 --endpoint 127.0.0.1:036571 --role client --parentprocessid 6213 --telemetryoptedin false (http block)
  • https://api.github.com/repos/TingluoHuang/REDACTED_L0/tarball/RepositoryActionWithInvalidWrapperActionfile_Node
    • Triggering command: /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet exec --runtimeconfig /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.runtimeconfig.json --depsfile /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.deps.json /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/testhost.dll --port 36571 --endpoint 127.0.0.1:036571 --role client --parentprocessid 6213 --telemetryoptedin false (http block)
  • https://api.github.com/repos/TingluoHuang/REDACTED_L0/tarball/RepositoryActionWithWrapperActionfile_Node
    • Triggering command: /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet exec --runtimeconfig /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.runtimeconfig.json --depsfile /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.deps.json /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/testhost.dll --port 36571 --endpoint 127.0.0.1:036571 --role client --parentprocessid 6213 --telemetryoptedin false (http block)
  • https://api.github.com/repos/TingluoHuang/REDACTED_L0/tarball/repositoryactionwithactionfileanddockerfile
    • Triggering command: /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet exec --runtimeconfig /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.runtimeconfig.json --depsfile /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.deps.json /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/testhost.dll --port 36571 --endpoint 127.0.0.1:036571 --role client --parentprocessid 6213 --telemetryoptedin false (http block)
  • https://api.github.com/repos/TingluoHuang/REDACTED_L0/tarball/repositoryactionwithdockerfile
    • Triggering command: /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet exec --runtimeconfig /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.runtimeconfig.json --depsfile /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.deps.json /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/testhost.dll --port 36571 --endpoint 127.0.0.1:036571 --role client --parentprocessid 6213 --telemetryoptedin false (http block)
  • https://api.github.com/repos/actions/download-artifact/tarball/master
    • Triggering command: /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet exec --runtimeconfig /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.runtimeconfig.json --depsfile /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.deps.json /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/testhost.dll --port 36571 --endpoint 127.0.0.1:036571 --role client --parentprocessid 6213 --telemetryoptedin false (http block)
  • https://api.github.com/repos/actions/setup-node/tarball/v1
    • Triggering command: /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet /home/REDACTED/work/REDACTED/REDACTED/_dotnetsdk/8.0.417/dotnet exec --runtimeconfig /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.runtimeconfig.json --depsfile /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/Test.deps.json /home/REDACTED/work/REDACTED/REDACTED/src/Test/bin/Debug/net8.0/testhost.dll --port 36571 --endpoint 127.0.0.1:036571 --role client --parentprocessid 6213 --telemetryoptedin false (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Address feedback on work directory validation during runner startup Add L0 test for work directory validation failure path Feb 9, 2026
Copilot AI requested a review from TingluoHuang February 9, 2026 02:48
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.

2 participants