-
Notifications
You must be signed in to change notification settings - Fork 549
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
test: create fake TUF test root and create test SETs for verification #1750
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1750 +/- ##
==========================================
+ Coverage 29.66% 30.13% +0.47%
==========================================
Files 142 143 +1
Lines 8501 8607 +106
==========================================
+ Hits 2522 2594 +72
- Misses 5706 5712 +6
- Partials 273 301 +28
Continue to review full report at Codecov.
|
Signed-off-by: Asra Ali <[email protected]> add fake SET test Signed-off-by: Asra Ali <[email protected]> fix Signed-off-by: Asra Ali <[email protected]> fix test Signed-off-by: Asra Ali <[email protected]> fix Signed-off-by: Asra Ali <[email protected]>
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.
Great work, this is excellent! I'll add the tests for the CT log once this is merged!
t.Error(err) | ||
} | ||
// Serve remote repository. | ||
s := httptest.NewServer(http.FileServer(http.Dir(filepath.Join(td, "repository")))) |
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.
nit: Kinda outside the scope of this PR cause I think it'd require a more significant refactoring, but it'd be nice if there was a way to initialize the TUF metadata without an outbound network call. I don't love having to stand up HTTP servers in unit tests.
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.
FWIW it's a local server, but I agree -- t we also wanted to keep a remote cache URL/bucket information, so pulling out the remote as a parameter to Initialize
wouldn't let the TufClient have that info.
However, we can just support local filesystem roots as "mirrors". Tests can provide the path to the root.
Will do as a follow up!
Signed-off-by: Asra Ali <[email protected]>
…sigstore#1750) * wip Signed-off-by: Asra Ali <[email protected]> add fake SET test Signed-off-by: Asra Ali <[email protected]> fix Signed-off-by: Asra Ali <[email protected]> fix test Signed-off-by: Asra Ali <[email protected]> fix Signed-off-by: Asra Ali <[email protected]> * address haydentherapper comments Signed-off-by: Asra Ali <[email protected]>
Summary
cc @haydentherapper
Ticket Link
Fixes
Release Note