Skip to content

[BUG] Conformance test suite has test cases that are unspecified by the proto3 spec #150

Description

@andrewparmet

Description

While implementing protovalidate for protokt, which is a fully proto3-compliant generator and runtime[1], I couldn't get several conformance tests to pass. I believe this is because the conformance tests are taking advantage of convenient-but-unspecified behavior implemented by the runtimes supported by the other protovalidate implementations.

[1] Protokt doesn't support message merging but that doesn't matter here.

Steps to Reproduce

Run the conformance suite against https://github.com/andrewparmet/protovalidate-protokt/pull/9 without adversarial short-circuiting and observe the failures.

These tests check for ignoring validation rules when a non-optional scalar field is not present on the wire for a proto3 message:

buf.validate.conformance.cases.Fixed64Ignore
buf.validate.conformance.cases.Fixed32Ignore
buf.validate.conformance.cases.SFixed64Ignore
buf.validate.conformance.cases.SFixed32Ignore
buf.validate.conformance.cases.SInt64Ignore
buf.validate.conformance.cases.SInt32Ignore
buf.validate.conformance.cases.UInt64Ignore
buf.validate.conformance.cases.UInt32Ignore
buf.validate.conformance.cases.Int64Ignore
buf.validate.conformance.cases.Int32Ignore
buf.validate.conformance.cases.FloatIgnore
buf.validate.conformance.cases.DoubleIgnore
buf.validate.conformance.cases.IgnoreEmptyProto3Scalar
buf.validate.conformance.cases.BytesIPv6Ignore

This test checks that a non-optional scalar field was present on the wire for a proto3 message:

buf.validate.conformance.cases.RequiredProto3Scalar

Expected Behavior

The proto3 spec explicitly calls out that presence tracking is not (necessarily) implemented by compliant runtimes, and their conformance checks do not verify behavior like this.

Actual Behavior

These tests fail unless I specifically address them.

Possible Solution

These conformance tests should be removed and replaced with a test that verifies that ignore_empty cannot be used on non-optional proto3 scalar fields.

Additional Context

See bufbuild/protovalidate-java#80 for the proposal to extend protovalidate-java to support protokt.

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions