Repository navigation
Conversation
testdata/<dir> is protowire's testdata/<dir> byte for byte, schemas
included, for annotations, any, bigfloat, blocks, dataset, duplicates,
duration, keyed, map-keys, nulls, repeated and strings, plus test.proto.
It replaces the copies under pxf/src/test/resources/{corpus,keyed,map-keys}
and pxf/src/test/proto, taken from spec 234cf29 and since overtaken: nulls
and dataset lacked the three (pxf.required) fixtures of protowire#569 and
the messages they bind.
The full tier compiles the schemas as test protos (all but the v1.2-only
settings_annotated.proto and the editions schema, which protoc 3.25.5
reads only behind a flag) and reads the fixtures by path: the corpus
directory names are also the generated packages' class directories, so
a classpath directory lookup finds those first.
SpecCorpusTest drives the three directories nothing ran here (annotations,
duration, repeated) and fails when a vendored directory has no driver.
A fixture the tier does not meet is listed in CorpusFixtures.KNOWN_GAPS
against its issue, and a listed fixture that meets its verdict fails, so
the list only shrinks. Today it lists the three #189 fixtures.
lite-fixtures now generates its lite classes and companions from testdata/'s schemas. protoc-gen-pxf-java-meta requires a java_package and the spec's schemas carry none, so a Sync task adds one (the proto package, protoc's own default) and java_multiple_files on the way to protoc; nothing else in a file changes. The hand copies of the nulls, keyed and settings schemas go. settings_annotated.proto stays: it needs a v1.2 compiler, and src/main/proto spells it for stock protoc. LiteCorpusTest runs every fixture of all twelve directories through Parser + LiteWireWriter and, where the corpus gives bytes or text, back through LiteWireReader: verdicts by file name, bigfloat's encode and decode cases, the annotations golden, duration values and the negative round trip, concatenated lists, the map-key fmt pairs, the @dataset parse verdicts, and the error texts the full tier pins. It replaces LiteTablesTest's hand-typed nulls rows, one of which (required-optional) the spec has since made a reject. The first run found lite gaps, each listed in KNOWN_GAPS against its issue: #213 (an Any block's @type is refused), #214 (a scalar or an assigned block on a repeated field is accepted), #215 (three error texts), #191 (three rejections are IllegalArgumentException) and #189. @dataset rows are not bound on lite at all (#212), so only the parse verdicts run.
scripts/check-spec-corpus.sh, run by the conformance job against protowire main, fails when a directory under testdata/ or test.proto differs from the spec's, and when the spec has a testdata directory that is neither copied here nor listed with what covers it instead (the gates, or cmd/pxf tooling neither tier has). So a fixture the spec adds reaches both tiers' corpus tests, which then fail until the tier meets it or lists it as a known gap. The struct-binding table step loses its guard for a spec main with no values.tsv: protowire#518 merged, and the table matches.
Collaborator
Author
|
CI on head a314fb7 (run 42518398723): Build + Test and Conformance passed.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both Java tiers now run every test file in the spec's per-port corpus, from one copy that CI keeps equal to the spec. Before, the lite tier ran hand-typed copies of 2 of the 12 folders and none of the rest, and nothing noticed when the spec changed a file.
Fixes #211.
What changes
testdata/<dir>is protowire'stestdata/<dir>byte for byte, schemas included: annotations, any, bigfloat, blocks, dataset, duplicates, duration, keyed, map-keys, nulls, repeated, strings, plustest.proto. It replaces the copies underpxf/src/test/resourcesandpxf/src/test/proto, which were taken from spec 234cf29 and had fallen behind (they lacked protowire#569's three required-field files).SpecCorpusTestadds the three folders it never ran (annotations, duration, repeated). It also fails if a copied folder has no test.lite-fixturesgenerates lite classes from the same schemas. Thejava_packageoption that the lite plugin requires is added at build time, so no edited copy is checked in.LiteCorpusTestruns every file throughLiteWireWriter, and throughLiteWireReaderwhere the corpus gives expected bytes or text.scripts/check-spec-corpus.shruns in the conformance job against spec main. It fails when a copy differs from the spec, or when the spec has a corpus folder that is neither copied nor listed with what covers it instead.What the first run found
Lite gaps, each filed and listed:
@typeis refused on lite (5 files).= { }block, bound to a repeated field (2 files).IllegalArgumentExceptioninstead ofPxfExceptionfor 3 files. The lite writer has 26 such throw sites; I commented the evidence on pxf lite: two null errors are raw IllegalArgumentException, not PxfException #191.@datasetrow binding, so only the parse-level verdicts run.Both tiers: the 3 required-field
nullfiles from protowire#569 (#189, which is the next PR).Evidence
./gradlew build --rerun-taskswith the CI plugin pin (-Dorg.gradle.project.pxfJavaMeta.repo=/nonexistent): BUILD SUCCESSFUL, 947 tests, 0 failures, every result file freshly written. That count reconciles with main's: +7 SpecCorpusTest, +1 gap-existence check, +123 LiteCorpusTest cases, −19 hand-typedLiteTablesTestrows.LiteCorpusTestruns 123 cases: 110 files plus 13 named tests. I counted the files by hand per folder to reconcile.blocks/space-in-block.pxf) listed as a gap, the test fails withmeets its verdict now: drop it from KNOWN_GAPS (#0).scripts/check-spec-corpus.shagainst spec main 8e08cd9:testdata/: 12 directories match the spec's. Against spec 234cf29, with a made-up folder added, it names annotations, dataset, keyed and nulls as differing, and flagsnewcorpusas neither copied nor listed.cross_envelope_check.shat 8e08cd9, against this branch, with both lite legs on (WITH_JAVA_LITE=1,WITH_JAVA_PXF_LITE=1), exited 0. All 6 ports write identical envelope bytes, and every annotation and wire-vector row is ok for java-lite and java-pxf-lite. Rust, Swift, Dart and C# were off.check-decodeandcheck-decode-android, which this PR doesn't touch. This PR's conformance job runs them.Also fixed
pxf-android'sKeyedLiteTestreadstestdata/keyed/, not the deletedpxf/src/test/resources/keyed/.values.tsv. protowire#518 merged, and the table matches (cmpclean).