Closed OrangeTux closed 4 months ago
I think I solved my problem, but ran in new ones.
First of all, one should copy the the entire content of https://github.com/json-schema-org/JSON-Schema-Test-Suite to jsonschema/tests/suite.
One way of doing that is cloning the repository to that location:
jsonschema/ $ git clone https://github.com/json-schema-org/JSON-Schema-Test-Suite.git tests/suite
cargo run
executes all tests. However, a lot of them fail:
$ jsonschema/ $ cargo test
...
failures:
test_draft_draft4::optional_bignum_0_1
test_draft_draft4::optional_ecmascript_regex_16_1
test_draft_draft4::optional_ecmascript_regex_16_2
test_draft_draft4::optional_ecmascript_regex_18_2
test_draft_draft4::refRemote_7_0
test_draft_draft4::refRemote_7_1
test_draft_draft4::ref_6_0
test_draft_draft4::ref_6_1
test_draft_draft6::maxItems_1_0
test_draft_draft6::maxItems_1_1
test_draft_draft6::maxLength_1_0
test_draft_draft6::maxLength_1_1
test_draft_draft6::maxProperties_1_0
test_draft_draft6::maxProperties_1_1
test_draft_draft6::minItems_1_0
test_draft_draft6::minItems_1_1
test_draft_draft6::minLength_1_0
test_draft_draft6::minLength_1_1
test_draft_draft6::minProperties_1_0
test_draft_draft6::minProperties_1_1
test_draft_draft6::optional_ecmascript_regex_16_1
test_draft_draft6::optional_ecmascript_regex_16_2
test_draft_draft6::optional_ecmascript_regex_18_2
test_draft_draft6::refRemote_10_0
test_draft_draft6::refRemote_10_1
test_draft_draft6::refRemote_8_0
test_draft_draft6::refRemote_8_1
test_draft_draft6::ref_6_0
test_draft_draft6::ref_6_1
test_draft_draft7::maxItems_1_0
test_draft_draft7::maxItems_1_1
test_draft_draft7::maxLength_1_0
test_draft_draft7::maxLength_1_1
test_draft_draft7::maxProperties_1_0
test_draft_draft7::maxProperties_1_1
test_draft_draft7::minItems_1_0
test_draft_draft7::minItems_1_1
test_draft_draft7::minLength_1_0
test_draft_draft7::minLength_1_1
test_draft_draft7::minProperties_1_0
test_draft_draft7::minProperties_1_1
test_draft_draft7::optional_cross_draft_0_0
test_draft_draft7::optional_ecmascript_regex_16_1
test_draft_draft7::optional_ecmascript_regex_16_2
test_draft_draft7::optional_ecmascript_regex_18_2
test_draft_draft7::optional_format_time_0_10
test_draft_draft7::optional_format_time_0_13
test_draft_draft7::optional_format_time_0_16
test_draft_draft7::optional_format_time_0_17
test_draft_draft7::optional_format_time_0_20
test_draft_draft7::optional_format_time_0_21
test_draft_draft7::optional_format_time_0_24
test_draft_draft7::refRemote_10_0
test_draft_draft7::refRemote_10_1
test_draft_draft7::refRemote_8_0
test_draft_draft7::refRemote_8_1
test_draft_draft7::ref_6_0
test_draft_draft7::ref_6_1
test_instance_path
test result: FAILED. 3235 passed; 59 failed; 57 ignored; 0 measured; 0 filtered out; finished in 0.56s
Do you have any suggestions?
The project uses a specific commit from that repo via a git submodule. git submodule init
and git submodule update
should do the trick, but I guess the project will benefit from contributing docs.
I see. Thanks! I'll open a PR soon to fix the documentation.
How do I execute the unit tests?
I ran
cargo test
in jsonschema/, but that fails with:I solved this particular issue by cloning the repository https://github.com/json-schema-org/JSON-Schema-Test-Suite and copying the tests/ folder to jsonschema/tests/suite.
That resulted in another error: