[jira] [Commented] (AVRO-2239) Fix interop tests
[ https://issues.apache.org/jira/browse/AVRO-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16690960#comment-16690960 ] ASF GitHub Bot commented on AVRO-2239: -- Fokko closed pull request #381: AVRO-2239: Fix RPC interop tests for Ruby URL: https://github.com/apache/avro/pull/381 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/lang/ruby/lib/avro/schema_validator.rb b/lang/ruby/lib/avro/schema_validator.rb index 67464fbfe..2117e92d4 100644 --- a/lang/ruby/lib/avro/schema_validator.rb +++ b/lang/ruby/lib/avro/schema_validator.rb @@ -130,6 +130,7 @@ def validate_array(expected_schema, datum, path, result) end def validate_map(expected_schema, datum, path, result) +fail TypeMismatchError unless datum.is_a?(Hash) datum.keys.each do |k| result.add_error(path, "unexpected key type '#{ruby_to_avro_type(k.class)}' in map") unless k.is_a?(String) end diff --git a/lang/ruby/test/test_schema_validator.rb b/lang/ruby/test/test_schema_validator.rb index 93f2ca85b..e77569a31 100644 --- a/lang/ruby/test/test_schema_validator.rb +++ b/lang/ruby/test/test_schema_validator.rb @@ -301,6 +301,10 @@ def test_validate_map assert_failed_validation("at . unexpected key type 'Symbol' in map") do validate!(schema, some: 1) end + +assert_failed_validation('at . expected type map, got null') do + validate!(schema, nil) +end end def test_validate_deep_record diff --git a/share/test/interop/bin/test_rpc_interop.sh b/share/test/interop/bin/test_rpc_interop.sh index f8ef7f5e8..3c9321bf8 100755 --- a/share/test/interop/bin/test_rpc_interop.sh +++ b/share/test/interop/bin/test_rpc_interop.sh @@ -29,15 +29,13 @@ java_server="java -jar lang/java/tools/target/avro-tools-$VERSION.jar rpcreceive py_client="python lang/py/build/src/avro/tool.py rpcsend" py_server="python lang/py/build/src/avro/tool.py rpcreceive" -#ruby_client="ruby -rubygems -Ilang/ruby/lib lang/ruby/test/tool.rb rpcsend" -#ruby_server="ruby -rubygems -Ilang/ruby/lib lang/ruby/test/tool.rb rpcreceive" +ruby_client="ruby -rubygems -Ilang/ruby/lib lang/ruby/test/tool.rb rpcsend" +ruby_server="ruby -rubygems -Ilang/ruby/lib lang/ruby/test/tool.rb rpcreceive" export PYTHONPATH=lang/py/build/src # path to avro Python module -#clients=("$java_client" "$py_client" "$ruby_client") -#servers=("$java_server" "$py_server" "$ruby_server") -clients=("$java_client" "$py_client") -servers=("$java_server" "$py_server") +clients=("$java_client" "$py_client" "$ruby_client") +servers=("$java_server" "$py_server" "$ruby_server") proto=share/test/schemas/simple.avpr This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Fix interop tests > - > > Key: AVRO-2239 > URL: https://issues.apache.org/jira/browse/AVRO-2239 > Project: Apache Avro > Issue Type: Improvement > Components: interop >Reporter: Fokko Driesprong >Assignee: Tim Perkins >Priority: Major > > Currently the interop tests are failing: > /avro/lang/ruby/lib/avro/schema_validator.rb:127:in `validate_map': undefined > method `keys' for nil:NilClass (NoMethodError) > from /avro/lang/ruby/lib/avro/schema_validator.rb:103:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:156:in `block in > validate_possible_types' > from /avro/lang/ruby/lib/avro/schema_validator.rb:154:in `map' > from /avro/lang/ruby/lib/avro/schema_validator.rb:154:in > `validate_possible_types' > from /avro/lang/ruby/lib/avro/schema_validator.rb:141:in > `validate_union' > from /avro/lang/ruby/lib/avro/schema_validator.rb:105:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:110:in `block in > validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:108:in `each' > from /avro/lang/ruby/lib/avro/schema_validator.rb:108:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:67:in `validate!' > from /avro/lang/ruby/lib/avro/schema.rb:97:in `validate' > from /avro/lang/ruby/lib/avro/io.rb:503:in `write_data' > from /avro/lang/ruby/lib/avro/io.rb:499:in `write' > from /avro/lang/ruby/lib/avro/ipc.rb:136:in `write_handshake_request' > from /avro/lang/ruby/lib/avro/ipc.rb:105:in `request' >
[jira] [Commented] (AVRO-2239) Fix interop tests
[ https://issues.apache.org/jira/browse/AVRO-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16690961#comment-16690961 ] ASF subversion and git services commented on AVRO-2239: --- Commit fe6a2fc4c4178633d85d84657520967893f18aec in avro's branch refs/heads/master from [~timperkins] [ https://gitbox.apache.org/repos/asf?p=avro.git;h=fe6a2fc ] AVRO-2239: Fix RPC interop tests for Ruby (#381) > Fix interop tests > - > > Key: AVRO-2239 > URL: https://issues.apache.org/jira/browse/AVRO-2239 > Project: Apache Avro > Issue Type: Improvement > Components: interop >Reporter: Fokko Driesprong >Assignee: Tim Perkins >Priority: Major > > Currently the interop tests are failing: > /avro/lang/ruby/lib/avro/schema_validator.rb:127:in `validate_map': undefined > method `keys' for nil:NilClass (NoMethodError) > from /avro/lang/ruby/lib/avro/schema_validator.rb:103:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:156:in `block in > validate_possible_types' > from /avro/lang/ruby/lib/avro/schema_validator.rb:154:in `map' > from /avro/lang/ruby/lib/avro/schema_validator.rb:154:in > `validate_possible_types' > from /avro/lang/ruby/lib/avro/schema_validator.rb:141:in > `validate_union' > from /avro/lang/ruby/lib/avro/schema_validator.rb:105:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:110:in `block in > validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:108:in `each' > from /avro/lang/ruby/lib/avro/schema_validator.rb:108:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:67:in `validate!' > from /avro/lang/ruby/lib/avro/schema.rb:97:in `validate' > from /avro/lang/ruby/lib/avro/io.rb:503:in `write_data' > from /avro/lang/ruby/lib/avro/io.rb:499:in `write' > from /avro/lang/ruby/lib/avro/ipc.rb:136:in `write_handshake_request' > from /avro/lang/ruby/lib/avro/ipc.rb:105:in `request' > from lang/ruby/test/tool.rb:69:in `send_message' > from lang/ruby/test/tool.rb:137:in `main' > from lang/ruby/test/tool.rb:143:in `' -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2239) Fix interop tests
[ https://issues.apache.org/jira/browse/AVRO-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16688578#comment-16688578 ] ASF GitHub Bot commented on AVRO-2239: -- tjwp opened a new pull request #381: AVRO-2239: Fix RPC interop tests for Ruby URL: https://github.com/apache/avro/pull/381 This fixes https://issues.apache.org/jira/browse/AVRO-2239 and re-enables RPC interop tests for Ruby. The fix is to check that a datum is a Ruby Hash before validating it as a map. The fix for this was already in https://github.com/apache/avro/pull/230, but I can rebase that PR if this makes it to master first. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Fix interop tests > - > > Key: AVRO-2239 > URL: https://issues.apache.org/jira/browse/AVRO-2239 > Project: Apache Avro > Issue Type: Improvement > Components: interop >Reporter: Fokko Driesprong >Assignee: Tim Perkins >Priority: Major > > Currently the interop tests are failing: > /avro/lang/ruby/lib/avro/schema_validator.rb:127:in `validate_map': undefined > method `keys' for nil:NilClass (NoMethodError) > from /avro/lang/ruby/lib/avro/schema_validator.rb:103:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:156:in `block in > validate_possible_types' > from /avro/lang/ruby/lib/avro/schema_validator.rb:154:in `map' > from /avro/lang/ruby/lib/avro/schema_validator.rb:154:in > `validate_possible_types' > from /avro/lang/ruby/lib/avro/schema_validator.rb:141:in > `validate_union' > from /avro/lang/ruby/lib/avro/schema_validator.rb:105:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:110:in `block in > validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:108:in `each' > from /avro/lang/ruby/lib/avro/schema_validator.rb:108:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:67:in `validate!' > from /avro/lang/ruby/lib/avro/schema.rb:97:in `validate' > from /avro/lang/ruby/lib/avro/io.rb:503:in `write_data' > from /avro/lang/ruby/lib/avro/io.rb:499:in `write' > from /avro/lang/ruby/lib/avro/ipc.rb:136:in `write_handshake_request' > from /avro/lang/ruby/lib/avro/ipc.rb:105:in `request' > from lang/ruby/test/tool.rb:69:in `send_message' > from lang/ruby/test/tool.rb:137:in `main' > from lang/ruby/test/tool.rb:143:in `' -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2239) Fix interop tests
[ https://issues.apache.org/jira/browse/AVRO-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16685235#comment-16685235 ] Fokko Driesprong commented on AVRO-2239: [~tjwp] Please do, I had to disable the tests for now: https://github.com/apache/avro/blob/master/share/test/interop/bin/test_rpc_interop.sh#L37-L38 > Fix interop tests > - > > Key: AVRO-2239 > URL: https://issues.apache.org/jira/browse/AVRO-2239 > Project: Apache Avro > Issue Type: Improvement > Components: interop >Reporter: Fokko Driesprong >Assignee: Tim Perkins >Priority: Major > > Currently the interop tests are failing: > /avro/lang/ruby/lib/avro/schema_validator.rb:127:in `validate_map': undefined > method `keys' for nil:NilClass (NoMethodError) > from /avro/lang/ruby/lib/avro/schema_validator.rb:103:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:156:in `block in > validate_possible_types' > from /avro/lang/ruby/lib/avro/schema_validator.rb:154:in `map' > from /avro/lang/ruby/lib/avro/schema_validator.rb:154:in > `validate_possible_types' > from /avro/lang/ruby/lib/avro/schema_validator.rb:141:in > `validate_union' > from /avro/lang/ruby/lib/avro/schema_validator.rb:105:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:110:in `block in > validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:108:in `each' > from /avro/lang/ruby/lib/avro/schema_validator.rb:108:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:67:in `validate!' > from /avro/lang/ruby/lib/avro/schema.rb:97:in `validate' > from /avro/lang/ruby/lib/avro/io.rb:503:in `write_data' > from /avro/lang/ruby/lib/avro/io.rb:499:in `write' > from /avro/lang/ruby/lib/avro/ipc.rb:136:in `write_handshake_request' > from /avro/lang/ruby/lib/avro/ipc.rb:105:in `request' > from lang/ruby/test/tool.rb:69:in `send_message' > from lang/ruby/test/tool.rb:137:in `main' > from lang/ruby/test/tool.rb:143:in `' -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AVRO-2239) Fix interop tests
[ https://issues.apache.org/jira/browse/AVRO-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16685193#comment-16685193 ] Tim Perkins commented on AVRO-2239: --- I can work on a fix for this. > Fix interop tests > - > > Key: AVRO-2239 > URL: https://issues.apache.org/jira/browse/AVRO-2239 > Project: Apache Avro > Issue Type: Improvement > Components: interop >Reporter: Fokko Driesprong >Assignee: Tim Perkins >Priority: Major > > Currently the interop tests are failing: > /avro/lang/ruby/lib/avro/schema_validator.rb:127:in `validate_map': undefined > method `keys' for nil:NilClass (NoMethodError) > from /avro/lang/ruby/lib/avro/schema_validator.rb:103:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:156:in `block in > validate_possible_types' > from /avro/lang/ruby/lib/avro/schema_validator.rb:154:in `map' > from /avro/lang/ruby/lib/avro/schema_validator.rb:154:in > `validate_possible_types' > from /avro/lang/ruby/lib/avro/schema_validator.rb:141:in > `validate_union' > from /avro/lang/ruby/lib/avro/schema_validator.rb:105:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:110:in `block in > validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:108:in `each' > from /avro/lang/ruby/lib/avro/schema_validator.rb:108:in > `validate_recursive' > from /avro/lang/ruby/lib/avro/schema_validator.rb:67:in `validate!' > from /avro/lang/ruby/lib/avro/schema.rb:97:in `validate' > from /avro/lang/ruby/lib/avro/io.rb:503:in `write_data' > from /avro/lang/ruby/lib/avro/io.rb:499:in `write' > from /avro/lang/ruby/lib/avro/ipc.rb:136:in `write_handshake_request' > from /avro/lang/ruby/lib/avro/ipc.rb:105:in `request' > from lang/ruby/test/tool.rb:69:in `send_message' > from lang/ruby/test/tool.rb:137:in `main' > from lang/ruby/test/tool.rb:143:in `' -- This message was sent by Atlassian JIRA (v7.6.3#76005)