-
Notifications
You must be signed in to change notification settings - Fork 974
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
Fixup cert package tests #1253
base: cert-v2
Are you sure you want to change the base?
Fixup cert package tests #1253
Conversation
b38e4f0
to
53b352e
Compare
53b352e
to
c12d8da
Compare
package e2e | ||
package cert | ||
|
||
//TODO: this should only be built if performing 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.
I really dont want to require we use a tag to execute tests but it also feels bad to include this in the binary and I don't know of another way to deal with this without just copying these functions all over the place again.
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.
can't you define these in a something_helpers_test.go
and use them in other *_test.go
files?
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.
I desperately want there to be a way but the only thing I can come up with is a build tag much like how e2e
works
Could knock out #1124 in this too. |
This change fixes the old v1 tests and adds new tests for v2.
Most notably it fixes the
TestMarshalingCertificateV1Consistency
test which needed to be modified.netip.Prefix
can not represent netmasks like255.0.255.0
. I went back to f22b4b5 and modified the test details to remove the non conforming netmasks and adjust the timestamps, the resulting expected byte arrays are represented in this test.There are two spots where I am unsure if we want to panic, v1 and v2
String()
callsjson.Marshal
which can fail. Currently they return a string but panic would be more obvious.