<PropertyGroup Condition="'$(TestPackages)' == 'true'">
<!-- Use Helix feature to include dotnet CLI for every workitem and add it to the path -->
- <IncludeDotNetCli>true</IncludeDotNetCli>
- <DotNetCliPackageType>sdk</DotNetCliPackageType>
+ <NeedsDotNetSdk>true</NeedsDotNetSdk>
+ <UseDotNetCliVersionFromGlobalJson>true</UseDotNetCliVersionFromGlobalJson>
<TestRunNamePrefix>packaging-</TestRunNamePrefix>
- <GlobalJsonContent>$([System.IO.File]::ReadAllText('$(RepoRoot)global.json'))</GlobalJsonContent>
- <DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")'))</DotNetCliVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(HelixType)' == ''">
<HelixPreCommand Include="set XHARNESS_DISABLE_COLORED_OUTPUT=true" />
<HelixPreCommand Include="set XHARNESS_LOG_WITH_TIMESTAMPS=true" />
</ItemGroup>
- <ItemGroup Condition="'$(TargetOS)' == 'Browser'">
+
+ <PropertyGroup Condition="'$(TargetOS)' == 'Browser'">
<!--
We are hosting the payloads for the WASM/browser on kestrel in the xharness process.
We also run some network tests to this server and so, we are running it on both HTTP and HTTPS.
For the HTTPS endpoint we need development SSL certificate.
- Below is alternative to `dotnet dev-certs https` but we don't have full SDK installed on helix, so the tool is not available.
-->
- <HelixPreCommand Include="powershell -command "New-SelfSignedCertificate -FriendlyName 'ASP.NET Core HTTPS development certificate' -DnsName @('localhost') -Subject 'CN = localhost' -KeyAlgorithm RSA -KeyLength 2048 -HashAlgorithm sha256 -CertStoreLocation 'Cert:\CurrentUser\My' -TextExtension @('2.5.29.37={text}1.3.6.1.5.5.7.3.1','1.3.6.1.4.1.311.84.1.1={hex}02','2.5.29.19={text}') -KeyUsage DigitalSignature,KeyEncipherment"" />
- </ItemGroup>
+ <InstallDevCerts Condition="'$(Scenario)' != 'BuildWasmApps'">true</InstallDevCerts>
+
+ <!-- Install SDK so that, we could use `dotnet dev-certs https` -->
+ <NeedsDotNetSdk>true</NeedsDotNetSdk>
+ </PropertyGroup>
<ItemGroup Condition="'$(Scenario)' == 'WasmTestOnBrowser' or '$(Scenario)' == 'BuildWasmApps'">
<HelixPreCommand Include="export PATH=$HELIX_CORRELATION_PAYLOAD/chromedriver_linux64:$PATH" />
</ItemGroup>
<PropertyGroup Condition="'$(NeedsToBuildWasmAppsOnHelix)' == 'true'">
+ <NeedsDotNetSdk>true</NeedsDotNetSdk>
+ <UseDotNetCliVersionFromGlobalJson>true</UseDotNetCliVersionFromGlobalJson>
<IncludeXHarnessCli>true</IncludeXHarnessCli>
- <IncludeDotNetCli>true</IncludeDotNetCli>
- <DotNetCliPackageType>sdk</DotNetCliPackageType>
- <GlobalJsonContent>$([System.IO.File]::ReadAllText('$(RepoRoot)global.json'))</GlobalJsonContent>
- <DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")'))</DotNetCliVersion>
</PropertyGroup>
<!-- HelixPreCommands is a set of commands run before the work item command. We use it here to inject
<IncludeHelixCorrelationPayload Condition="'$(HelixCorrelationPayload)' != '' and '$(TargetOS)' != 'Browser'">true</IncludeHelixCorrelationPayload>
</PropertyGroup>
+ <PropertyGroup Condition="'$(NeedsDotNetSdk)' == 'true'">
+ <IncludeDotNetCli>true</IncludeDotNetCli>
+ <DotNetCliPackageType>sdk</DotNetCliPackageType>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(UseDotNetCliVersionFromGlobalJson)' == 'true'">
+ <GlobalJsonContent>$([System.IO.File]::ReadAllText('$(RepoRoot)global.json'))</GlobalJsonContent>
+ <DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")'))</DotNetCliVersion>
+ </PropertyGroup>
+
<PropertyGroup Condition="'$(HelixCommand)' == ''">
+ <HelixCommand Condition="'$(InstallDevCerts)' == 'true' and '$(BrowserHost)' != 'windows'">dotnet dev-certs https && </HelixCommand>
+
+ <!-- on windows `dotnet dev-certs https shows a dialog, so instead install the certificate with powershell -->
+ <HelixCommand Condition="'$(InstallDevCerts)' == 'true' and '$(BrowserHost)' == 'windows'">powershell -command "New-SelfSignedCertificate -FriendlyName 'ASP.NET Core HTTPS development certificate' -DnsName @('localhost') -Subject 'CN = localhost' -KeyAlgorithm RSA -KeyLength 2048 -HashAlgorithm sha256 -CertStoreLocation 'Cert:\CurrentUser\My' -TextExtension @('2.5.29.37={text}1.3.6.1.5.5.7.3.1','1.3.6.1.4.1.311.84.1.1={hex}02','2.5.29.19={text}') -KeyUsage DigitalSignature,KeyEncipherment" && </HelixCommand>
+
<!--
For Windows we need to use "call", since the command is going to be called from a batch script created by Helix.
We "exit /b" at the end of RunTests.cmd. Helix runs some other commands after ours within the batch script,
so if we don't use "call", then we cause the parent script to exit, and anything after will not be executed.
-->
- <HelixCommand Condition="'$(TargetsWindows)' == 'true' or '$(BrowserHost)' == 'windows'">call RunTests.cmd</HelixCommand>
+ <HelixCommand Condition="'$(TargetsWindows)' == 'true' or '$(BrowserHost)' == 'windows'">$(HelixCommand)call RunTests.cmd</HelixCommand>
<HelixCommand Condition="('$(TargetsWindows)' == 'true' or '$(BrowserHost)' == 'windows') and '$(IncludeHelixCorrelationPayload)' == 'true'">$(HelixCommand) --runtime-path %HELIX_CORRELATION_PAYLOAD%</HelixCommand>
- <HelixCommand Condition="'$(TargetsWindows)' != 'true' and '$(BrowserHost)' != 'windows'">./RunTests.sh</HelixCommand>
+
+ <HelixCommand Condition="'$(TargetsWindows)' != 'true' and '$(BrowserHost)' != 'windows'">$(HelixCommand)./RunTests.sh</HelixCommand>
<HelixCommand Condition="'$(TargetsWindows)' != 'true' and '$(BrowserHost)' != 'windows' and '$(IncludeHelixCorrelationPayload)' == 'true'">$(HelixCommand) --runtime-path "$HELIX_CORRELATION_PAYLOAD"</HelixCommand>
</PropertyGroup>