Open volkovandr opened 5 years ago
BTW, the version 3.1.3 does not work with 2.13 either. Complains about
> No signature of method: static scoverage.IOUtils.invoked() is applicable for argument types: (scala.collection.convert.JavaCollectionWrappers$JListWrapper) values: [Buffer(/home/user/project/build/scoverage/scoverage.measurements.12)]
Possible solutions: invoked(scala.collection.immutable.Seq)
version 4.0.1 still does not work with scala 2.13:
* What went wrong:
Execution failed for task ':reportTestScoverage'.
> 'scala.collection.convert.Decorators$AsScala scala.collection.JavaConverters.asScalaBufferConverter(java.util.List)'
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':reportTestScoverage'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:187)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:166)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:374)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:361)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:354)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:340)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: java.lang.NoSuchMethodError: 'scala.collection.convert.Decorators$AsScala scala.collection.JavaConverters.asScalaBufferConverter(java.util.List)'
at org.scoverage.ScoverageWriter.write(ScoverageWriter.java:79)
at org.scoverage.ScoverageWriter$write.call(Unknown Source)
at org.scoverage.ScoverageReport$_report_closure1.doCall(ScoverageReport.groovy:58)
at org.scoverage.ScoverageReport$_report_closure1.doCall(ScoverageReport.groovy)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.scoverage.ScoverageRunner.run(ScoverageRunner.groovy:32)
at org.scoverage.ScoverageRunner$run.call(Unknown Source)
at org.scoverage.ScoverageReport.report(ScoverageReport.groovy:41)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:721)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:688)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:539)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:524)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:507)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:109)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:258)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:247)
at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:63)
at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:34)
at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44)
at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:153)
at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:67)
at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:41)
at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92)
at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:174)
... 30 more
Note: scala 2.13 has methodscala.collection.JavaConverters.asScalaBufferConverter(java.util.List)
but the return type is scala.collection.JavaConverters$AsScala
, not scala.collection.convert.Decorators$AsScala
as in 2.11, 2.12
We can fix this by change in ScoverageWriter.write
:
- Buffer<File> sources = JavaConverters.asScalaBufferConverter(Arrays.asList(sourceDir)).asScala();
+ Buffer<File> sources = JavaConverters.asScalaBuffer(Arrays.asList(sourceDir));
Hello, I was wondering if somebody is looking into this issue. Thanks!
@eschizoid This depends on a change to the scalac plugin, and it looks like the development on the scalac plugin has gone silent in the past few months.
@eyalroth I think my error is not related to the problem you mentioned:
Caused by: java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)Ljava/lang/Object;
at scoverage.report.CoverageAggregator$.aggregate(CoverageAggregator.scala:15)
Could this be a different problem?
@maiflai Maybe you know the answer since its failing here?
object CoverageAggregator {
...
// to be used by gradle-scoverage plugin
def aggregate(dataDirs: Array[File]): Option[Coverage] = aggregate(dataDirs.toSeq)
...
}
Thanks!
Is there any update on this issue? I am running into the same problem with scoverage plugin version 4.0.1 and scala version 2.13.1.
And...what about writing the Writer in Scala? Wouldn't that fix the issue?
is there a release planed to fix this issue?
I think using Scala in the Gradle plugin makes the plugin classpath difficult; this has been discussed before.
A PR for this has been merged in scalac-scoverage-plugin but we now need a release there before the Gradle plugin can use it.
Stu.
I think using Scala in the Gradle plugin makes the plugin classpath difficult; this has been discussed before.
It will require to compile and publish the plugin for every major Scala version, which makes both the development and usage of it a bit more complicated.
@maiflai scalac-scoverage-plugin 1.4.2 has been released.
so has the updated version of this plugin - please could you try 5.0.0?
I updated to Scoverage 5.0.0 and the scalac-scoverage-plugin 1.4.2. I'm not getting any errors (yay!) but neither do I get any output. Though I would be hard pressed to prove it wasn't a problem with the configuration. Any Scoverage task that I try and run gets skipped.
build.gradle:
/*
* Copyright (C) 2020, Donald McLean. All rights reserved.
*
* This program and the accompanying materials are licensed under
* the terms of the GNU General Public License version 3.0
* as published by the Free Software Foundation.
*/
plugins {
id 'java'
id 'scala'
id "org.scoverage" version "5.0.0"
id "com.github.maiflai.scalatest" version "0.30"
}
group 'org.primitive'
version '0.1.0'
repositories {
mavenCentral()
}
test {
suite 'org.primitive.MasterSuite'
}
dependencies {
testRuntime 'com.vladsch.flexmark:flexmark-all:0.35.10'
compile group: 'org.scala-lang', name: 'scala-library', version: '2.13.4'
compile group: 'org.scala-lang.modules', name: 'scala-xml_2.13', version: '1.3.0'
compile group: 'net.liftweb', name: 'lift-actor_2.13', version: '3.4.3'
compile group: 'net.liftweb', name: 'lift-util_2.13', version: '3.4.3'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
compile group: 'org.neo4j.driver', name: 'neo4j-java-driver', version: '4.0.3'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.11'
testCompile group: 'org.scalatest', name: 'scalatest_2.13', version: '3.2.2'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.6.2'
scoverage group: 'org.scoverage', name: 'scalac-scoverage-plugin_2.13', version: '1.4.2'
scoverage group: 'org.scoverage', name: 'scalac-scoverage-runtime_2.13', version: '1.4.2'
}
Here's the output from the relevant section with --debug:
2020-12-14T23:46:49.945-0500 [QUIET] [system.out] Run completed in 9 seconds, 748 milliseconds. 2020-12-14T23:46:49.945-0500 [QUIET] [system.out] Total number of tests run: 25 2020-12-14T23:46:49.945-0500 [QUIET] [system.out] Suites: completed 27, aborted 0 2020-12-14T23:46:49.945-0500 [QUIET] [system.out] Tests: succeeded 25, failed 0, canceled 0, ignored 0, pending 0 2020-12-14T23:46:49.945-0500 [QUIET] [system.out] All tests passed. 2020-12-14T23:46:50.080-0500 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: SUCCEEDED 2020-12-14T23:46:50.083-0500 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Execute doLast {} action for :test' completed 2020-12-14T23:46:50.086-0500 [DEBUG] [org.gradle.api.internal.tasks.execution.DefaultTaskSnapshotter] Snapshotting property binaryResultsDirectory (Output) for task ':test' 2020-12-14T23:46:50.092-0500 [DEBUG] [org.gradle.api.internal.tasks.execution.DefaultTaskSnapshotter] Snapshotting property reports.enabledReports.html.outputLocation (Output) for task ':test' 2020-12-14T23:46:50.108-0500 [DEBUG] [org.gradle.api.internal.tasks.execution.DefaultTaskSnapshotter] Snapshotting property reports.enabledReports.junitXml.outputLocation (Output) for task ':test' 2020-12-14T23:46:50.143-0500 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Snapshot outputs after executing task ':test'' completed 2020-12-14T23:46:50.148-0500 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Removed task artifact state for task ':test' from context. 2020-12-14T23:46:50.151-0500 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Task :test' 2020-12-14T23:46:50.151-0500 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Task :test' completed 2020-12-14T23:46:50.151-0500 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 644: dispatching BuildEvent[event=org.gradle.internal.build.event.types.DefaultTaskFinishedProgressEvent@782d912f] 2020-12-14T23:46:50.152-0500 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :test (Thread[Execution worker for ':' Thread 3,5,main]) completed. Took 12.859 secs. 2020-12-14T23:46:50.153-0500 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :test finished executing 2020-12-14T23:46:50.156-0500 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :test completed, executed: true 2020-12-14T23:46:50.159-0500 [DEBUG] [org.gradle.execution.plan.Node] Checking if all dependencies are complete for :reportTestScoverage 2020-12-14T23:46:50.159-0500 [DEBUG] [org.gradle.execution.plan.Node] All dependencies are complete for :reportTestScoverage 2020-12-14T23:46:50.159-0500 [DEBUG] [org.gradle.execution.plan.TaskNode] Checking if all must successors are complete for :reportTestScoverage 2020-12-14T23:46:50.159-0500 [DEBUG] [org.gradle.execution.plan.TaskNode] Checking if all finalizing successors are complete for :reportTestScoverage 2020-12-14T23:46:50.160-0500 [DEBUG] [org.gradle.execution.plan.TaskNode] All task dependencies are complete for :reportTestScoverage 2020-12-14T23:46:50.160-0500 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 3: released lock on : 2020-12-14T23:46:50.164-0500 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.10 completed (1 worker(s) in use) 2020-12-14T23:46:50.165-0500 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 3: released lock on root.1.10 2020-12-14T23:46:50.175-0500 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 3: acquired lock on : 2020-12-14T23:46:50.177-0500 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.10 started (1 worker(s) in use). 2020-12-14T23:46:50.177-0500 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 3: acquired lock on root.1.10 2020-12-14T23:46:50.179-0500 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :reportTestScoverage (Thread[Execution worker for ':' Thread 3,5,main]) started. 2020-12-14T23:46:50.181-0500 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Task :reportTestScoverage' started 2020-12-14T23:46:50.188-0500 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 644: dispatching BuildEvent[event=org.gradle.internal.build.event.types.DefaultTaskStartedProgressEvent@487ffbc3] 2020-12-14T23:46:50.187-0500 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 2020-12-14T23:46:50.187-0500 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :reportTestScoverage SKIPPED 2020-12-14T23:46:50.200-0500 [INFO] [org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter] Skipping task ':reportTestScoverage' as task onlyIf is false.
Sorry for the delay.
reportTestScoverage
should be run after testScoverage
, rather than test
. Perhaps this is being tripped up by the use of a suite-specific test
task?
Please could you try changing
test {
suite 'org.primitive.MasterSuite'
}
to
tasks.withType(Test) {
suite 'org.primitive.MasterSuite'
}
Or perhaps you could just try adding
testScoverage {
suite 'org.primitive.MasterSuite'
}
Now worries, I've got plenty of things to keep me busy. I appreciate the assistance.
So that last one, adding:
testScoverage {
suite 'org.primitive.MasterSuite'
}
A problem occurred evaluating root project 'primitive'.
Could not find method testScoverage() for arguments [build_6q5pscphbcd1jk2w2wpytjhd5$_run_closure3@5893c137] on root project 'primitive' of type org.gradle.api.Project.
The other suggestion gets past the build file verification, but :compileScoverageScala fails with 100 compile errors - it isn't recognizing references to some classes in my code. My first guess would be that it sounds like a class path problem, but a cursory glance the classpath seems ok (it's long enough that it's hard to know)
2020-12-27T23:03:47.898-0500 [DEBUG] [org.gradle.api.internal.tasks.scala.ZincScalaCompilerFactory] [zinc] The Scala compiler is invoked with: -deprecation -unchecked -P:scoverage:dataDir:/Users/dmclean/IdeaProjects/primitive/primitive/build/scoverage -Yrangepos -Xplugin:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scoverage/scalac-scoverage-plugin_2.13/1.4.2/344bc701d60068d93e26b5d3fb4f7003db53520e/scalac-scoverage-plugin_2.13-1.4.2.jar -bootclasspath /Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.13.4/b6781c71dfe4a3d5980a514eec8a513f693ead95/scala-library-2.13.4.jar -classpath /Users/dmclean/.gradle/caches/modules-2/files-2.1/net.liftweb/lift-util_2.13/3.4.3/efe07406b191f2c2d7138daa9d34f94995c24927/lift-util_2.13-3.4.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/net.liftweb/lift-actor_2.13/3.4.3/9090c7496c00a72060de19a9e620ec30eed357df/lift-actor_2.13-3.4.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/net.liftweb/lift-common_2.13/3.4.3/ae3c63f0b3b35a67ddc44c39f267f2d232241213/lift-common_2.13-3.4.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/net.liftweb/lift-json_2.13/3.4.3/1332347e2f87331bf1684a27a46abbda038b5f0c/lift-json_2.13-3.4.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/net.liftweb/lift-markdown_2.13/3.4.3/bbc0b4ebaf4e156c560a51a7035e764a02b81bed/lift-markdown_2.13-3.4.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.13/1.3.0/1db2b0fb6f454a9d34971b47158ee9dbe85d4eca/scala-xml_2.13-1.3.0.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang/scalap/2.13.2/1c6007f76b1d33c3111a3087dec1ce387a4358e6/scalap-2.13.2.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-compiler/2.13.2/c6cfcfc333a4c37a3445aec11a90a22bb1b8f35b/scala-compiler-2.13.2.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-parser-combinators_2.13/1.1.2/1c591dfd20e117ecd0931de1a7ba12145dc83645/scala-parser-combinators_2.13-1.1.2.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.13.2/2a6dd4989a27aba0dd43bc297045cff633d70064/scala-reflect-2.13.2.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.13.4/b6781c71dfe4a3d5980a514eec8a513f693ead95/scala-library-2.13.4.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/7c4f3c474fb2c041d8028740440937705ebb473a/logback-classic-1.2.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.30/b5a4b6d16ab13e34a88fae84c35cd5d68cac922c/slf4j-api-1.7.30.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.neo4j.driver/neo4j-java-driver/4.2.0/5fda32f7a193b2676e5ecfaa633fe602d722f43b/neo4j-java-driver-4.2.0.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.11/68e9a6adf7cf8eb7e9d31bbc554c7c75eeaac568/commons-lang3-3.11.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/joda-time/joda-time/2.10/f66c8125d1057ffce6c4e29e624cac863e110e2b/joda-time-2.10.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.joda/joda-convert/2.1/c1d279eba70c97624dbecf520842e674bd348534/joda-convert-2.1.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.11/3acb4705652e16236558f0f4f2192cc33c3bd189/commons-codec-1.11.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/javax.mail/mail/1.4.7/9add058589d5d85adeb625859bf2c5eeaaedf12d/mail-1.4.7.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/nu.validator/htmlparser/1.4.12/31ce5cbe6687a7ad11ae3d209569ab081fb485c3/htmlparser-1.4.12.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/xerces/xercesImpl/2.11.0/9bb329db1cfc4e22462c9d6b43a8432f5850e92c/xercesImpl-2.11.0.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.mindrot/jbcrypt/0.4/af7e61017f73abb18ac4e036954f9f28c6366c07/jbcrypt-0.4.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.3/864344400c3d4d92dfeb0a305dc87d953677c03c/logback-core-1.2.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.reactivestreams/reactive-streams/1.0.3/d9fb7a7926ffa635b3dcaa5049fb2bfa25b3e7d0/reactive-streams-1.0.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.jline/jline/3.14.1/eb84f44d0f8494a3d3b6200f69b58f9f8104ac9f/jline-3.14.1.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/5.3.1/6eb9d07456c56b9c2560722e90382252f0f98405/jna-5.3.1.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/com.thoughtworks.paranamer/paranamer/2.8/619eba74c19ccf1da8ebec97a2d7f8ba05773dd6/paranamer-2.8.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/javax.activation/activation/1.1/e6cb541461c2834bdea3eb920f1884d1eb508b50/activation-1.1.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/xml-apis/xml-apis/1.4.01/3789d9fada2d3d458c4ba2de349d48780f381ee3/xml-apis-1.4.01.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scoverage/scalac-scoverage-plugin_2.13/1.4.2/344bc701d60068d93e26b5d3fb4f7003db53520e/scalac-scoverage-plugin_2.13-1.4.2.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scoverage/scalac-scoverage-runtime_2.13/1.4.2/b76c5bc11dc491f7474ecdd94ce1a95b1e88c013/scalac-scoverage-runtime_2.13-1.4.2.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-compiler/2.13.3/73ec4478475a863cd4e9fd46ae7dd600c0daeee5/scala-compiler-2.13.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.13/1.2.0/f6abd60d28c189f05183b26c5363713d1d126b83/scala-xml_2.13-1.2.0.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.13.3/eb08a460df09947c423e5ce77b3d4af566085f1/scala-reflect-2.13.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.13.3/1431ec9962701faf77bbd5e1449ded674be6fe5b/scala-library-2.13.3.jar:/Users/dmclean/.gradle/caches/modules-2/files-2.1/org.jline/jline/3.15.0/6c8d38639ac26de5ccb5bed947ce2fd40b7e2269/jline-3.15.0.jar:/Users/dmclean/IdeaProjects/primitive/primitive/build/classes/java/scoverage:/Users/dmclean/IdeaProjects/primitive/primitive/build/classes/scala/scoverage
If you want to experiment with it, the most recent version that compiles and all the tests pass is on GitHub: https://github.com/dmclean62/primitive
I am hitting this issue as well on Gradle 7.14, with v7.0.0 of the Scoverage gradle plugin, and v2.13.7 of scala and Java 11.0.13. This still seems to be an unresolved issue.
I think this particular issue is now being used for several different problems.
If you are using the gradle-scalatest
plugin, my first suggestion is that you migrate to using https://github.com/helmethair-co/scalatest-junit-runner.
If that is not possible because of a feature gap, then perhaps you could raise a new issue here with a simple reproduction of your particular problem?
Thanks, Stu
I've been digging a little deeper into this issue. It looks to me that the ScoverageAggregate.groovy could benefit from using JavaConversions as well, to prevent having to depend on an upstream overloaded method, which until recently had no test coverage.
I also think calling the upstream .aggregate()
Scala method is where our problem exists since we are passing a file collection rather than Seq[File]
. I suspect this was a design decision for dependency reduction, but as is it seems to be a problem for newer Scala versions.
Hello,
The plugin does not work with scala 2.13 because scala.collection.JavaConversions is not there any more.
build.gradle (removed unrelated stuff)
running with
./gradlew reportTestScoverage --stacktrace
and getting