Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Cleanup PactContinuationSpec#1222

Merged
emilypi merged 1 commit intomasterfrom
edmund/cleanup-pact-continuation-spec
May 10, 2023
Merged

Cleanup PactContinuationSpec#1222
emilypi merged 1 commit intomasterfrom
edmund/cleanup-pact-continuation-spec

Conversation

@edmundnoble
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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).

Nothing -> expectationFailure $ "Failed to find ApiResult for " ++ show _crcReqKey
Just cr -> crTest cr

succeeds :: HasCallStack => Command Text ->
Copy link
Copy Markdown
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants