-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache file reads #98
base: master
Are you sure you want to change the base?
Cache file reads #98
Conversation
@@ -15,6 +15,7 @@ | |||
|
|||
config.around do |example| | |||
ensure_fixtures("spec", "fixtures", "schemas") do | |||
JsonMatchers::Matcher.document_store = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to throw away our cache in each of the project's test suites?
Could you elaborate more on those details in the commit message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It clears shared state (cache) between test cases
Could you provide more details in the commit message? I'm very interested to learn more about the implications of these changes in your test suite, is that something that you've measured? |
Hi @seanpdoyle You can try benchmarks at https://github.com/dizer/json_matchers_cache
For our requests tests suite (124 JSON schema files, 5047 lines) it saved about a minute. |
Hi @seanpdoyle, any chance to get it merged? This feature is very helpful, with this patched version our specs working faster (3-4 minutes vs 20 minutes). If you don't have time to resolve conflicts let me know, I'll create a new PR. |
Hi @seanpdoyle. We also have same issues with speed in our tests after upgrade from 0.9 to 0.11 version. Could you merge this patch? |
@seanpdoyle Please help take a look at this when you have a chance, thanks! |
Now every match_json_schema call reloads the whole schema from disk. It may slow when there are many files (~1 second for each test example in our case).
This PR caches document store on the class level.