[
https://issues.apache.org/jira/browse/AVRO-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12780714#action_12780714
]
Matt Massie commented on AVRO-230:
----------------------------------
bq. I'd vote for a "valid_schemas" directory too.
Jeff: By definition, all schema in the "valid_data" directory must be valid and
the "json_data" and "binary_data" directories are optional. So it would be
easy to test an array of schemas without much hassle.
e.g.
valid_data
* test_foo
** schema.json
* test_bar
** schema.json
* test_baz
** schema.json
would be all you need to test three schema without any data tests.
bq. We should probably do the same thing for valid/invalid protocols.
Jeff: +1 on your and Doug's suggestion to also include valid requests and
responses
bq. In valid_data/binary_data, should each file contain just a single
serialized object with no headers, etc, or should it be a data file?
Doug: I think you're correct in have a separate directory for single objects
and objects inside a container. This would allow people writing new language
bindings to test objects eoncoding/decoding without needing to implement any
containers.
bq. To support validation, we could store a random seed in data file's
metadata. Then a validator can read the file while generating random objects
from the seed and schema and check that the two match.
Doug: +1 I really like this idea. Couldn't we just (1) seed with a fixed
number, (2) encode schema with random data and then (3) save away the next
random number? The implementation validating the schema would then (1) seed
with a fixed number, (2) decode the data and (3) generate a random number and
compare to the encoders stored value?
Or did I just repeat your recommendation using different words?
> Create a shared schema test directory structure
> -----------------------------------------------
>
> Key: AVRO-230
> URL: https://issues.apache.org/jira/browse/AVRO-230
> Project: Avro
> Issue Type: New Feature
> Components: c, c++, java, python
> Reporter: Matt Massie
> Assignee: Matt Massie
> Fix For: 1.3.0
>
>
> This is an example of my proposed directory structure:
> * invalid_schemas/
> ** broken.json
> ** wrong.json
> * valid_data/
> ** foo_test/
> *** schema.json
> *** json_data/
> **** valid_json_test_data.json
> **** more_valid_json_test_data.json
> *** binary_data/
> **** valid_binary_test_data.bin
> **** more_test_data.bin
> ** bar_test/
> *** schema.json
> *** json_data/
> **** ...
> * invalid_data/
> ** baz_test/
> *** schema.json
> *** json_data/
> **** ...
> *** binary_data/
> **** ...
> This structure supports positive and negative tests for avro schemas, json
> data and binary data.
> * The "invalid_schema" directory holds a number of invalid schemas that
> should fail to parse.
> * The "valid_data" directory has a number of self-contained tests in separate
> directories. Each test directory is required to have a "schema.json" file
> that valid avro schema. The "json_data" and "binary_data" directories are
> optional for each test.
> * The "invalid_data" directory has the same rules as the "valid_data"
> directory. The data files should fail during tests (negative testing).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.