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

ci: run tests on Windows #646

Merged
merged 16 commits into from
Nov 21, 2023
Merged

ci: run tests on Windows #646

merged 16 commits into from
Nov 21, 2023

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Nov 6, 2023

Unsurprisingly this has required a bunch of tests to be updated to handle slightly different variations in file path handling - this eventually resulted in me implementing an actual internal snapshot testing package but I've not included that in here since its sizable on its own; so please keep that in mind when reviewing . (see https://github.com/G-Rath/osv-scanner/commit/1273da79e2e26a18d663da482dc5f09258e15c51 for a sneakpeek on what the snapshot-based testing looks like)

Note that is failing because file -> url path translation is actually busted; I've opened #645 to fix this and you can see the passing CI when both of these changes are merged in #553

Resolves #603
Resolves #553

@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (e62c1b0) 77.99% compared to head (71f2768) 78.46%.

Files Patch % Lines
internal/testutility/utility.go 92.15% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #646      +/-   ##
==========================================
+ Coverage   77.99%   78.46%   +0.46%     
==========================================
  Files          81       81              
  Lines        5825     5859      +34     
==========================================
+ Hits         4543     4597      +54     
+ Misses       1082     1064      -18     
+ Partials      200      198       -2     

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

another-rex pushed a commit that referenced this pull request Nov 9, 2023
Turns out that file -> url translation on Windows is busted, and that
this is a hard problem that Go has an internal util for that has not yet
been made public - I've done what apparently a number of other packages
have done which is copying that helper into here and hoping one day it
actually becomes public 😢

Note that until #646 is landed, there is no way to actually verify this
is fixing the problem - #553 shows the result of both PRs being merged.
Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Thanks! Added some comments!

internal/testutility/utility.go Outdated Show resolved Hide resolved

Add or append these values to the following config files to ignore this vulnerability:

`\path\to\sub-rust-project/osv-scanner.toml`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm this seems weird, I think this is missing the D:\ part and the final osv-scanner.toml is joined with a /.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup I've already opened #604 to track fixing this, but want to keep it out of this PR because it's a dedicated bug

@G-Rath G-Rath requested a review from another-rex November 21, 2023 19:00
Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@another-rex another-rex merged commit 521f59c into google:main Nov 21, 2023
9 checks passed
@G-Rath G-Rath deleted the run-tests-on-windows branch December 19, 2023 18:08
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.

Run tests against Windows
3 participants