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

Golden tests for cardano-api errors #5188

Merged
merged 6 commits into from
May 9, 2023

Conversation

newhoggy
Copy link
Contributor

@newhoggy newhoggy commented May 4, 2023

Description

Add golden tests for API errors.

By maintaining a set of golden test files for our error message output, we gain the ability to have a technical writer review our error messages to ensure they are optimal and allow us to refactor the way we generate error messages to minimise risk and ensure progress (vs regression).

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
    • integration tests
      See Runnings tests for more details
  • Any changes are noted in the CHANGELOG.md for affected package
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-8.10.7 and ghc-9.2.7
  • Self-reviewed the diff

Note on CI

If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.

@newhoggy newhoggy marked this pull request as ready for review May 4, 2023 08:17
@newhoggy newhoggy changed the title Golden tests for errors Golden tests for cardano-api errors May 4, 2023
@newhoggy newhoggy force-pushed the newhoggy/golden-tests-for-errors branch 2 times, most recently from 0d1960e to 17c18a8 Compare May 4, 2023 08:23
-- { Qry.pastHorizonCallStack = GHC.callStack
-- , Qry.pastHorizonExpression = error "" -- Some $ Qry.ClosedExpr $ Qry.ELit 0
-- , Qry.pastHorizonSummary = []
-- }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need some way to construct a constant PastHorizonException value.

@newhoggy newhoggy force-pushed the newhoggy/golden-tests-for-errors branch 3 times, most recently from 1e6b652 to 5f1b788 Compare May 8, 2023 01:07
@@ -5,6 +5,13 @@

### Features

- New error exports:
Copy link
Contributor

Choose a reason for hiding this comment

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

error exports?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to be able to construct errors in order to test how they display.

@newhoggy newhoggy force-pushed the newhoggy/golden-tests-for-errors branch from 5f1b788 to e933b5d Compare May 9, 2023 01:36
@newhoggy newhoggy force-pushed the newhoggy/golden-tests-for-errors branch from e933b5d to 3b98748 Compare May 9, 2023 17:01
@newhoggy newhoggy force-pushed the newhoggy/golden-tests-for-errors branch from ee30868 to c6429f3 Compare May 9, 2023 17:10
@newhoggy newhoggy enabled auto-merge May 9, 2023 17:10
@newhoggy newhoggy added this pull request to the merge queue May 9, 2023
Merged via the queue into master with commit 9507125 May 9, 2023
@iohk-bors iohk-bors bot deleted the newhoggy/golden-tests-for-errors branch May 9, 2023 18:28
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.

5 participants