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

HideColumns + custom corerun = incorrect table markdown #2545

Closed
EgorBo opened this issue Mar 16, 2024 · 2 comments · Fixed by #2565
Closed

HideColumns + custom corerun = incorrect table markdown #2545

EgorBo opened this issue Mar 16, 2024 · 2 comments · Fixed by #2565

Comments

@EgorBo
Copy link
Member

EgorBo commented Mar 16, 2024

Minimal repro:

using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;

BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);

[HideColumns("Job", "StdDev", "RatioSD")]
public class MyBench
{
    [Benchmark]
    public bool Test() => true;
}

If I run this benchmark with a custom corerun, e.g.:

dotnet run -c Release -- --filter "*" --coreRun Path\to\corerun.exe

it outputs this:

| Method | Mean      | Error     |
|------- |----------:|----------:|-
| Test   | 0.0062 ns | 0.0042 ns |

that trailing |- on the 2nd row makes the whole markdown invalid, e.g. here is what happens if I paste it here:

| Method | Mean | Error |
|------- |----------:|----------:|-
| Test | 0.0062 ns | 0.0042 ns |

While it should be:

Method Mean Error
Test 0.0062 ns 0.0042 ns

I can try to fix it myself unless you know that it can be trivially fixed 🙂

@adamsitnik
Copy link
Member

cc @YegorStepanov who contributed this feature in #1890

@timcassell
Copy link
Collaborator

timcassell commented Mar 18, 2024

Possibly introduced in #2410. cc @Vahdanian

AumkarGorde added a commit to AumkarGorde/BenchmarkDotNet that referenced this issue Apr 20, 2024
timcassell added a commit that referenced this issue Apr 28, 2024
* Fix -  incorrect table markdown #2545

* Hide Column Table Markdown test case

* columHidingRules support for CreateSummary in MockFactory

* made the test case more generic to support hide columns attribute

* Update tests/BenchmarkDotNet.Tests/Exporters/MarkdownExporterVerifyTests.cs

---------

Co-authored-by: Tim Cassell <35501420+timcassell@users.noreply.github.com>
@timcassell timcassell added this to the v0.14.0 milestone Apr 28, 2024
@timcassell timcassell linked a pull request Apr 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants