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

Cleanup PactContinuationSpec #1222

Merged
merged 1 commit into from
May 10, 2023
Merged

Conversation

edmundnoble
Copy link
Contributor

@edmundnoble edmundnoble commented May 9, 2023

This continues #1220's larger changes. From #1220:

I've made some mechanical changes to these tests:

  • uses of failsWith Nothing and succeedsWith Nothing have become fails and succeeds
  • uses of failsWith (Just e) and succeedsWith (Just e) have become failsWith (``shouldBe`` e) and succeedsWith (``shouldBe`` e)
  • Just-wrapping utilities have been deleted
  • Those changes make it possible to test the error type without adding endless ad-hoc utilities for asserting on particular members of PactError etc.

PR checklist:

  • Test coverage for the proposed changes
  • PR description contains example output from repl interaction or a snippet from unit test output
  • Documentation has been updated if new natives or FV properties have been added. To generate new documentation, issue cabal run tests. If they pass locally, docs are generated.
  • Any changes that could be relevant to users have been recorded in the changelog
  • In case of changes to the Pact trace output (pact -t), make sure pact-lsp is in sync.

Additionally, please justify why you should or should not do the following:

  • Confirm replay/back compat
  • Benchmark regressions
  • (For Kadena engineers) Run integration-tests against a Chainweb built with this version of Pact

@jwiegley
Copy link
Contributor

jwiegley commented May 9, 2023

Thank you for taking the time to factor this out, @edmundnoble. Most of it looks entirely mechanical and straightforward, a clear improvement. I'll review the other bits tomorrow, if my review is still needed then.

Copy link
Member

@rsoeldner rsoeldner left a comment

Choose a reason for hiding this comment

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

This PR increases clarity, thank you 👍

sysModuleCmd `succeedsWith` (`shouldBe` textVal "system module loaded")
acctModuleCmd `succeedsWith` (`shouldBe` textVal "TableCreated")
testModuleCmd `succeedsWith` (`shouldBe` textVal "test module loaded")
succeeds createAcctCmd -- Alice should be funded with $100
Copy link
Member

Choose a reason for hiding this comment

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

Does the comment provide any value? (I've noticed the removal here too).

@@ -1330,23 +1327,25 @@ shouldMatch' CommandResultCheck{..} results = checkResult _crcExpect apiRes
Nothing -> expectationFailure $ "Failed to find ApiResult for " ++ show _crcReqKey
Just cr -> crTest cr

succeeds :: HasCallStack => Command Text ->
Copy link
Member

Choose a reason for hiding this comment

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

This provides clarity 👍

@emilypi emilypi merged commit 523db83 into master May 10, 2023
12 checks passed
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.

None yet

4 participants