Commit Graph

45 Commits

Author SHA1 Message Date
Joshua Haberman
dd69a484c0
Updated version of upb for Ruby (#8624)
* Updated upb.

* Preserve legacy behavior for unset messages.

* Updated failure list.

* Updated CHANGES.txt.

* Added erroneously-deleted test file.

* Fixed condition on compatibility code.

* Re-introduced deleted file again, and fixed Rakefile to not delete it.

* Fix generation of test protos.
2021-05-17 22:40:33 -07:00
Joshua Haberman
4047c3eac8 Add new test to failure list where appropriate. 2021-04-16 10:52:37 -07:00
Joshua Haberman
9abf6e2ab0
Ported Ruby extension to upb_msg (#8184)
* WIP.

* WIP.

* WIP.

* WIP.

* WIP.

* WIP.

* Added some missing files.

* WIP.

* WIP.

* Updated upb.

* Extension loads, but crashes immediately.

* Gets through the test suite without SEGV!

Still a lot of bugs to fix, but it is a major step!

214 tests, 378 assertions, 37 failures, 147 errors, 0 pendings, 0 omissions, 0 notifications
14.0187% passed

* Test and build for Ruby 3.0

* Fixed a few more bugs, efficient #inspect is almost done.

214 tests, 134243 assertions, 30 failures, 144 errors, 0 pendings, 0 omissions, 0 notifications
18.6916% passed

* Fixed message hash initialization and encode depth checking.

214 tests, 124651 assertions, 53 failures, 70 errors, 0 pendings, 0 omissions, 0 notifications
42.5234% passed

* A bunch of fixes to failing tests, now 70% passing.

214 tests, 202091 assertions, 41 failures, 23 errors, 0 pendings, 0 omissions, 0 notifications
70.0935% passed

* More than 80% of tests are passing now.

214 tests, 322331 assertions, 30 failures, 9 errors, 0 pendings, 0 omissions, 0 notifications
81.7757% passed

Unfortunately there is also a sporadic bug/segfault hanging around
that appears to be GC-related.

* Add linux/ruby30 and macos/ruby30

* Use rvm master for 3.0.0-preview2

* Over 90% of tests are passing!

214 tests, 349898 assertions, 15 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
92.5234% passed

* Passes all tests!

214 tests, 369388 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed

* A bunch of cleanup.

1. Removed a bunch of internal-only symbols from headers.
2. Required a frozen check to get a non-const pointer to a map or array.
3. De-duplicated the code to get a type argument for Map/RepeatedField.

* Removed a bunch more stuff from protobuf.h.  There is an intermittent assert failure.

Intermittent failure:

ruby: ../../../../ext/google/protobuf_c/protobuf.c:263: ObjectCache_Add: Assertion `rb_funcall(obj_cache2, (__builtin_constant_p("[]") ? __extension__ ({ static ID rb_intern_id_cache; if (!rb_intern_id_cache) rb_intern_id_cache = rb_intern2((("[]")
), (long)strlen(("[]"))); (ID) rb_intern_id_cache; }) : rb_intern("[]")), 1, key_rb) == val' failed

* Removed a few more things from protobuf.h.

* Ruby 3.0.0-preview2 to 3.0.0

* Require rake-compiler-dock >= 1.1.0

* More progress, fighting with the object cache.

* Passes on all Ruby versions!

* Updated and clarified comment regarding WeakMap.

* Fixed the wyhash compile.

* Fixed conformance tests for Ruby.

Conformance results now look like:

RUBYLIB=../ruby/lib:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_ruby.txt --text_format_failure_list text_format_failure_list_ruby.txt ./conformance_ruby.rb

CONFORMANCE TEST BEGIN ====================================

CONFORMANCE SUITE PASSED: 1955 successes, 0 skipped, 58 expected failures, 0 unexpected failures.

CONFORMANCE TEST BEGIN ====================================

CONFORMANCE SUITE PASSED: 0 successes, 111 skipped, 8 expected failures, 0 unexpected failures.

Fixes include:

- Changed Ruby compiler to no longer reject proto2 maps.
- Changed Ruby compiler to emit a warning when proto2 extensions are
  present instead of rejecting the .proto file completely.
- Fixed conformance tests to allow proto2 and look up message by name
  instead of hardcoding a specific list of messages.
- Fixed conformance test to support the "ignore unknown" option for
  JSON.
- Fixed conformance test to properly report serialization errors.

* Removed debug printf and fixed #inspect for floats.

* Fixed compatibility test to have proper semantics for #to_json.

* Updated Makefile.am with new file list.

* Don't try to copy wyhash when inside Docker.

* Fixed bug where we would forget that a sub-object is frozen in Ruby >=2.7.

* Avoid exporting unneeded symbols and refactored a bit of code.

* Some more refactoring.

* Simplified and added more comments.

* Some more comments and simplification. Added a missing license block.

Co-authored-by: Masaki Hara <hara@wantedly.com>
2021-01-13 12:16:25 -08:00
Joshua Haberman
492d0b543e Added new failing conformance tests to failure list. 2020-08-17 17:15:34 -07:00
Joshua Haberman
c8e682adca Added new failure to the failure lists. 2020-05-11 11:31:38 -07:00
Joshua Haberman
dfff1ac2cf Added new failing conformance test to Ruby, PHP, and C#. 2020-05-07 17:10:11 -07:00
Joshua Haberman
f2c5ee5117
Fix for JSON serialization of 0/empty-valued wrapper types (#7198)
* Fixed Ruby JSON serialization of 0/empty wrapper fields.

* Removed newly-passing conformance tests from the failure list.
2020-02-11 13:18:32 -08:00
Rafi Kamal
394f5c8c0f Whitelist newly added conformance test failures for Ruby, C#, and PHP 2019-11-12 13:38:58 -08:00
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
2019-09-03 10:47:32 -07:00
Paul Yang
659e799fb8
Sync upb (#6577)
* Sync upb

* https://github.com/protocolbuffers/upb/pull/208

* Fix php c extension compiling

Don't use macros defined by upb

* Update ruby conformance failure list
2019-08-27 13:14:57 -07:00
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
2019-08-23 12:20:19 -07:00
Paul Yang
0c4b607e98
Conformance packed (#6447)
* Add conformance tests for explicit packed/unpacked fields

* Fix typo

* Update failure lists

* Update failure list

* Use enum class to make enum scoped
2019-08-02 14:35:44 -07:00
Paul Yang
a9bb65643b
Add binary conformance test for default repeated fields (#6440)
* Add binary conformance test for default repeated fields

1) Both packed and unpacked encoding should be accepted for parsing.
2) Encode should follow the default way for the syntax.

* Uncomment test

* Remove is_primitive

* Add failed tests to failure lists.

* Add failed test to failure list

* Use binary format to specify expected value

Text format cannot distinguish whether repeated field is packed or not.

* Change method name from ToHexString to ToOctString

* Add failed test to failure list

* Add failed test to php's failure list

* Fix comments
2019-07-26 10:05:14 -07:00
Bo Yang
bc742640ef Merge remote-tracking branch 'origin/3.8.x' 2019-06-21 04:01:45 +00:00
Paul Yang
640423f157
Change int64 json encoding to be string for php and ruby (#6251)
* Change int64 json encoding to be string for php and ruby

* Fix ruby test

* Sync upb change
2019-06-17 13:14:27 -07:00
Hao Nguyen
6b4b9869ec
Add a new conformance test for top level JSON null (#5966)
* Add a new conformance test for top level JSON null
2019-04-24 15:29:17 -07:00
Bo Yang
2d9507ec74 Update upb for ruby 2019-03-28 02:17:39 +00:00
Paul Yang
e75a689f7c
Fix ruby continuous tests (#5853)
* Fix ruby continuous tests

* Fix compatibility test
2019-03-07 17:16:31 -08:00
Paul Yang
37a0ab7d83
Fix Any json encoding/decoding for ruby. (#5592)
* Fix Any json encoding/decoding for ruby.

* Revert unnecessary changes
2019-01-17 10:24:41 -08:00
Paul Yang
aa5c12e882
Revert "Revert "Enable the ignore_unknown_field option in the Ruby unmarshal options" (#5511)" (#5533)
* Revert "Revert "Enable the ignore_unknown_field option in the Ruby unmarshal options" (#5511)"

This reverts commit be1716a6d0.

* Separate ruby conformance test on Mac

* Fix shell syntax

* Fix test
2019-01-08 10:53:34 -08:00
Paul Yang
be1716a6d0
Revert "Enable the ignore_unknown_field option in the Ruby unmarshal options" (#5511) 2018-12-26 12:26:24 -08:00
Erik Benoist
9ac11326df Adds the ability to ignore unknown fields on parse
This adds the ability for the MRI Ruby library to optionally pass in a
ignore_unknown_fields option when decoding JSON. The functionality was
added upstream in upb, this change exposes that option.
2018-12-21 16:06:21 -06:00
Paul Yang
98e26a4195
Add missing reference to conformanc_test_impl.cc in Makefile (#5100)
* Add missing reference to conformanc_test_impl.cc in Makefile

* Update conformance failure list
2018-08-31 10:47:58 -07:00
Feng Xiao
6bbe197e9c Down-integrate from google3. 2018-08-08 17:00:41 -07:00
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
2018-07-09 14:29:23 -07:00
Adam Cozzette
f91cf0559c Updated Ruby conformance test failure list
This commit adds two entries to the conformance failure list for Ruby.
It seems that these particular test cases have been failing since they
were introduced in 5140bae383, so there
has not been any regression.
2018-03-23 10:23:47 -07:00
Paul Yang
23adfeb003 Reserve unknown in Ruby (#3763)
* Reserve unknown in ruby

* Revert ruby tests. Wait for cpp impl for conformance test

* Add conformance test for preserving unknown

* Add unknown field conformance test to csharp failure list.

* Fix comments

* Fix comment

* Fix comments

* Fix typo

* Use stringsink_string directly

* Mark hd unused

* Remove unused encodeunknown_handlerfunc
2017-10-26 14:41:43 -07:00
Jisi Liu
19b8c8bfd3 Update conformance tests again. 2017-07-25 16:08:17 -07:00
Jisi Liu
d974cc2e9a Update conformance tests 2017-07-25 12:22:32 -07:00
Jisi Liu
759245a49a Merge from master 2017-07-25 11:52:33 -07:00
Jisi Liu
7986ca7e53 Update conformance tests 2017-07-19 12:07:35 -07:00
Joshua Haberman
1325588982 Updated upb to fix JSON conformance issues. (#3206)
* Fixed a bunch of Ruby conformance errors.

* Fixed some more Ruby conformance errors in JSON.
2017-06-19 15:13:24 -07:00
Thomas Van Lenten
dd19b876d4 Raise the number of digits used for floats.
About 1.5% of all IEEE754 single-precision numbers require nine
decimal digits to represent accurately.
2017-06-16 15:24:33 -04:00
Feng Xiao
1f077a0183 Update conformance failure lists. 2016-11-18 15:36:18 -08:00
Bo Yang
31dd4998df Fix bugs for csharp and ruby for internal integration. 2016-10-10 11:43:48 -07:00
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.
2016-08-23 08:19:45 -04:00
Thomas Van Lenten
7437774a27 More JSON tests
- String behaviors
- Testing only valid JSON is allowed
2016-08-22 12:07:33 -04:00
Thomas Van Lenten
e389165586 Add more JSON tests around underscores (#1963)
Add more JSON tests around underscores
2016-08-16 09:02:27 -04:00
Thomas Van Lenten
27c8962505 Add more types to the zero oneof cases.
Incase the different runtimes have different generation/implementations for
for the different primitive field types, cover a larger range of the proto
types in the oneof zero tests.
2016-08-11 13:15:01 -04:00
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.
2016-08-11 09:44:07 -04:00
Josh Haberman
e67ef3d449 Bugfix for JSON error case. 2016-04-14 20:27:45 -07:00
Josh Haberman
78da66698b Changed Ruby to properly camelCase its JSON by default. 2016-02-18 10:50:14 -08:00
Josh Haberman
e891c29f9b Allow conformance test runner to tolerate crashes, and re-enable conformance tests. 2016-01-11 16:15:46 -08:00
Josh Haberman
5bdf4a4271 Fixed several Ruby conformance test cases through upb update.
Change-Id: Ief77de7134e05e07b1a7e3970d49880c2d5e6fe9
2015-08-12 18:50:15 -07:00
Josh Haberman
181c7f2636 Added Ruby to conformance tests.
This involved fixing a few important bugs in the
Ruby implementation -- mostly cases of mixing
upb field types and descriptor types (upb field
types do not distinguish between int/sint/fixed/sfixed
like descriptor types do).

Also added protobuf-specific exceptions so parse
errors can be caught specifically.

Change-Id: Ib49d3db976900b2c6f3455c8b88af52cfb86e036
2015-07-16 12:25:55 -07:00