-
Notifications
You must be signed in to change notification settings - Fork 157
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
"Coverage Drift" protection doesn't seem to work #366
Comments
HashRedisStore was intended to take md5 hash of the file into account. https://github.com/danmayer/coverband/blob/master/lib/coverband/adapters/hash_redis_store.rb#L180 Are you testing in development? If so are you restarting your instance when you change a file? Thought is that maybe caching of the md5 per file is getting in the way? |
@kbaum Yes I am testing in development, and not restarting when I change. I didn't consider that it was caching the hash. It does seem to be working when I restart the server. The |
Great to hear that worked! Another gotcha to add to the README :). |
Yeah if in dev, this would be an issue. Sorry for the confusion @maxp-hover I guess we could check the config I do think we could add a 'dev testing gotcha' to the readme as @kbaum suggested |
We are setting up coverband and trying to think ahead about any edge cases that we may encounter. One of those cases would be "coverage drift". I have read the issue thread #118 and taken a look at the merged PR #137
I have been running some tests and it doesn't seem the "coverage drift" protection is working. If I call a method in a file, change its content, perform some action within it again, and then report the coverage, it shows line usage on lines which are impossible to run (on whitespace, or
end
lines, etc). It doesn't seem like the changed MD5 hash is invalidating the file in the redis db, or performing any kind of clearing of the file's state.We are using HashRedisStore by the way. Would this have any impact on whether or not "coverage drift" protection works? I see in the above linked issues some mention of a "time since last changed" attribute, did this make it to the light of day?
We perform daily deploys and so it isn't feasible for us to clear the coverage DB every deploy. Ideally we would clear the coverage data for only those files which were changed, and be able to see when was the last time they were cleared.
Best regards Max
The text was updated successfully, but these errors were encountered: