-
Notifications
You must be signed in to change notification settings - Fork 32
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
Change default validate image output to text #1893
Change default validate image output to text #1893
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1893 +/- ##
==========================================
+ Coverage 80.79% 80.81% +0.01%
==========================================
Files 68 68
Lines 5050 5050
==========================================
+ Hits 4080 4081 +1
+ Misses 970 969 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
For once I think I will pay attention to the CodeCov complaint. |
The same mocked validator was used in many places with a lot of copy/pasted code, so I wanted to clean that up. Not directly related to, but done while while working on... Ref: https://issues.redhat.com/browse/EC-758
The previous default was json. There was one change in the unit tests required to make the tests pass. I'm not 100% sure why that was needed (or rather why it wasn't needed before), but my understanding is that the fs and the ctx was being reused between two test cases and it was causing problems somehow. I did look at the task definition also, but the output is specified explicitly, so should be no change needed. Ref: https://issues.redhat.com/browse/EC-758
Motivated by CodeCov complaining about one uncovered code path. I decided to test the output with and without --show-successes. It's perhaps more than was needed, but actually this is the first unit test coverage of the validate image text output, (existing coverage is all in the acceptance tests), so I think it's worthwhile. Ref: https://issues.redhat.com/browse/EC-758
Fix a little text output glitch when --show-successes is not set. Note: I realized that `or` in a go template can take more than two parameters, so that's why the nested or was removed. Drive-by fix while working on... Ref: https://issues.redhat.com/browse/EC-758
7b0baa6
to
902d6ec
Compare
I fixed a few annoyances and added some more test coverage. Will take out of draft when it goes green. |
Now I'm pretty sure the CodeCov complaint is wrong. 🤔 🤷 |
@@ -166,7 +166,7 @@ func NewReport(snapshot string, components []Component, policy policy.Policy, da | |||
// WriteAll writes the report to all the given targets. | |||
func (r Report) WriteAll(targets []string, p format.TargetParser) (allErrors error) { | |||
if len(targets) == 0 { | |||
targets = append(targets, JSON) | |||
targets = append(targets, Text) |
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.
The significant functional change.
The previous default was json.
There was one change in the unit tests required to make the tests pass. I'm not 100% sure why that was needed (or rather why it wasn't needed before), but my understanding is that the fs and the ctx was being reused between two test cases and it was causing problems somehow.
I did look at the task definition also, but the output is specified explicitly, so should be no change needed.
Ref: https://issues.redhat.com/browse/EC-758