Skip to content

Commit

Permalink
Fix publishing as docker image via /t:PublishContainer (#3929)
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd authored and Evangelink committed Oct 17, 2024
1 parent 7f0381b commit aa1b83e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,18 @@
</Target>

<Target Name="_TestRunStart" />

<Target Name="_SetTestingPlatformDefaultsForContainerBuild" BeforeTargets="ComputeContainerConfig"
Condition="'$(IsPublishable)' == 'true' AND '$(EnableSdkContainerSupport)' == 'true' AND !$(RuntimeIdentifier.StartsWith('win'))">
<!--
When PublishContainer target is used to create a docker image for the test project, it will try to write /app/TestResults folder
which is a non-writable folder. The environment variable below (notice double underscore) is used to override option defaults, and is picked up
EnvironmentVariablesConfigurationProvider.
ComputeContainerConfig is target that PublishContainer depends on to figure out the configuration for the container.
-->
<ItemGroup>
<ContainerEnvironmentVariable Include="platformOptions__resultDirectory" Value="/tmp/TestResults"></ContainerEnvironmentVariable>
</ItemGroup>
</Target>
</Project>

0 comments on commit aa1b83e

Please sign in to comment.