gojuno / composer

Reactive Android Instrumentation Test Runner. Archived. Marathon is recommended as an alternative (https://github.com/Malinskiy/marathon).
Apache License 2.0
546 stars 45 forks source link

Execution Lacks Graceful handling of `exit 1` #176

Open dannybduval opened 4 years ago

dannybduval commented 4 years ago

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.

CristianGM commented 4 years ago

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

dannybduval commented 4 years ago

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.