-
Notifications
You must be signed in to change notification settings - Fork 17
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
Better use of golden files in CI #724
Conversation
16a99a5
to
90b97af
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.
Nice improvement. I also tried the scripts manually and they work. My two cents are two suggestions about presentation.
.github/workflows/haskell.yml
Outdated
echo "💣 The following golden files are not up-to-date:" | ||
git ls-files -m | ||
echo "Please run the tests locally and update the golden files, or fix your changes." |
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.
echo "💣 The following golden files are not up-to-date:" | |
git ls-files -m | |
echo "Please run the tests locally and update the golden files, or fix your changes." | |
echo "💣 The following golden files are not up-to-date:" | |
echo -e | |
git ls-files -m | |
echo -e | |
echo "These are the changes that were made:" | |
echo -e | |
git diff | |
echo -e | |
echo "Please run the tests locally and update the golden files, or fix your changes." |
In addition to the previous suggestion, it may be useful to display the diff. That way you can see what the differences look like. So, for example, if it is a whitespace change, it may be obvious you are missing pretty-printing them. Or if a particular key in the JSON is wrong.
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 rather keep the output of the CI short, so I will skip this one 👍
Not sure why all the Windows CI fails. |
echo "⚠️ The following golden files are not used anymore:" | ||
git ls-files -d | ||
echo "Please delete them." | ||
exit 1 |
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.
Seems this is a problem for windows: https://github.com/IntersectMBO/cardano-cli/blob/main/cardano-cli/test/cardano-cli-golden/Test/Golden/Help.hs#L54
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.
Yep, I simply disabled the new checks on Windows: ad0b99a
6547510
to
94de866
Compare
94de866
to
d90f4ce
Compare
7d508c9
to
ad0b99a
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.
Nice 👍
Changelog
Context
How to trust this PR
Checklist