-
Notifications
You must be signed in to change notification settings - Fork 721
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 golden tests for CLI help #5206
Conversation
9579c24
to
118fc2e
Compare
118fc2e
to
7d095a9
Compare
3935720
to
e244c5c
Compare
cardano-cli/cardano-cli.cabal
Outdated
@@ -174,6 +174,17 @@ executable cardano-cli | |||
, optparse-applicative-fork | |||
, transformers-except | |||
|
|||
library test-lib | |||
import: project-config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e244c5c
to
07a005f
Compare
170a00c
to
95ac429
Compare
7ecd49c
to
40e60a2
Compare
d610f7e
to
e558d93
Compare
cardano-api/cardano-api.cabal
Outdated
, Diff | ||
, directory | ||
, filepath | ||
, hedgehog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated hedgehog
140f533
to
d148bf2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one comment. Also please make this adjustment: https://input-output-rnd.slack.com/archives/G011N23CEAE/p1684415814893539?thread_ts=1683699530.202139&cid=G011N23CEAE
] | ||
|
||
let lines = Text.lines $ Text.pack help | ||
let usages = List.filter (not . null) $ extractCmd . Text.drop 19 <$> List.filter (Text.isPrefixOf "Usage: cardano-cli ") lines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Text.drop 19 removes "Usage: cardano-cli "? Adding a comment saying this would be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've introduced a new function which returns the magic number 19
.
d148bf2
to
02f3d07
Compare
Description
Add golden tests for CLI help. This will help ensure our help text gets reviewed and the formatting is correct.
Depends on #5200
Checklist
See Runnings tests for more details
CHANGELOG.md
for affected package.cabal
files are updatedhlint
. See.github/workflows/check-hlint.yml
to get thehlint
versionstylish-haskell
. See.github/workflows/stylish-haskell.yml
to get thestylish-haskell
versionghc-8.10.7
andghc-9.2.7
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.