Skip to content

Benchmark validation doesn't appear to be working on non-Windows OS #46495

@JamesNK

Description

@JamesNK

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Benchmarks written with benchmarkdotnet are validated on build:

<Target Name="ValidateBenchmarks" BeforeTargets="Test" Condition="'$(IsMicrobenchmarksProject)' == 'true' AND '$(SkipMicrobenchmarksValidation)' != 'true'">
<Message Text="%0ARunning benchmark validation for:%0A$(MSBuildProjectName)%0A"
Importance="High" />
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="GetTargetPath">
<Output TaskParameter="TargetOutputs" PropertyName="ExecPath" />
</MSBuild>
<Exec Command="dotnet $(ExecPath) -f * --validate-fast" IgnoreStandardErrorWarningFormat="true" StandardOutputImportance="low" />
</Target>

It appears that failures are only correctly reported on Windows. This behavior was noticed when I added a benchmark that is only valid for Windows, but tests all passed.

For example, I added an exception to a benchmark's setup here - #46491 - and only Windows tests failed:

image

I can see in the logs that they are being detected and run on other OS, but no error reported:

image

Expected Behavior

Validation reports problems and the build fails on Linux and macOS.

Steps To Reproduce

#46491

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-infrastructureIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared frameworkbugThis issue describes a behavior which is not expected - a bug.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions