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

Make impAnn a bit more useful, by making the logs scoped by impAnn #3909

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented Dec 4, 2023

Description

Reviewing #3852 made me realize that sometimes we want to display lengthy Imp logs only when there is some failure in the current scope, but not otherwise.

So, imagine we have some very lengthy log entry (in this example: "Found a problem with x and y"), but we want to show this only when x and y are not equal, but for all ther failures in the test this log entry would not be relevant and should not be displayed. Then instead of writing this:

when (x /= y) $ do
  logEntry "Found a problem with x and y"
  expectationFailure $ showTreeDiff x y

we can now write this:

impAnn "Ensuring x and y validity" $ do
  logEntry "Found a problem with x and y"
  x `shouldBeExpr` y

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

@lehins lehins force-pushed the lehins/change-annImp-functionality branch 2 times, most recently from 2bf2a89 to 18a63ec Compare December 4, 2023 21:07
@lehins lehins requested a review from Soupstraw December 4, 2023 22:09
Copy link
Contributor

@teodanciu teodanciu left a comment

Choose a reason for hiding this comment

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

Just a question, approving (since I'm almost certain of the answer, but just to check that I understand).
Looks good to me

Copy link
Contributor

@Soupstraw Soupstraw left a comment

Choose a reason for hiding this comment

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

Nice!

@lehins lehins force-pushed the lehins/change-annImp-functionality branch 2 times, most recently from ccfc5ac to 7ef8acd Compare December 5, 2023 14:10
@lehins lehins force-pushed the lehins/change-annImp-functionality branch from 7ef8acd to ee601fb Compare December 5, 2023 19:09
@lehins lehins enabled auto-merge December 5, 2023 19:10
@lehins lehins merged commit d754338 into master Dec 5, 2023
@iohk-bors iohk-bors bot deleted the lehins/change-annImp-functionality branch December 5, 2023 21:10
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