Skip to content

Using same JSON reports for single and aggregated analysis #145

@jimklimov

Description

@jimklimov

What feature do you want to see added?

Currently the JSON document (or a sum of several documents) used for a report has to include the whole structure, with id, items and colors.

The problem is that when trying to use same generated test-reports in different contexts, a "sum of JSONs" stumbles on protection against duplicate keys, even if they have identical values:

java.lang.IllegalStateException: Duplicate key Tests run (attempted merging values GREEN and GREEN)
	at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:135)
	at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:182)
	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
	at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at io.jenkins.plugins.reporter.model.Report.addColors(Report.java:206)
	at io.jenkins.plugins.reporter.model.Report.add(Report.java:118)
	at io.jenkins.plugins.reporter.util.FilesScanner.aggregateReport(FilesScanner.java:74)
	at io.jenkins.plugins.reporter.util.FilesScanner.scanFiles(FilesScanner.java:65)
	at io.jenkins.plugins.reporter.util.FilesScanner.invoke(FilesScanner.java:48)
	at io.jenkins.plugins.reporter.util.FilesScanner.invoke(FilesScanner.java:14)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3492)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:377)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

Upstream changes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement of existing functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions