Itiviti / gradle-nunit-plugin

A gradle plugin for launching NUnit tests
Apache License 2.0
17 stars 20 forks source link

Tasks fail for all NUnit version newer than version 3.0.1 #37

Closed darsen closed 7 years ago

darsen commented 8 years ago

Greetings,

When I run NUnit tasks with the following versions I am getting the exception noted below.

Gradle version is set to 3.1, NUnit was set to 3.5, and Gradle-nunit-plugin version 1.8

BUILD FAILED

timotei commented 8 years ago

Can you please paste the full log into a code ``` block so we can read it entirely? It seems it's cut. Alternatively redirect the output to a file and upload that. Thanks!

ngyukman commented 8 years ago

I think that should be the download plugin breaks in gradle 3, you will could use the latest version which fixed that in the mean time

But as it breaks the nonProxyHost settings it may have problem to some of the user

Bryce-L commented 7 years ago

I'm seeing the same thing. It's failing on 2/3 of the machines I've tried it on. Each machine has a different OS, so I'll go ahead and provide the version output just in case that's relevant.

It works on:

C:\Code\IpAddressWhitelisting>gradlew.bat --version

------------------------------------------------------------
Gradle 3.1
------------------------------------------------------------

Build time:   2016-09-19 10:53:53 UTC
Revision:     13f38ba699afd86d7cdc4ed8fd7dd3960c0b1f97

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_101 (Oracle Corporation 25.101-b13)
OS:           Windows 10 10.0 amd64

It fails on:

C:\Code\IpAddressWhitelisting>gradlew.bat --version

------------------------------------------------------------
Gradle 3.1
------------------------------------------------------------

Build time:   2016-09-19 10:53:53 UTC
Revision:     13f38ba699afd86d7cdc4ed8fd7dd3960c0b1f97

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_65 (Oracle Corporation 25.65-b01)
OS:           Windows 7 6.1 amd64

and

D:\Build.Workspaces\IpAddressWhitelisting>gradlew.bat --version

------------------------------------------------------------
Gradle 3.1
------------------------------------------------------------

Build time:   2016-09-19 10:53:53 UTC
Revision:     13f38ba699afd86d7cdc4ed8fd7dd3960c0b1f97

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_101 (Oracle Corporation 25.101-b13)
OS:           Windows Server 2012 R2 6.3 amd64

The stacktrace:

C:\Code\IpAddressWhitelisting>gradlew.bat --stacktrace
:nugetUpdateSource
Package source "ASInternal" was successfully updated.
:nugetAddSource SKIPPED
:nugetRestore
All packages listed in packages.config are already installed.
:patchAssemblyInfo
:msbuild
  IpAddressWhitelisting -> C:\Code\IpAddressWhitelisting\IpAddressWhitelisting\bin\Release\IpAddressWhitelisting.dll
  IpAddressWhitelisting.UnitTests -> C:\Code\IpAddressWhitelisting\IpAddressWhitelisting.UnitTests\bin\Release\IpAddressWhitelisting.UnitTests.dll
:unitTests FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':unitTests'.
> Lorg/gradle/logging/ProgressLogger;

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':unitTests'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:233)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:74)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:55)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:186)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:183)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:33)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:112)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:106)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:92)
        at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:66)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:79)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:51)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:59)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.HintGCAfterBuild.execute(HintGCAfterBuild.java:44)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:293)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.NoClassDefFoundError: Lorg/gradle/logging/ProgressLogger;
        at org.gradle.internal.metaobject.BeanDynamicObject.getMetaClass(BeanDynamicObject.java:139)
        at org.gradle.internal.metaobject.BeanDynamicObject.access$400(BeanDynamicObject.java:55)
        at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:379)
        at org.gradle.internal.metaobject.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:170)
        at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:59)
        at com.ullink.gradle.nunit.NUnit$_downloadNUnit_closure4.doCall(NUnit.groovy:108)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:70)
        at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:160)
        at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:106)
        at de.undercouch.gradle.tasks.download.DownloadExtension.configure(DownloadExtension.java:42)
        at de.undercouch.gradle.tasks.download.DownloadExtension.configure(DownloadExtension.java:29)
        at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:104)
        at org.gradle.util.ConfigureUtil$1.execute(ConfigureUtil.java:123)
        at org.gradle.api.internal.plugins.ExtensionsStorage$ExtensionHolder.configure(ExtensionsStorage.java:145)
        at org.gradle.api.internal.plugins.ExtensionsStorage.configureExtension(ExtensionsStorage.java:69)
        at org.gradle.api.internal.plugins.DefaultConvention$ExtensionsDynamicObject.invokeMethod(DefaultConvention.java:215)
        at org.gradle.internal.metaobject.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:96)
        at org.gradle.internal.metaobject.MixInClosurePropertiesAsMethodsDynamicObject.invokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:30)
        at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:163)
        at org.gradle.api.internal.project.DefaultProject_Decorated.invokeMethod(Unknown Source)
        at com.ullink.gradle.nunit.NUnit.downloadNUnit(NUnit.groovy:107)
        at com.ullink.gradle.nunit.NUnit.ensureNunitInstalled(NUnit.groovy:82)
        at com.ullink.gradle.nunit.NUnit.nunitBinFile(NUnit.groovy:65)
        at com.ullink.gradle.nunit.NUnit3Mixins.invokeMethod(NUnit3Mixins.groovy)
        at com.ullink.gradle.nunit.NUnit3Mixins.getNunitExec(NUnit3Mixins.groovy:42)
        at com.ullink.gradle.nunit.NUnit.testRun(NUnit.groovy:204)
        at com.ullink.gradle.nunit.NUnit$testRun$6.callCurrent(Unknown Source)
        at com.ullink.gradle.nunit.NUnit.singleRunExecute(NUnit.groovy:148)
        at com.ullink.gradle.nunit.NUnit.decideExecutionPath(NUnit.groovy:140)
        at com.ullink.gradle.nunit.NUnit$decideExecutionPath$4.callCurrent(Unknown Source)
        at com.ullink.gradle.nunit.NUnit.build(NUnit.groovy:135)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:136)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:129)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:118)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:623)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:606)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 68 more
Caused by: java.lang.ClassNotFoundException: org.gradle.logging.ProgressLogger
        ... 107 more

BUILD FAILED

Total time: 3.173 secs
Bryce-L commented 7 years ago

It looks like this was also a problem in gradle-download-task: https://github.com/michel-kraemer/gradle-download-task/issues/47. There may be some clues in there to help find a solution.

gluck commented 7 years ago

Did you try version 1.9 of gradle-nunit-plugin ? It should work.

Bryce-L commented 7 years ago

Sure enough, it does work in 1.9. Thanks! When I originally ran into this 1.8 was the latest. Guess I should have checked for a newer version before posting.

darsen commented 7 years ago

Version 1.9 works with NUnit 3.4.1. It still fails with NUnit 3.5: :unitTests (Thread[Daemon worker Thread 3,5,main]) started. :unitTests Putting task artifact state for task ':unitTests' into context took 0.003 secs. Task :unitTests class loader hash: b2f849af30a383f214e67424555fffd7 Task :unitTests actions class loader hash: 025cd5e4d561f7114857c06120bfe5df Executing task ':unitTests' (up-to-date check took 0.005 secs) due to: No history is available. Downloading & Unpacking NUnit 3.5 Invalid cookie header: "Set-Cookie: logged_in=no; domain=.github.com; path=/; expires=Fri, 14 Nov 2036 21:40:37 -0000; secure; HttpOnly". Invalid 'expires' attribute: Fri, 14 Nov 2036 21:40:37 -0000 :unitTests FAILED :unitTests (Thread[Daemon worker Thread 3,5,main]) completed. Took 0.483 secs.

ngyukman commented 7 years ago

Hi, I also just noticed that nunit 3.5 failed due to packaging changed.

ngyukman commented 7 years ago

Checking further it is because the download link is https://github.com/nunit/nunit/releases/download/3.5/NUnit-3.5.0.zip instead of https://github.com/nunit/nunit/releases/download/3.5.0/NUnit-3.5.0.zip

timotei commented 7 years ago

Latest 1.10 release should also fix NUnit 3.5 being used.