composer icon indicating copy to clipboard operation
composer copied to clipboard

Execution Lacks Graceful handling of `exit 1`

Open dannybduval opened this issue 5 years ago • 2 comments

In a Gradle setting, it would be great to be able to have exit 1 handled as I may make other tasks dependent on this. for example, I may want to run testDebugComposer

For example, I may define:


project.task(testDebugCustomIntegrationTest, type: DefaultTask, dependsOn: [testDebugComposer, clearConnectedDevices])

project.task(clearConnectedDevices, type: ClearDevicesTask, dependsOn: testDebugComposer) {
  mustRunAfter testDebugComposer
}

testDebugCustomIntegrationTest is a task I've created so that developers can simply run ./gradlew testDebugCustomIntegrationTest and have testDebugComposer run and then clearConnectedDevices.

Such set ups are helpful for CI so that I can ensure that each run will get a clean emulator.

having testDebugComposer makes it so that clearConnectedDevices even though I do ./gradlew testDebugCustomIntegrationTest --continue

I could get around it other ways, but those start to get more difficult to maintain in Gradle.

dannybduval avatar Sep 19 '19 19:09 dannybduval

You are speaking of Gradle while this repository doesn't know about Gradle, is the issues for https://github.com/trevjonez/composer-gradle-plugin ?

CristianGM avatar Sep 23 '19 11:09 CristianGM

I could open it there, but ultimately all it does is execute its own DSL over the composer tool itself. It'd be the same thing I'd do with the JAR if the Gradle plug in hadn't been created.

Fundamentally, runAllTests and any Observable added lack any fundamental error handling and it'll just pump back out to the command line with an ungraceful exit 1 scenario.

Even if you were to look at the default set of scripts Spoon had, there was a good amount of graceful error handling so that an error in Spoon wouldn't cause the entire phase of the CI to fail.

I'd say that it's a basic fundamental of anything that can be added to a Gradle build script - --continue should allow all tasks attached to run to completion and not stop in the middle because one dependency wasn't handling exit 1.

dannybduval avatar Sep 23 '19 12:09 dannybduval