Yelp / swagger-spec-compatibility

Python library to check Swagger Spec backward compatibility
https://swagger-spec-compatibility.readthedocs.org
Apache License 2.0
20 stars 8 forks source link

run validate rules in parallel #38

Closed gyDBD closed 3 years ago

gyDBD commented 3 years ago

run validate rules in parallel so that we can save lots of time

Testing Done

$ old_spec_path=docs/source/rules/examples/REQ-E001/old.yaml
$ new_spec_path=docs/source/rules/examples/REQ-E001/new.yaml

$ python swagger_spec_compatibility/__main__.py run ${old_spec_path} ${new_spec_path}
ERROR rules:
    [REQ-E001] Added Required Property in Request contract: #/paths//endpoint/post/parameters/0/schema (documentation: https://swagger-spec-compatibility.readthedocs.io/en/latest/rules/REQ-E001.html)

test with biz_app swagger.json

 $ time python swagger_spec_compatibility/__main__.py run ${old_spec_path} ${new_spec_path}

real    1m25.693s
user    3m36.622s
sys 0m13.407s

on master
$ time python swagger_spec_compatibility/__main__.py run ${old_spec_path} ${new_spec_path}

real    3m40.959s
user    3m27.906s
sys 0m12.715s

make test passed