paraunit icon indicating copy to clipboard operation
paraunit copied to clipboard

--stop-on-error stop-on-failure implementation

Open ranpafin opened this issue 7 years ago • 3 comments

With most of the execution option behing ralyed tho the child processes here https://github.com/facile-it/paraunit/pull/57 it would be an interesting feature to have Paraunit handle further execution option, especially the ones that could make sense in the global execution or are non-relevant for the child processes.

In this case the the focus of this issue is on:

--stop-on-error 

To avoid misunderstanding and promote ease-of-use the behavior should be as similar as possible to the phpunit documentation:

--stop-on-error Stop execution upon first error. --stop-on-failure Stop execution upon first error or failure. --stop-on-risky Stop execution upon first risky test. --stop-on-skipped Stop execution upon first skipped test. --stop-on-incomplete Stop execution upon first incomplete test.

Contrary to phpunit, paraunit execution is parallel by definition and for this reason it's hard to actually stop all running process if on of them return an error.

In this case it could be a best effort and stop the spawning of new processes, disregarding the output of running ones and printing all accumulated output.

With this approach the original idea behind the --stop-on-error should be maintained as the execution will terminate with an ASAP policy.

ranpafin avatar Nov 11 '16 14:11 ranpafin

Since we have parsers for each of those kind of test outcome, we could give the responsability of dispatching events to those parsers. Then, the runner should be configured at runtime to stop execution if a requested kind of event is dispatched. Some of the refactoring inside #11 should help on this matter, since I made the container preparation later, there.

Do you think that those options should be also carried over to the single PHPUnit processes? (see #57)

Jean85 avatar Nov 11 '16 15:11 Jean85

@Jean85

Since we have parsers for each of those kind of test outcome, we could give the responsability of dispatching events to those parsers. Then, the runner should be configured at runtime to stop execution if a requested kind of event is dispatched. Some of the refactoring inside #11 should help on this matter, since I made the container preparation later, there.

Surely the right direction, we should delay this a little bit, Util the #11 is ready! I would add that the runner could listen to a "shutdown" (or terminate/complete etc..) event. While the parsers could fire their own context-based events (failure_detected, error_detected..) the shoutdown notification should be prompted by another module of the system in order to keep the parser agnostic to any of this logic.

Do you think that those options should be also carried over to the single PHPUnit processes? (see #57)

If the option is handled in the global context pushing it down to the childs processes won't change much. It could turn out to be useful if the single test execution is expensive. In that case the single process will exit faster. In any case, considering that the cost of passing along the option to the childs is very little i think it should be done.

ranpafin avatar Nov 11 '16 16:11 ranpafin

Since I merged #58, that comes practically for free!

Il ven 11 nov 2016, 17:13 Francesco Panina [email protected] ha scritto:

@Jean85 https://github.com/Jean85

Since we have parsers for each of those kind of test outcome, we could give the responsability of dispatching events to those parsers. Then, the runner should be configured at runtime to stop execution if a requested kind of event is dispatched. Some of the refactoring inside #11 https://github.com/facile-it/paraunit/issues/11 should help on this matter, since I made the container preparation later, there.

Surely the right direction, we should delay this a little bit, Util the #11 https://github.com/facile-it/paraunit/issues/11 is ready! I would add that the runner could listen to a "shutdown" (or terminate/complete etc..) event. While the parsers could fire their own context-based events (failure_detected, error_detected..) the shoutdown notification should be prompted by another module of the system in order to keep the parser agnostic to any of this logic.

Do you think that those options should be also carried over to the single PHPUnit processes? (see #57 https://github.com/facile-it/paraunit/pull/57)

If the option is handled in the global context pushing it down to the childs processes won't change much. It could turn out to be useful if the single test execution is expensive. In that case the single process will exit faster. In any case, considering that the cost of passing along the option to the childs is very little i think it should be done.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/facile-it/paraunit/issues/58#issuecomment-259992052, or mute the thread https://github.com/notifications/unsubscribe-auth/AGaxBFk-p7hghsYzB26oluj9j1O-gh2cks5q9JQNgaJpZM4Kv0os .

Jean85 avatar Nov 11 '16 17:11 Jean85

Closing as superseded by #198

Jean85 avatar May 03 '23 21:05 Jean85