Skip to content
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

Move setting variables to HelixPreCommands #96713

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions eng/testing/tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@
<ItemGroup Condition="'$(IsXUnitLogCheckerSupported)' == 'true' and
'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '$(NETCoreAppCurrentVersion)'))">
<SetScriptCommands Condition="'$(TargetOS)' == 'windows'" Include="set __TestArchitecture=$(TargetArchitecture)" />
<SetScriptCommands Condition="'$(TargetOS)' == 'windows'" Include="set __IsXUnitLogCheckerSupported=1" />
Copy link
Member

Choose a reason for hiding this comment

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

Is XUnitLogChecker just a CI tool or does it work locally as well when running tests? If the former then it might make sense to condition this item group on '$(ArchiveTests)' == 'true'.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe @ivdiazsa or @carlossanlop can answer that.

I realized I didn't want to mess with the XUnitLogChecker since a recent fix made it not break on local dev machines. So I've scoped back this PR to only fix the architecture-specific setting of __TestArchitecture.

Copy link
Member

@ivdiazsa ivdiazsa Jan 10, 2024

Choose a reason for hiding this comment

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

XUnitLogChecker can be run locally, but it has to be called manually by the user. Automatically, it's only run through the CI scripts. That said, it is always built alongside all common test tools, like for example with:

# XUnitLogChecker is included in all that would be built with this command.
src/tests/build.sh -x64 -release -generatelayoutonly


<SetScriptCommands Condition="'$(TargetOS)' != 'windows'" Include="export __TestArchitecture=$(TargetArchitecture)" />
<SetScriptCommands Condition="'$(TargetOS)' != 'windows'" Include="export __IsXUnitLogCheckerSupported=1" />
</ItemGroup>

Expand Down
8 changes: 8 additions & 0 deletions src/libraries/sendtohelixhelp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@
setting up the per-scenario environment.
-->

<ItemGroup Condition=" '$(TargetOS)' == 'windows' ">
<HelixPreCommand Include="set __TestArchitecture=$(TargetArchitecture)" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetOS)' != 'windows' ">
<HelixPreCommand Include="export __TestArchitecture=$(TargetArchitecture)" />
</ItemGroup>

<ItemGroup Condition=" '$(TestEnvFileName)' != '' and '$(TargetOS)' == 'windows' ">
<HelixPreCommand Include="set __TestEnv=%HELIX_CORRELATION_PAYLOAD%\$(TestEnvFileName)" />
<HelixPreCommand Include="type %__TestEnv%" />
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Common/helixpublishwitharcade.proj
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@
<HelixPreCommand Include="export __TestCollectionTimeoutMins=$(TimeoutPerTestCollectionInMinutes)" Condition=" '$(TimeoutPerTestCollectionInMinutes)' != '' " />
<HelixPreCommand Include="export __CollectDumps=1" />
<HelixPreCommand Include="export __CrashDumpFolder=$HELIX_DUMP_FOLDER" />
<HelixPreCommand Include="set __TestArchitecture=$(TargetArchitecture)" />
<HelixPreCommand Include="export __TestArchitecture=$(TargetArchitecture)" />
<HelixPreCommand Include="cat $__TestEnv" />

<HelixPostCommand Include="find $HELIX_WORKITEM_PAYLOAD -name '*testResults.xml' -exec cp {} $HELIX_DUMP_FOLDER\; " />
Expand Down
Loading