-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: small QOL changes #32
Conversation
This has the side effect of defining the update flag to the test package. Without this, using the -update flag to update golden files in the other packages causes a non-fatal error to be printed.
Makes it easier to test the rest of the plugin locally.
This will make it slightly quicker to receive and parse (as it's then thrown away).
Clarifies that the plugin will only fail a step if finding thresholds are specified. There was some confusion around the placement of ignore configuration. I've tried to make this more clear by rewording the README and rewriting much of the ignore documentation.
@@ -5,6 +5,7 @@ import ( | |||
"time" | |||
|
|||
"github.com/cultureamp/ecrscanresults/findingconfig" | |||
_ "github.com/hexops/autogold/v2" |
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.
That's pretty whack (why you have to include this in the first place), I had a quick browse of the repo and I didn't immediately find an issue relating to this. Is there an issue you found where this was the suggestion?
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.
No, I had to work it out
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 underlying issue seemed to stem from this change: hexops/autogold#45, but I'm not 100% sure.
The Go test tool doesn't like it when a flag is present but not consumed by code, and writes a long message to that effect. However, since go test
generates a main
function to run tests, and doesn't load _test
files from other packages, if the autogold
package isn't referenced by the package itself, the flag isn't consumed.
So when you run go test ./... -update
and it iterates over all the packages, some of them write a failure about the unused flag, because they're not using "golden" files.
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.
Sorry for the short reply earlier.
This PR has 4 small changes:
autogold
is imported in packages where it's not used, so the-update
flag doesn't cause spurious errors.ECRSCANRESULTS_DISABLE_AGENT