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

Add more test machine commands for inspecting its state #141

Merged
merged 3 commits into from
Jun 11, 2019

Conversation

99-not-out
Copy link
Contributor

Added two new Test Machine commands.

:do! - like do but the function provided is passed the journal atom, not the contents of the journal atom.

:inspect - the function provided is passed the whole test machine state (a debugging hook)

@99-not-out 99-not-out requested a review from a team as a code owner June 7, 2019 04:37
@codecov-io
Copy link

codecov-io commented Jun 7, 2019

Codecov Report

Merging #141 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #141      +/-   ##
==========================================
+ Coverage      81%   81.04%   +0.03%     
==========================================
  Files          39       39              
  Lines        2317     2321       +4     
  Branches      147      147              
==========================================
+ Hits         1877     1881       +4     
  Misses        293      293              
  Partials      147      147
Impacted Files Coverage Δ
src/jackdaw/test/commands/base.clj 100% <100%> (ø) ⬆️

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 1722d6d...eca15fb. Read the comment docs.

@cddr
Copy link
Contributor

cddr commented Jun 7, 2019

Seems reasonable. Can you add the new commands to the docs plz?

https://github.com/FundingCircle/jackdaw/blob/master/doc/test-machine.md#test-commands

@creese
Copy link
Contributor

creese commented Jun 7, 2019

Seems like one is a superset of the other? Should we just change how :do behaves?

@99-not-out
Copy link
Contributor Author

Well, the difference between do and do! is that do will give you a static snapshot of the journal state at the time do ran. Where as do! returns the atom, which is therefore still being updated in the background. So do! lets you inject some custom journal update monitoring or whatever code.

do! and inspect are really debugging commands as a result.

@99-not-out 99-not-out merged commit cc8f1c8 into master Jun 11, 2019
@99-not-out 99-not-out deleted the test-machine-do-with-machine branch June 11, 2019 13:37
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.

4 participants