Git Product home page Git Product logo

Comments (9)

lucaslorentz avatar lucaslorentz commented on May 20, 2024

Nice diagnosis. I guess it should track assemblies by path, not just assembly name.

I will create a PR to fix it. Thanks

from minicover.

lucaslorentz avatar lucaslorentz commented on May 20, 2024

@Quickstream , it should be fixed now.

Can you please try the new nuget package: MiniCover 2.0.0-ci-20180211032654 ?

from minicover.

Quickstream avatar Quickstream commented on May 20, 2024

Hi,

I gave the new version I try. At first, it seemed to be working, but after a few attempts I ended getting the following error:

Unhandled Exception: System.ArgumentException: An item with the same key has already been added. Key:
at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException(Object key)
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer`1 comparer)
at MiniCover.Reports.BaseReport.Execute(InstrumentationResult result, Single threshold)
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at MiniCover.Program.Main(String[] args)
...: warning MSB3073: The command "dotnet minicover htmlreport --workdir ../ --threshold 80" exited with code 134.

If I look at the coverage.json file, I see 2 entries for the same assembly in the "Assemblies" array, each of which has one entry in the "Locations" array. I think the expected result would be one entry in the Assemblies array with 2 entries in the Locations array.

from minicover.

Quickstream avatar Quickstream commented on May 20, 2024

Running dotnet build immediately prior to instrumentation didn't resolve the issue, but running dotnet clean, then dotnet build prior to instrumentation did resolve the issue.

However, if I then ran dotnet build on just my IntegrationTests project and then tried instrumentation again, I was able to reproduce the issue.

from minicover.

lucaslorentz avatar lucaslorentz commented on May 20, 2024

It creates 2 entries with same assembly because the assembly files are binary different, so the instrumentation might be different. Maybe one is obsolete after you partially built the solution.

It happens that even rebuilding an assembly from same source code, it will generate a different binary because there are some compilation timestamps inside the assembly.

I can fix the report to nicely handle the duplicated assembly on coverage.json. But I'm still not sure if that's a good approach. Maybe I will need to do a more fundamental change.

from minicover.

lucaslorentz avatar lucaslorentz commented on May 20, 2024

@Quickstream, that issue with report should be fixed on build: MiniCover 2.0.0-ci-20180214071708

Edit:
The only time I copied the Nuget version before the build finishes it failed to push nuget package 😄
https://travis-ci.org/lucaslorentz/minicover/builds/341312354

Use this version instead: MiniCover 2.0.0-ci-20180214203020

from minicover.

lucaslorentz avatar lucaslorentz commented on May 20, 2024

@Quickstream can we close this issue?

from minicover.

Quickstream avatar Quickstream commented on May 20, 2024

Sorry I'm on vacation. I haven't had a chance to try the latest build yet.

from minicover.

lucaslorentz avatar lucaslorentz commented on May 20, 2024

Should be fixed by now. Please, reopen the issue if necessary.

from minicover.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.