Romanx / Cake.Coverlet

Coverlet extensions for Cake Build
MIT License
40 stars 15 forks source link

DotNetCoreTest overwrites prior defined arguments #2

Closed cmenzi closed 6 years ago

cmenzi commented 6 years ago

When using the DotNetCoreTest in conjunction with CoverletSettings the previous defined arguments are thrown away.

    var settings = new DotNetCoreTestSettings {
        Configuration = configuration,
        OutputDirectory = outputDir,
        NoBuild = true,
        ArgumentCustomization = args => args.Append("-l trx")
                                            .Append($"-r {testResultsDir.ToString()}")
    };
    var coverletSettings = new CoverletSettings {
        CollectCoverage = !skipCoverage,
        CoverletOutputFormat = CoverletOutputFormat.opencover,
        CoverletOutputDirectory = testResultsDir,
        CoverletOutputName = $"coverage"
    };
    DotNetCoreTest(project.FullPath, settings, coverletSettings);

The args -l trx -r testresults gets no appended anymore.

I think the bad line is https://github.com/Romanx/Cake.Coverlet/blob/master/src/Cake.Coverlet/CoverletAliases.cs#L34 where you overwrite the delegate.

Romanx commented 6 years ago

Hi there,

I thought that might happen. I'll fix it and get a release out tonight. Thanks for reporting it!

Romanx commented 6 years ago

@cmenzi I've made the fix and it's currently in the 1.1 feature branch. It's currently held up by #1 but as soon as I decide how to handle that edge case i'll release a fix. Thanks

Romanx commented 6 years ago

@cmenzi this has just been released to nuget. Pleae let me know if you have any issues.