-
Notifications
You must be signed in to change notification settings - Fork 355
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
chore: improve output on vm tests #775
chore: improve output on vm tests #775
Conversation
This is an awesome idea :) |
IMHO the diff on tests are not intended to be used as a patch, but to easily see what is the difference between the obtained and expected result. The main problem I had when I was checking the fails on master was that the output was so verbose that was difficult to see what was failing. So I think leaving the output only as the diff is a better way of improving the time needed to fix any problems that these tests might catch in the future. |
33075e3
to
497181b
Compare
You have to run |
cc @jeronimoalbi - would this break anything in the parser? |
Instead of printing the expected and actual output, create a diff to see what specifically changed. Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
497181b
to
ee107c7
Compare
Hi @ajnavarro, could you please add before/after examples in the PR body for better comprehension of the changes? Also, there is an alternative workflow that requires running two commands, namely WARN: new dependency. |
@moul Output examples Before:
After:
|
I think the flag you mention is called
It was an indirect dependency, because this is what |
Right |
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.
This has got to be the longest PR description we've had to date 🙂
The diff view is much cleaner 💯
@moul are we fine with adding this external dependency?
@zivkovicmilos the dependency was already there. I'm using the same library that Testify uses under the hood for diff assertions. |
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 like this 👍
Maybe a compromise with what @tbruyelle was also saying is to make it so that, when writing out the diff, all the context lines are printed (not just the different ones)? If difflib doesn't support this directly ie by setting context to -1, we could make Context something like 1 << 31
...
This dependency only affects the advanced developer tools and not runtime. It offers flexibility and goes in the right direction. We can create multiple go.mod files to keep core libraries minimal. Reverting is also easy if needed. Let's go for it! 👍 Edit: maybe we'll want to add a toggle to get the previous behavior. |
Instead of printing the expected and actual output, create a diff to see what specifically changed.
Before:
After: