stanfy / spoon-gradle-plugin

Gradle plugin for Spoon.
Apache License 2.0
353 stars 79 forks source link

Usage of SpoonRunTask fails with ShellCommandUnresponsiveException #103

Open rzetzsche opened 8 years ago

rzetzsche commented 8 years ago

I tried the usage of SpoonRunTask in my own task to generate screenshots and upload these to my webserver. But on execution i get an ShellCommandUnresponsiveException which i don't get when i execute the normal "gradlew spoon" command.

Additional to the issue, why is the testSize with SpoonRunTask not optional?

EDIT: Ok same adbTimeout value of 3000 causes different behaviours. "gradlew spoon" executes without error, executing my own task causes "ShellCommandUnresponsiveException". If I increase the time in my own task it executes without issues too. Maybe they use different time units?

roman-mazur commented 8 years ago

Timeout behaviour depends on what version of spoon runner you are using. The one that is probably in current plugin dependencies sets timeout to 0 if we do not specify any value explicitly. But if you replace it with a newer one, it should use a reasonable default value instead. https://github.com/square/spoon/pull/314#discussion_r51683768

As for testSize, it was design to accept explicit "all" value when we need all tests to be run.

rzetzsche commented 8 years ago

It could be that the default value differs. Nevertheless when i use SpoonRunnerTask or the normal plugin with spoon block than the adbTimeout value shows different behaviour.

spoon { debug = true // for debug output adbTimeout = 3000 }

This configuration and the gradle spoon command shows no ShellCommandUnresponsiveException.

task takeScreenshots(type: SpoonRunTask, dependsOn: ['assembleDebug', 'assembleAndroidTest']) { ... debug = true adbTimeout = 3000 }

This configuration and the gradle takeScreenshots command shows ShellCommandUnresponsiveException.

I think that shouldn't be a problem of the used spoon runner because both using the integrated spoon runner of the plugin, aren't they?

EDIT: Points out that the spoon configuration takes seconds, the SpoonRunnerTask takes milliseconds.

roman-mazur commented 8 years ago

Task uses ms: https://github.com/stanfy/spoon-gradle-plugin/blob/v1.0.4/src/main/groovy/com/stanfy/spoon/gradle/SpoonRunTask.groovy#L46-L47

Plugin extension uses seconds: https://github.com/stanfy/spoon-gradle-plugin/blob/v1.0.4/src/main/groovy/com/stanfy/spoon/gradle/SpoonExtension.groovy#L35-L37

On Wed, 6 Apr 2016 at 12:36 rzetzsche notifications@github.com wrote:

It could be that the default value differs. Nevertheless when i use SpoonRunnerTask or the normal plugin with spoon block than the adbTimeout value shows different behaviour.

spoon { debug = true // for debug output adbTimeout = 3000 }

This configuration and the gradle spoon command shows no ShellCommandUnresponsiveException.

task takeScreenshots(type: SpoonRunTask, dependsOn: ['assembleDebug', 'assembleAndroidTest']) { ... debug = true adbTimeout = 3000 }

This configuration and the gradle takeScreenshots command shows ShellCommandUnresponsiveException.

I think that shouldn't be a problem of the used spoon runner because both using the integrated spoon runner of the plugin, aren't they?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/stanfy/spoon-gradle-plugin/issues/103#issuecomment-206260016

rzetzsche commented 8 years ago

Thx, discover that seconds before your post. Maybe both should take the same time unit?