Skip to content
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

Minor advisor test improvements #9603

Merged
merged 4 commits into from
Dec 13, 2024
Merged

Minor advisor test improvements #9603

merged 4 commits into from
Dec 13, 2024

Conversation

fviernau
Copy link
Member

See individual commits.

@fviernau fviernau requested a review from a team as a code owner December 13, 2024 09:58
@fviernau fviernau enabled auto-merge (rebase) December 13, 2024 09:59
@fviernau fviernau force-pushed the test-identifier-to-package branch from b846480 to f3c82d1 Compare December 13, 2024 10:07
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.03%. Comparing base (7c12d92) to head (21e67c3).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9603   +/-   ##
=========================================
  Coverage     68.03%   68.03%           
- Complexity     1285     1287    +2     
=========================================
  Files           249      249           
  Lines          8826     8826           
  Branches        920      920           
=========================================
  Hits           6005     6005           
  Misses         2432     2432           
  Partials        389      389           
Flag Coverage Δ
funTest-docker 64.96% <ø> (ø)
funTest-non-docker 33.48% <ø> (+0.17%) ⬆️
test-ubuntu-24.04 35.81% <ø> (ø)
test-windows-2022 35.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@sschuberth sschuberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about a follow-up commit in this PR that turns identifierToPackage() into fun Identifier.toPackage()?

Comment on lines +61 to +62
packageFindings.keys.forAll { coordinates ->
packageFindings.getValue(coordinates).vulnerabilities shouldNot beEmpty()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this variable renaming still go to the previous commit?

@fviernau
Copy link
Member Author

fviernau commented Dec 13, 2024

How about a follow-up commit in this PR that turns identifierToPackage() into fun Identifier.toPackage()?

Currently, identifierToPackage() takes a String. Do you want to change the type to Identifier ?

(Maybe I can do this in a follow-up PR)

_edit: or maybe fun STring.identifierToPackage()?

@fviernau fviernau force-pushed the test-identifier-to-package branch from f3c82d1 to faf772b Compare December 13, 2024 10:34
@fviernau fviernau requested a review from sschuberth December 13, 2024 10:34
Improve readability of assertion failures within `forAll`. Note that
assertions for the keys of type `Package` are covered by the test case
below.

Signed-off-by: Frank Viernau <[email protected]>
Prepare for re-use.

Signed-off-by: Frank Viernau <[email protected]>
This slightly simplifies conversion and allows to re-use
`identifierToPackage()`.

Signed-off-by: Frank Viernau <[email protected]>
Improve output of assertion failures within `forAll`.

Signed-off-by: Frank Viernau <[email protected]>
@fviernau fviernau force-pushed the test-identifier-to-package branch from faf772b to 21e67c3 Compare December 13, 2024 10:34
@sschuberth
Copy link
Member

How about a follow-up commit in this PR that turns identifierToPackage() into fun Identifier.toPackage()?

Currently, identifierToPackage() takes a String. Do you want to change the type to Identifier ?

No, you would call it like Identifier("Maven:org.hamcrest:hamcrest-core:1.3").toPackage() (instead of identifierToPackage("Maven:org.hamcrest:hamcrest-core:1.3")). It's a bit longer, but nicer IMO.

Maybe I can do this in a follow-up PR

Yes.

@fviernau fviernau merged commit 8bc47a4 into main Dec 13, 2024
26 checks passed
@fviernau fviernau deleted the test-identifier-to-package branch December 13, 2024 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants