You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think maybe I can work on this one? I haven't used gomock before, but it looks like BinaryArtifacts uses a lot of the same functions as DangerousWorkflow so hopefully I can figure it out.
create a mock that just throws an UnsupportedFeature error, similar to the existing functionality (I already have a working version of this, I think)
create a mock that actually returns something from ListLicenses, however, that would replicate a lot of the existing functionality for handling these cases in the check itself
Testing both 1 and 2 using different test cases with different mocks (adding a couple test cases to do so), although it seems like the difference in functionality should be tested in the raw/checks/license_test rather than here, so this might involve some other test design decisions
My questions are along the lines of - Is the functionality in the license check that handles an unsupportedFeature for listLicenses intended to be permanent? Are any of the options above preferable given the test designs for the project?
I am probably over-thinking this. If so and if option 1 is fine, I can go ahead and submit a PR.
Both Binary-Artifacts and License checks have TODOs about using a gomock repoclient.
scorecard/checks/binary_artifact_test.go
Lines 63 to 65 in 0b9dfb6
scorecard/checks/license_test.go
Lines 71 to 73 in 0b9dfb6
Additionally
Binary-Artifacts
has is a very basic test which just check the score and not other aspects of theCheckResult
(like logging).scorecard/checks/binary_artifact_test.go
Lines 86 to 89 in 0b9dfb6
It'd be nice to get both of these cleaned up like some of the other checks to:
scut.ValidateTestReturn
For example like
dangerous_workflow_test.go
scorecard/checks/dangerous_workflow_test.go
Lines 80 to 95 in 0b9dfb6
The text was updated successfully, but these errors were encountered: