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

Opencover Report Generator #46

Closed
kedigby opened this issue Apr 16, 2018 · 4 comments
Closed

Opencover Report Generator #46

kedigby opened this issue Apr 16, 2018 · 4 comments

Comments

@kedigby
Copy link

kedigby commented Apr 16, 2018

I've been using the report generator by danielpalme, to visualise the output from coverlet.

https://github.com/danielpalme/ReportGenerator

I get errors using this tool since upgrading from 1.0.2 to 1.1.0, I wonder if there is an error in the file being produced, I get the same error message if I try cobertura.

I have reverted back to 1.02 and the reporting tool works.

The error message from the reporting tool was:

Error in Report Generator: Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Palmmedia.ReportGenerator.Parser.OpenCoverParser.GetBranches(XElement[] methods, HashSet1 fileIds)
at Palmmedia.ReportGenerator.Parser.OpenCoverParser.ProcessFile(HashSet1 fileIds, Class class, String filePath) at Palmmedia.ReportGenerator.Parser.OpenCoverParser.ProcessClass(Dictionary2 fileIdsByFilename, Assembly assembly, String className)
at Palmmedia.ReportGenerator.Parser.OpenCoverParser.<>c__DisplayClass12_0.b__9(String className)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_01.<ForWorker>b__1() at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable1 source, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable1 source, Action1 body)
at Palmmedia.ReportGenerator.Parser.OpenCoverParser.ProcessAssembly(String assemblyName)
at Palmmedia.ReportGenerator.Parser.OpenCoverParser.<.ctor>b__5_5(String assemblyName)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_01.<ForWorker>b__1() at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable1 source, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable1 source, Action1 body)
at Palmmedia.ReportGenerator.Parser.OpenCoverParser..ctor(XContainer report)
at Palmmedia.ReportGenerator.Parser.ParserFactory.GetParsersOfFile(String reportFile, ClassSearcherFactory classSearcherFactory, ClassSearcher globalClassSearcher)
at Palmmedia.ReportGenerator.Parser.ParserFactory.CreateParser(IEnumerable1 reportFiles, IEnumerable1 sourceDirectories)
at Palmmedia.ReportGenerator.Generator.GenerateReport(ReportConfiguration reportConfiguration)
at Palmmedia.ReportGenerator.Program.Main(String[] args)`

@tonerdo
Copy link
Collaborator

tonerdo commented Apr 16, 2018

Can I see the error generated when you try to run a report on the Cobertura output? I'm trying to figure out if this is a Coverlet issue

@xakep139
Copy link

@tonerdo I've faced similar problem with genhtml (from lcov). Prior to coverlet 1.1.0 the coverage.info file (generated with dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov) looks like

SF:/builds/ams/vstore/src/VStore.Http.Core/Swashbuckle/ImplicitApiVersionParameter.cs
DA:23,0
DA:27,0
end_of_record

After updating to 1.1.0 coverage.info contains:

SF:/builds/ams/vstore/src/VStore.Host/ActionResults/LockedResult.cs
DA:7,Coverlet.Core.LineInfo
DA:9,Coverlet.Core.LineInfo
end_of_record

And with that coverage.info file I get error:

# genhtml coverage.info
genhtml: ERROR: no valid records found in tracefile coverage.info

After replacing Coverlet.Core.LineInfo with 0, there are no errors

@kedigby
Copy link
Author

kedigby commented Apr 17, 2018

I was wondering if it's related to the utf16 issue?

And then I double checked the error message for the Cobertura output:

Loading report 'C:\Development\GFS_Seeker\Core.Net\Core\DataAccess.Test\coverage.xml' Error during reading report 'C:\Development\GFS_Seeker\Core.Net\Core\DataAccess.Test\coverage.xml': There is no Unicode byte order mark. Cannot switch to Unicode. Initializing report builders for report types: Html Analyzing 0 classes Creating summary Report generation took 0.3 seconds

I can provide the coverage.xml file if that will help?

@tonerdo
Copy link
Collaborator

tonerdo commented Apr 17, 2018

New NuGet bits: https://www.nuget.org/packages/coverlet.msbuild/1.1.1

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

No branches or pull requests

3 participants