-
Notifications
You must be signed in to change notification settings - Fork 14
Support protovalidate validation #259
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
Support protovalidate validation #259
Conversation
This reverts commit 0cd3157.
val output = command(runner).runCommand(projectRoot.toPath()) | ||
println(output.stderr) | ||
|
||
assertThat(output.stderr).contains("CONFORMANCE SUITE PASSED") | ||
val matches = " (\\d+) unexpected failures".toRegex().findAll(output.stderr).toList() | ||
// the current implementation runs two conformance suites | ||
assertThat(matches).hasSize(2) | ||
matches.forEach { assertThat(it.groupValues[1].toInt()).isEqualTo(0) } | ||
assertThat(output.exitCode).isEqualTo(0) |
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.
Just some cleanup.
@@ -0,0 +1,283 @@ | |||
standard_constraints/ignore_empty: |
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.
Whelp, gotta start somewhere. We were "fully" conformant until 0.8.0.
- proto2/wrapped/uint32/valid | ||
- proto2/wrapped/uint64/invalid | ||
- proto2/wrapped/uint64/valid | ||
- proto3/bool/invalid |
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'm most concerned about the proto3
tests below this point since we don't support proto2
or edition 2023
.
Right now the validator eagerly converts the protokt message to a protobuf DynamicMessage. With bufbuild/protovalidate-java#132, this can change to supply a wrapper around the protokt message that only converts as requested by the validator.
Not sure if this module belongs at the top level or in third-party. In that case, maybe the gRPC modules also belong in third-party. For example, supposing protokt one day supports the Connect protocol, that would also go in third-party, but it feels like a sibling to gRPC.
Fixes #207.