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

Stop swallowing errors in test-machine #144

Merged
merged 4 commits into from
Jun 14, 2019

Conversation

cddr
Copy link
Contributor

@cddr cddr commented Jun 13, 2019

When working with the test-machine, it makes for a significantly better developer workflow when any exceptions that occur are bubbled back up to the main thread. Prior versions were catching errors and sometimes not even logging them (mea culpa!).

This PR adds tests with a few of the errors we've seen developers make and ensures that the resulting exception (including the full cause trace) is logged and the exception is bubbled back up to the main thread after all the resources used by the test are torn back down.

@cddr cddr requested a review from a team as a code owner June 13, 2019 12:11
@cddr cddr changed the title Stop swallowing errors in mock transport Stop swallowing errors in test-machine Jun 13, 2019
@codecov-io
Copy link

codecov-io commented Jun 13, 2019

Codecov Report

Merging #144 into master will decrease coverage by 0.18%.
The diff coverage is 75.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #144      +/-   ##
==========================================
- Coverage   81.04%   80.85%   -0.19%     
==========================================
  Files          39       39              
  Lines        2321     2351      +30     
  Branches      147      149       +2     
==========================================
+ Hits         1881     1901      +20     
- Misses        293      301       +8     
- Partials      147      149       +2
Impacted Files Coverage Δ
src/jackdaw/test/journal.clj 77.19% <100%> (-0.4%) ⬇️
src/jackdaw/test/transports/rest_proxy.clj 82.72% <62.5%> (-1.52%) ⬇️
src/jackdaw/test/transports/mock.clj 84.48% <72.72%> (-5.32%) ⬇️
src/jackdaw/test.clj 77.77% <83.33%> (+4.56%) ⬆️
src/jackdaw/test/transports/kafka.clj 85.93% <86.95%> (+0.33%) ⬆️
src/jackdaw/serdes/edn.clj 88.46% <0%> (-3.85%) ⬇️
src/jackdaw/test/commands/base.clj 100% <0%> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc8f1c8...b03dc9c. Read the comment docs.

(deliver p {:result :found})
(deliver p result))))]

(deliver p {:result :found
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change addresses another usability problem encountered in the wild. Test authors could confuse the middleware if they wrote a condition? function that returned a map containing a :result key. The original intention was that the return value might be of interest to the test author when making assertions about the results but clearly it is safer to include the result in it's own :info key to make sure it doesn't collide with what the middleware is expecting to see.

@cddr cddr merged commit 2df7f70 into master Jun 14, 2019
@cddr cddr deleted the stop-swallowing-errors-in-mock-transport branch June 14, 2019 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants