-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Net8 tests #7319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Net8 tests #7319
Changes from 37 commits
5e6ed1a
d495c4c
2535418
cb78448
f84fb69
489fab9
39f7807
66b130c
1301e6d
e84ec25
d7eb263
fae4a9a
4da3877
faa175d
e797c19
2f5047e
e23e47b
ffa86df
16fad35
47439ba
a19afa9
a638909
af004c4
ed44308
44f3cb4
5e23157
fe40b56
22dd928
b5b7c35
3993097
36ccf7c
fc88832
5ca091a
577e4ae
12eeb26
9090999
a6f1973
0f68e7f
86504cc
85e0d96
86b682c
00f6347
a0ff186
923b6fe
79ec095
25b5301
4e137f3
278b277
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,31 @@ parameters: | |
condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() | ||
|
||
steps: | ||
- script: ${{ parameters.MsBuildScript}} | ||
$(Build.SourcesDirectory)/eng/helix.proj | ||
/t:Restore | ||
/bl:$(Build.SourcesDirectory)/artifacts/log/${{ parameters.Configuration }}/SendToHelix.binlog | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This uses the same log as below, also most of these parameters are not needed for restore. I imagine this step is just temporary until we refactor in a follow up PR though. |
||
/p:Configuration=${{ parameters.Configuration }} | ||
/p:TargetArchitecture=${{ parameters.Architecture }} | ||
/p:BuildConfig=${{ parameters.Configuration }} | ||
/p:BuildArchitecture=${{ parameters.Architecture }} | ||
/p:HelixSource=${{ parameters.HelixSource }} | ||
/p:HelixType=${{ parameters.HelixType }} | ||
/p:HelixBuild=${{ parameters.HelixBuild }} | ||
/p:HelixConfiguration="${{ parameters.HelixConfiguration }}" | ||
/p:HelixAccessToken="${{ parameters.HelixAccessToken }}" | ||
/p:EnableXUnitReporter=${{ parameters.EnableXUnitReporter }} | ||
/p:WaitForWorkItemCompletion=${{ parameters.WaitForWorkItemCompletion }} | ||
/p:HelixBaseUri=${{ parameters.HelixBaseUri }} | ||
${{ parameters.WarnAsError }} | ||
${{ parameters.TestTargetFramework }} | ||
displayName: "Helix Restore" | ||
env: | ||
SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
Creator: ${{ parameters.Creator }} | ||
HelixTargetQueues: ${{ parameters.HelixTargetQueues }} | ||
continueOnError: ${{ parameters.continueOnError }} | ||
|
||
- script: ${{ parameters.MsBuildScript}} | ||
$(Build.SourcesDirectory)/eng/helix.proj | ||
/t:Test | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,10 +39,11 @@ | |
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AdditionalDotNetPackage Include="$(DotNetRuntime60Version)"> | ||
<AdditionalDotNetPackage Include="$(DotNetRuntime80Version)"> | ||
<PackageType>runtime</PackageType> | ||
<DotNetCliRuntime Condition="'$(BuildArchitecture)' == 'x86'">win-x86</DotNetCliRuntime> | ||
<DotNetCliRuntime Condition="'$(BuildArchitecture)' == 'arm' And $(HelixTargetQueues.ToLowerInvariant().Contains('ubuntu'))">linux-arm</DotNetCliRuntime> | ||
<DotNetCliRuntime Condition="'$(BuildArchitecture)' == 'arm64' And $(HelixTargetQueues.ToLowerInvariant().Contains('osx'))">osx-arm64</DotNetCliRuntime> | ||
</AdditionalDotNetPackage> | ||
</ItemGroup> | ||
|
||
|
@@ -89,6 +90,10 @@ | |
</HelixCorrelationPayload> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Templating" Version="$(MicrosoftDotNetBuildTasksTemplatingVersion)" PrivateAssets="All" /> | ||
ericstj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</ItemGroup> | ||
|
||
<Target Name="CreateHelixWorkItems"> | ||
<MSBuild Projects="@(MyProjects)" | ||
Targets="GetTargetFrameworks" | ||
|
@@ -111,6 +116,13 @@ | |
<HelixCorrelationPayloadPath Condition="$(IsPosixShell)">$HELIX_CORRELATION_PAYLOAD</HelixCorrelationPayloadPath> | ||
<HelixCorrelationPayloadPath Condition="!$(IsPosixShell)">%HELIX_CORRELATION_PAYLOAD%</HelixCorrelationPayloadPath> | ||
|
||
<RunTestScript Condition="'$(OS)' != 'Windows_NT'">runTests.sh</RunTestScript> | ||
<RunTestScript Condition="'$(OS)' == 'Windows_NT'">./runTests.cmd</RunTestScript> | ||
|
||
<RunCommand>dotnet exec --roll-forward Major --runtimeconfig %(ProjectsWithTargetFramework.Filename).runtimeconfig.json --depsfile %(ProjectsWithTargetFramework.Filename).deps.json $(HelixCorrelationPayloadPath)/xunit-runner/tools/netcoreapp2.0/xunit.console.dll %(ProjectsWithTargetFramework.Filename).dll -notrait Category=SkipInCI -xml testResults.xml</RunCommand> | ||
<RunCommand Condition="$(TestTargetFramework.EndsWith('net462')) And %(ProjectsWithTargetFramework.TargetFrameworks) != 'net8.0'">$(HelixCorrelationPayloadPath)/xunit-runner/tools/net462/xunit.console.exe %(ProjectsWithTargetFramework.Filename).dll -notrait Category=SkipInCI -xml testResults.xml</RunCommand> | ||
|
||
|
||
<MacFilesToCopy>/usr/local/opt/libomp/lib/libiomp5.dylib;/usr/local/opt/libomp/lib/libomp.dylib;</MacFilesToCopy> | ||
<MacFilesToCopy Condition="$(HelixTargetQueues.ToLowerInvariant().Contains('arm64'))">/usr/local/opt/libomp/lib/libomp.dylib;</MacFilesToCopy> | ||
</PropertyGroup> | ||
|
@@ -149,16 +161,21 @@ | |
<Delete Condition="$(HelixTargetQueues.ToLowerInvariant().Contains('ubuntu'))" | ||
Files="@(WindowsFiles);@(OsxFiles)" /> | ||
|
||
<GenerateFileFromTemplate TemplateFile="$(MSBuildThisFileDirectory)testing\$(RunTestScript)" | ||
OutputPath="$(TargetDir)$(RunTestScript)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This TargetDir is not correct. In my PR this worked because I would generate in the context of each test project, so TargetDir would point to the output of the test. Here you are running in the context of |
||
Properties="runCommand=$(RunCommand)" /> | ||
|
||
<ItemGroup> | ||
<HelixWorkItem Include="%(ProjectsWithTargetFramework.Filename)"> | ||
<PayloadDirectory>$(BUILD_SOURCESDIRECTORY)\artifacts\bin\%(ProjectsWithTargetFramework.Filename)\$(BuildConfig)\%(ProjectsWithTargetFramework.TargetFrameworks)\</PayloadDirectory> | ||
<PayloadDirectory Condition="%(ProjectsWithTargetFramework.TargetFrameworks) == 'net462'">$(BUILD_SOURCESDIRECTORY)\artifacts\bin\%(ProjectsWithTargetFramework.Filename)\$(BuildConfig)\%(ProjectsWithTargetFramework.TargetFrameworks)\win-x64</PayloadDirectory> | ||
<Command>dotnet exec --roll-forward Major --runtimeconfig %(ProjectsWithTargetFramework.Filename).runtimeconfig.json --depsfile %(ProjectsWithTargetFramework.Filename).deps.json $(HelixCorrelationPayloadPath)/xunit-runner/tools/netcoreapp2.0/xunit.console.dll %(ProjectsWithTargetFramework.Filename).dll -notrait Category=SkipInCI -xml testResults.xml</Command> | ||
<Command Condition="$(TestTargetFramework.EndsWith('net462')) And %(ProjectsWithTargetFramework.TargetFrameworks) != 'net6.0'">$(HelixCorrelationPayloadPath)/xunit-runner/tools/net462/xunit.console.exe %(ProjectsWithTargetFramework.Filename).dll -notrait Category=SkipInCI -xml testResults.xml</Command> | ||
<Command Condition="'$(OS)' != 'Windows_NT'">./$(RunTestScript)</Command> | ||
<Command Condition="'$(OS)' == 'Windows_NT'">call $(RunTestScript)</Command> | ||
<Timeout>01:00:00</Timeout> | ||
<Timeout Condition="$(HelixTargetQueues.ToLowerInvariant().Contains('osx'))">00:30:00</Timeout> | ||
<Timeout Condition="'$(WorkItemTimeout)' != ''">$(WorkItemTimeout)</Timeout> | ||
</HelixWorkItem > | ||
</ItemGroup> | ||
|
||
</Target> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@echo off | ||
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION | ||
|
||
set EXECUTION_DIR=%~dp0 | ||
|
||
|
||
:: ========================= BEGIN Test Execution ============================= | ||
echo ----- start %DATE% %TIME% =============== To repro directly: ===================================================== | ||
echo pushd %EXECUTION_DIR% | ||
echo ${runCommand} | ||
echo popd | ||
echo =========================================================================================================== | ||
pushd %EXECUTION_DIR% | ||
@echo on | ||
${runCommand} | ||
@set _exit_code=%ERRORLEVEL% | ||
@echo off | ||
if exist testResults.xml ( | ||
set HAS_TEST_RESULTS=1 | ||
) | ||
popd | ||
echo ----- end %DATE% %TIME% ----- exit code %_exit_code% ---------------------------------------------------------- | ||
:: ========================= END Test Execution =============================== | ||
|
||
:: The tests either failed or crashed, copy output files | ||
if not %_exit_code%==0 ( | ||
if not "%HELIX_WORKITEM_UPLOAD_ROOT%" == "" ( | ||
powershell Compress-Archive %EXECUTION_DIR%\TestOutput %HELIX_WORKITEM_UPLOAD_ROOT%\TestOutput.zip | ||
) | ||
) | ||
|
||
:: The helix work item should not exit with non-zero if tests ran and produced results | ||
:: The xunit console runner returns 1 when tests fail | ||
if %_exit_code%==1 ( | ||
if %HAS_TEST_RESULTS%==1 ( | ||
if not "%HELIX_WORKITEM_PAYLOAD%"=="" ( | ||
exit /b 0 | ||
) | ||
) | ||
) | ||
|
||
exit /b %_exit_code% |
Uh oh!
There was an error while loading. Please reload this page.