Anton Grbin
86abf35ef5
Python JSON parser: Ignore invalid enum string values if ignore_unknown_fields is set ( #15887 )
...
# Motivation
This PR fixes failing conformance tests for python with name `IgnoreUnknownEnumStringValue`.
The JSON parsing spec was discussed in https://github.com/protocolbuffers/protobuf/issues/7392 .
Recent equivalent changes for other languages:
* Swift: https://github.com/apple/swift-protobuf/pull/1345
* C#: https://github.com/protocolbuffers/protobuf/pull/15758
# Changes
- 1st commit is a noop refactoring to make relevant _ConvertScalarFieldValue invocations localized
- 2nd commit introduces the child exception of `ParseError` named `EnumStringValueParseError` which is suppressed if `ignore_unknown_fields` is set
- 3rd commit updates the conformance test failure lists
Closes #15887
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15887 from noom:anton/7392/fix-python-test fbcc93a232
PiperOrigin-RevId: 619288323
8 months ago
Anton Grbin
0fa67a94aa
JSON conformance test: repeated with a mix of known and unknown enum string values ( #15885 )
...
This test was suggested by @jskeet in the related issue: https://github.com/protocolbuffers/protobuf/issues/7392#issuecomment-1884666885
I am not confident that the failure lists are comprehensive (I only run a few tests locally) -- will fix once we get CI results.
Closes #15885
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15885 from noom:anton/7392/conformance-repeated-enum 60c35f0339
PiperOrigin-RevId: 609487784
10 months ago
Protobuf Team Bot
42ecd61b3e
Extend Proto2 JSON test cases to cover more of the preexisting Proto3 JSON cases.
...
PiperOrigin-RevId: 595998208
11 months ago
Mike Kruskal
15eccf3ec4
Implement Editions in Pure Python.
...
This change only covers pure python, and follow-up changes will handle C++/upb variants and actually enable editions support. The C++ one works (as evident from the conformance tests), but needs some APIs added to allow for testing.
PiperOrigin-RevId: 580304039
1 year ago
Anton Grbin
09f4901084
Copybara import of the project:
...
--
064b263c42
by Anton Grbin <anton@noom.com>:
squash and rebase
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/9534 from noom:anton/MIN-2347/json_conformance_unknown_fields 064b263c42
PiperOrigin-RevId: 488667851
2 years ago
Joshua Haberman
f77065d4eb
Sync from Piper @316511779
...
PROTOBUF_SYNC_PIPER
5 years ago
listonjesse
2ae7cf0e03
Auxillary -> Auxiliary
5 years ago
Rafi Kamal
6c92f9dff1
Down integrate to GitHub
5 years ago
Paul Yang
ce942bcae1
Add binary conformance tests for map fields ( #6560 )
...
* Add binary conformance tests for map fields
* Update failure list
* Fix php conformance test
* Fix php conformance test
In 32-bit platform, int64 should be string. However, map iterator returns string key as integer.
* Add more test cases for map
* Update failure list
5 years ago
Paul Yang
6c9d7ecfa4
Test singular fields are encoded in canonical way ( #6553 )
...
* Test singular fields are encoded in canonical way
* Defautl values in proto3 should not be encoded.
* Values should be converted to the canonical representation (e.g.,
long int64 value may be truncated for int32 field)
* Update failure list
* Update failure list
5 years ago
Yilun Chong
d8c2501b43
down integration from internal
6 years ago
Paul Yang
7f42d6d0bc
Fix empty FieldMask json encoding/decoding ( #5605 )
...
* Fix empty FieldMask json encoding/decoding
* Add failed test to python's conformance failure list
6 years ago
Feng Xiao
6bbe197e9c
Down-integrate from google3.
6 years ago
Paul Yang
8705adc228
Give a specific category to each test. ( #4965 )
...
* Give a unique category to each test.
This change introduce a TestCategory enum to ConformanceRequest. Existing tests
are divided into three categories: binary format test, json format test and json
format (ignore unknown when parsing) test. For the previous two categories, there
is no change to existing testee programs. For tests with the last category, testee programs
should either enable ignoring unknown field during json parsing or skip the test.
* Fix python test
* Fix java
* Fix csharp
* Update document
* Update csharp generated code
6 years ago
Paul Yang
26eeec93e4
Enable ignoring unknown in json parsing in php ( #4839 )
...
* Enable ignoring unknown in json parsing in php
* Update generated descriptor files
* Update failure list for other languages.
* Remove unnecessary php files
7 years ago
Adam Cozzette
ec40953257
Updated conformance failure lists
7 years ago
Adam Cozzette
0400cca323
Integrated internal changes from Google
7 years ago
Adam Cozzette
7bb8584f9d
Updated conformance failure lists
7 years ago
Adam Cozzette
92a7e778e7
Integrated internal changes from Google
7 years ago
Jisi Liu
1a7a7fca80
Merge from google internal
7 years ago
Jisi Liu
d974cc2e9a
Update conformance tests
7 years ago
Jisi Liu
759245a49a
Merge from master
7 years ago
Jisi Liu
7986ca7e53
Update conformance tests
7 years ago
Jisi Liu
09354db143
Merge from Google internal for 3.4 release
7 years ago
Yilun Chong
3adb054bbf
add some test proto2 supported, add js proto2 supported, fixed some error
8 years ago
Feng Xiao
fab8812cc1
Update python conformance failure list.
8 years ago
Feng Xiao
e47c068cfa
Update python conformance failure list.
8 years ago
Feng Xiao
d36c0c538a
Down-integrate from google3.
8 years ago
Adam Cozzette
5a76e633ea
Integrated internal changes from Google
8 years ago
Bo Yang
23d4688cce
Fix python bugs for internal integration.
8 years ago
Bo Yang
cc8ca5b6a5
Integrate internal changes
8 years ago
Bo Yang
c8b9d41f99
Fix python bugs for internal integration.
8 years ago
Bo Yang
98835fb8f8
Integrate internal changes
8 years ago
Thomas Van Lenten
80f65d2df8
Add note about JSON tests maybe being wrong. ( #1992 )
...
Add note about JSON tests maybe being wrong.
- Add note about the JSON test maybe not being correct yet.
- Add test to checks the generated names for double underscores to be sure they
are what is expected.
8 years ago
Thomas Van Lenten
ac3df39c22
Add conformance test for zero fields in oneofs. ( #1939 )
...
* Add conformance test for zero fields in oneofs.
* Add failures to the "expected" files.
8 years ago
Josh Haberman
4833b4c003
Surrogate checking is unpredictable, so always manually check.
9 years ago
Josh Haberman
bd98eae1c9
Fixed Python by updating failure lists and fixed a few broken tests.
...
Python 2.x doesn't detect unpaired surrogates so we have to
do that manually.
9 years ago
Josh Haberman
06fd6fa850
Fixed Python 3.x C++ build, and updated conformance failure lists.
9 years ago
Josh Haberman
e891c29f9b
Allow conformance test runner to tolerate crashes, and re-enable conformance tests.
9 years ago
Josh Haberman
4b31ffa488
Added Python failure lists, and fixes to make sure failure propagates.
9 years ago
Jon Skeet
15bf55e225
Validate that after reading a message, we've consumed as many bytes as we expected to.
...
We should now have no conformance failures.
9 years ago
Jon Skeet
b6defa7c11
Added C# conformance tests.
...
The tests are run from Travis in the same way as on other
platforms. Currently some expected failures - but only expected
in that they're what we got to start with. Will try to fix them in
other pull requests.
9 years ago