Run trimming tests as AOT tests#101229
Conversation
Not everything is passing, so I baselined this. Some we'll probably exclude permanently, others are more concerning and we need to determine if it's test issues or product issues.
|
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries |
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
src/libraries/tests.proj
Outdated
| <DisabledNativeAotTestAppProjects Include="$(MSBuildThisFileDirectory)\System.Runtime\tests\System.Runtime.Tests\TrimmingTests\System.Runtime.TrimmingTests.proj" /> | ||
| <DisabledNativeAotTestAppProjects Include="$(MSBuildThisFileDirectory)\System.Text.Json\tests\System.Text.Json.Tests\TrimmingTests\System.Text.Json.TrimmingTests.proj" /> | ||
|
|
||
| <NativeAotTestAppProjects Include="$(MSBuildThisFileDirectory)*\tests\**\*.NativeAotTests.proj;$(MSBuildThisFileDirectory)*\tests\**\*.TrimmingTests.proj" |
There was a problem hiding this comment.
Should we just get rid of the NativeAotTests.proj extension (there is only 1 currently in the repo) and instead just have TrimmingTests.proj, which are run as both PublishTrimmed and PublishAot?
There was a problem hiding this comment.
If you don't have concerns about running the NativeAotTests with trimming as well, that sounds good to me too.
Trimming is generally a subset of AOT.
There was a problem hiding this comment.
This is the only NativeAotTests today:
It should work just fine with PublishTrimmed. It was written to test the MakeGenericType deep inside of DiagnosticSourceEventSource works with NativeAOT.
I think it would be best to just have 1 "kind of test" and it runs for both PublishTrimmed and PublishAot. It will make it easier to write these, and it will add a bit of coverage to both scenarios.
| <MSBuild Projects="@(TestConsoleApps)" | ||
| Targets="Publish" | ||
| Properties="Configuration=$(Configuration);BuildProjectReferences=false;TargetOS=$(TargetOS);TargetArchitecture=$(TargetArchitecture)" /> | ||
| Properties="Configuration=$(Configuration);BuildProjectReferences=false;TargetOS=$(TargetOS);TargetArchitecture=$(TargetArchitecture);_IsPublishing=true" /> |
There was a problem hiding this comment.
The tests weren't building because they couldn't find AppHost. This is running the Publish target directly, which is very problematic because it bypasses logic in the SDK. We have been having a conversation with the SDK team for months. The fix is to do what real publish does and that's setting _IsPublishing. We do that in multiple places in this repo even though it's used/defined by the SDK.
This reverts commit 156a359.
eerhardt
left a comment
There was a problem hiding this comment.
LGTM. Thank you for making this happen.
| <_additionalPropertiesString>@(_propertiesAsItems->'<%(Identity)>%(Value)</%(Identity)>', '%0a ')</_additionalPropertiesString> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- RunNativeAotTestApps trumps TestTrimming, same as PublishAot trumps PublishTrimmed --> |
There was a problem hiding this comment.
(nit) this comment doesn't align with the code. The comment says one trumps the other. The code says if they are both true it is an error.
|
/ba-g slow mac |
Not everything is passing, so I baselined this. Some we'll probably exclude permanently, others are more concerning and we need to determine if it's test issues or product issues.
Not everything is passing, so I baselined this. Some we'll probably exclude permanently, others are more concerning and we need to determine if it's test issues or product issues.
Cc @dotnet/ilc-contrib