Rework "Not unique exporter for exporter type" PR#2155
Rework "Not unique exporter for exporter type" PR#2155YegorStepanov wants to merge 12 commits intodotnet:masterfrom
Conversation
…otnet#1796)" This reverts commit c1f210c
|
These benchmarks are manually checked: Click me[DryJob, MarkdownExporterAttribute.Atlassian]
public class MyTest1
{
[Benchmark] public void MyMethod() { }
}
// validator error
[CsvMeasurementsExporter(CsvSeparator.Semicolon)]
[RPlotExporter]
[DryJob]
public class MyTest2
{
[Benchmark] public void MyMethod() { }
}
[DryJob]
[MarkdownExporterAttribute.Atlassian]
[XmlExporterAttribute.Full]
[XmlExporterAttribute.Brief]
public class MyTest3
{
[Benchmark] public void MyMethod() { }
}
[DryJob]
[CustomExporter("Benchmark")]
public class MyTest4
{
[Benchmark] public void MyMethod() { }
}
public class CustomExporterAttribute : ExporterConfigBaseAttribute
{
public CustomExporterAttribute(string title) : base(new CustomExporter(title)) { }
}
public class CustomExporter : IExporter
{
private readonly string _title;
public CustomExporter(string title) => _title = title;
public string Id => GetType().Name;
public IEnumerable<string> ExportToFiles(Summary summary, ILogger consoleLogger)
{
Console.WriteLine($"{Id} - {_title}");
yield break;
}
public void ExportToLog(Summary summary, ILogger logger) { }
} |
|
I'm not at all sure about renaming ( I don't think anyone uses it so it one line change for customers. We will never be able to use "C# default interface implementation" due to .NET Framework? |
|
I am not very convinced of the solution. Because if you have developed custom exporters, no anomalies will be reported unless a validator is written. The original issue was not written to solve the RPlotExporter problem but to prevent problems like this from happening in the future. |
@workgroupengineering Could you write an example please? It covers your issue (#1700) If you mean about 'IExporterDependencies':
If the plots are rewritten in C#, |
|
Indeed, it would be better to remove |
|
I encountered problem #1700 during development a PR which allowed append result to csv artifact. The artifact was overwritten.
Probably is better solution remove I would keep |
Instead of making
|
|
@YegorStepanov, please don't forget individual names for the Markdown exporters. |
Fixes #1700
Problem
Starting with #1796 PR (#1700 issue), only one exporter per type can be.
This means that the following cases stopped working in 0.13.2:
Also, it means that it will never works:
Solution
IExporter.NameIExporter.Name->IExporter.IdbecauseNameis misleading, the other entities in BDN usesIdfor it:RPlotValidatorto check that user do not overridecsvseparator (Currently, all version of csv generates file with same name)