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

[mono] [tests] Set error for mono_fullaot runtime tests when no suitable tests are found #96902

Merged

Conversation

matouskozak
Copy link
Member

Report MSBuild error when compiling selected runtime tests with mono_fullaot and no suitable tests are found.

Motivation

This can happen when locally building selected tests that are disabled in issues.targets. This causes:

  1. Because TestExclusions contain the selected tests, TestScripts won't be created.
    <TestScripts Include="@(AllTestScripts)" Exclude="@(TestExclusions)" />
  2. This subsequently causes TestDirs to no exists, leading to enumarating all dlls on the disk (/**/*.dll) in
    <TestsAndAssociatedAssemblies Include="%(TestDirs.Identity)/**/*.dll" Exclude="@(NoMonoAotAssemblyPaths)" />

Previous behavior

Build doesn't get stopped and the following warning is reported:

MSBUILD : warning MSB5029: The value "/**/*.dll" of the "Include" attribute in element <ItemGroup> in file "<RUNTIME_ROOT>runtime/src/tests/build.proj (122,37)" is a wildcard that results in enumerating all files on the drive, which was likely not intended. Check that referenced properties are always defined.

New behavior

Build gets canceled and error is reported: error : No tests found for Mono AOT compilation.

@ghost ghost assigned matouskozak Jan 12, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 12, 2024
@matouskozak matouskozak added area-Infrastructure-mono and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jan 12, 2024
@ghost
Copy link

ghost commented Jan 12, 2024

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

Report MSBuild error when compiling selected runtime tests with mono_fullaot and no suitable tests are found.

Motivation

This can happen when locally building selected tests that are disabled in issues.targets. This causes:

  1. Because TestExclusions contain the selected tests, TestScripts won't be created.
    <TestScripts Include="@(AllTestScripts)" Exclude="@(TestExclusions)" />
  2. This subsequently causes TestDirs to no exists, leading to enumarating all dlls on the disk (/**/*.dll) in
    <TestsAndAssociatedAssemblies Include="%(TestDirs.Identity)/**/*.dll" Exclude="@(NoMonoAotAssemblyPaths)" />

Previous behavior

Build doesn't get stopped and the following warning is reported:

MSBUILD : warning MSB5029: The value "/**/*.dll" of the "Include" attribute in element <ItemGroup> in file "<RUNTIME_ROOT>runtime/src/tests/build.proj (122,37)" is a wildcard that results in enumerating all files on the drive, which was likely not intended. Check that referenced properties are always defined.

New behavior

Build gets canceled and error is reported: error : No tests found for Mono AOT compilation.

Author: matouskozak
Assignees: matouskozak
Labels:

area-Infrastructure-mono, needs-area-label

Milestone: -

Copy link
Member

@ivanpovazan ivanpovazan left a comment

Choose a reason for hiding this comment

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

LGTM!

Only two nits:

  1. Would it make sense to check on TestAssemblies instead, as there is already a condition filtering out paths that exist on line 115?
  2. Maybe the error message can include additional information about tests exclusions, something like: ... Make sure that desired test cases are not excluded from AOT compilation

@matouskozak matouskozak merged commit f6824bc into dotnet:main Jan 19, 2024
101 checks passed
tmds pushed a commit to tmds/runtime that referenced this pull request Jan 23, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants