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

clients/osv: Reduce fun test flakyness #9773

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

fviernau
Copy link
Member

This reduces flakyness of the first test. PRs for the other tests will follow.

Note: Using shouldEqualJson for this job does not work, because it does not support a comparision mode which
compares JSON arrays by containsAll (subset).

@fviernau fviernau requested a review from a team as a code owner January 17, 2025 16:05
@fviernau fviernau force-pushed the osv-client-fun-test-flakyness-fix-1 branch from 63d5e04 to d8d90f3 Compare January 17, 2025 16:17
@fviernau fviernau enabled auto-merge (rebase) January 17, 2025 16:17
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.07%. Comparing base (78edc76) to head (34fa5fc).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9773   +/-   ##
=========================================
  Coverage     68.07%   68.07%           
  Complexity     1284     1284           
=========================================
  Files           249      249           
  Lines          8827     8827           
  Branches        918      918           
=========================================
  Hits           6009     6009           
  Misses         2432     2432           
  Partials        386      386           
Flag Coverage Δ
funTest-docker 65.00% <ø> (ø)
funTest-non-docker 33.36% <ø> (ø)
test-ubuntu-24.04 35.89% <ø> (ø)
test-windows-2022 35.87% <ø> (ø)

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.

@@ -0,0 +1,47 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

Commit message: Typo in "cchanges".

The function actually does two things, patching ignorable fields and
normalize this. So, rename the function to just `patch()` so that it
better fits also the normalization and uses a shorter name.

Signed-off-by: Frank Viernau <[email protected]>
Relax the assertion to only check that a single expected vulnerability
is amongst the actually returned ones. Use the (only) vulnerability
which had been returned back when OSV was introduced, in July 2022. In
these ~2.5 years the vulnerability changed only in terms of the schema
version. As the schema version changes are not very frequent, this
likely reduces flakyness.

Signed-off-by: Frank Viernau <[email protected]>
@fviernau fviernau force-pushed the osv-client-fun-test-flakyness-fix-1 branch from d8d90f3 to 34fa5fc Compare January 17, 2025 17:05
@fviernau fviernau requested a review from sschuberth January 17, 2025 17:06
@fviernau fviernau merged commit b9fd340 into main Jan 17, 2025
26 checks passed
@fviernau fviernau deleted the osv-client-fun-test-flakyness-fix-1 branch January 17, 2025 17:27
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