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

Multiple CoverletOutputFormat #12

Closed
VladislavAntonyuk opened this issue Nov 16, 2018 · 3 comments
Closed

Multiple CoverletOutputFormat #12

VladislavAntonyuk opened this issue Nov 16, 2018 · 3 comments
Assignees

Comments

@VladislavAntonyuk
Copy link

VladislavAntonyuk commented Nov 16, 2018

Add support to setup List<CoverletOutputFormat>

CoverletOutputFormats = new List<CoverletOutputFormat> {
CoverletOutputFormat.opencover,
CoverletOutputFormat.covertura
};
@Romanx
Copy link
Owner

Romanx commented Nov 17, 2018

Hi there,

You can support multiple coverlet formats by providing them like this:

var coveletSettings = new CoverletSettings {
        CollectCoverage = true,
        CoverletOutputFormat = CoverletOutputFormat.opencover | CoverletOutputFormat.covertura,
        CoverletOutputDirectory = Directory(@".\coverage-results\"),
        CoverletOutputName = $"results-{DateTime.UtcNow:dd-MM-yyyy-HH-mm-ss-FFF}"
    };

Or by using the method on the settings class like this:

var coveletSettings = new CoverletSettings {
        CollectCoverage = true,
        CoverletOutputFormat = CoverletOutputFormat.opencover,
        CoverletOutputDirectory = Directory(@".\coverage-results\"),
        CoverletOutputName = $"results-{DateTime.UtcNow:dd-MM-yyyy-HH-mm-ss-FFF}"
    }.WithFormat(CoverletOutputFormat.covertura);

I'll use this issue as a note to improve the documentation in the readme. Thanks

@Romanx Romanx self-assigned this Nov 17, 2018
@VladislavAntonyuk
Copy link
Author

Great!, thnak you, I will close the issue after you add documentation

Romanx added a commit that referenced this issue Dec 2, 2018
Romanx added a commit that referenced this issue Dec 2, 2018
Romanx added a commit that referenced this issue Dec 2, 2018
@Romanx Romanx closed this as completed in 4d86d07 Dec 2, 2018
@Roemer
Copy link

Roemer commented Aug 27, 2019

This does not work for us. How about providing a placeholder (like %format%) in the CoverletOutputName that is automatically replaced with the defined format.
So we could use:

CoverletOutputName = $"{projectName}-%format%.xml"

to generate xxx-opencover.xml and xxx-cobertura.xml and we would not need to rely on timestamps anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants