generate-jobs: print diff in case of failure#36831
Open
pohly wants to merge 1 commit intokubernetes:masterfrom
Open
generate-jobs: print diff in case of failure#36831pohly wants to merge 1 commit intokubernetes:masterfrom
pohly wants to merge 1 commit intokubernetes:masterfrom
Conversation
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pohly The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
bart0sh
reviewed
Apr 17, 2026
| equal = diff == "" | ||
| if verify: | ||
| os.unlink(tmp.name) | ||
| if not equal: |
Contributor
There was a problem hiding this comment.
Suggested change
| if not equal: | |
| if diff != "": |
Contributor
Author
There was a problem hiding this comment.
So you wanted me to remove the equal variable? Okay, removed.
bart0sh
reviewed
Apr 17, 2026
Comment on lines
+131
to
+132
| with open(path) as f: | ||
| return list(f) |
Contributor
There was a problem hiding this comment.
Suggested change
| with open(path) as f: | |
| return list(f) | |
| with open(path) as f: | |
| return f.readlines() |
bart0sh
reviewed
Apr 17, 2026
Comment on lines
+110
to
+114
| expected = read_lines(tmp.name) | ||
| actual = read_lines(out) | ||
| diff = difflib.context_diff(actual, expected, | ||
| fromfile="actual", tofile="expected") | ||
| diff = ''.join(diff) |
Contributor
There was a problem hiding this comment.
Not sure, but would this be more readable without a helper?
Suggested change
| expected = read_lines(tmp.name) | |
| actual = read_lines(out) | |
| diff = difflib.context_diff(actual, expected, | |
| fromfile="actual", tofile="expected") | |
| diff = ''.join(diff) | |
| with open(tmp.name) as expected, open(out) as actual: | |
| diff = difflib.context_diff(actual.readlines(), expected.readlines(), | |
| fromfile="actual", tofile="expected") | |
| diff = ''.join(diff) |
1e6bafb to
acb886f
Compare
This makes a CI failure more useful. In one case, the CI reported "differs from existing" without saying how and locally the check passed.
acb886f to
3dbce37
Compare
Contributor
|
/lgtm |
Contributor
|
/assign @dims |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes a CI failure more useful. In one case, the CI reported "differs from existing" without saying how and locally the check passed.
/assign @bart0sh