Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw workflow exceptions from test/testFromStart instead of leaking to uncaught exception handler. #686

Merged
merged 1 commit into from
Oct 29, 2019

Conversation

zach-klippenstein
Copy link
Collaborator

Simplifies testing API by removing awaitFailure() – this method is now redundant since any
failures are thrown from the test/testFromStart function directly. This is simpler to use since
any exceptions from the workflow or runtime are now just thrown normally and will always cause
tests to fail, and it doesn't require any additional API to test expected failures.

Fixe #635.

@zach-klippenstein zach-klippenstein added bug Something isn't working testing labels Oct 18, 2019
@zach-klippenstein zach-klippenstein added this to the kotlin v0.21.0 milestone Oct 18, 2019
@zach-klippenstein zach-klippenstein added this to Needs review in Workflow (Kotlin) via automation Oct 18, 2019
@zach-klippenstein zach-klippenstein force-pushed the zachklipp/fix-workflowtester-failure branch 4 times, most recently from 40156ff to 4a76ade Compare October 18, 2019 21:04
Copy link

@kirillzh kirillzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

* ## Usage
*
* 1. Register an uncaught exception handler to report uncaught exceptions with [reportUncaught].
* 2. Run your code with [runRethrowingUncaught]. Any exceptions passed to [reportUncaught] will be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No discussion of rethrowingUncaughtExceptions(), so I come away unclear when I should use that and when I should use these methods directly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note saying when to use it.

kotlin/workflow-testing/build.gradle Show resolved Hide resolved
…to uncaught exception handler.

Simplifies testing API by removing `awaitFailure()` – this method is now redundant since any
failures are thrown from the `test`/`testFromStart` function directly. This is simpler to use since
any exceptions from the workflow or runtime are now just thrown normally and will always cause
tests to fail, and it doesn't require any additional API to test expected failures.

Fixe #635.
@zach-klippenstein zach-klippenstein force-pushed the zachklipp/fix-workflowtester-failure branch from 4a76ade to df316bf Compare October 28, 2019 23:33
@zach-klippenstein zach-klippenstein merged commit 905af48 into master Oct 29, 2019
Workflow (Kotlin) automation moved this from Needs review to Done Oct 29, 2019
@zach-klippenstein zach-klippenstein deleted the zachklipp/fix-workflowtester-failure branch October 29, 2019 22:11
@zach-klippenstein zach-klippenstein added the kotlin Affects the Kotlin library. label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kotlin Affects the Kotlin library. testing
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants