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
Add unit tests for storage module #446
Conversation
Thoughts? :) |
# from carbon.storage import loadStorageSchemas | ||
# from carbon.exceptions import CarbonConfigException | ||
# with self.assertRaises(CarbonConfigException): | ||
# loadStorageSchemas() |
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.
Please don't add large swaths of code that is commented out. Uncomment it or remove it.
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.
As I explained in the PR, I was hoping someone might be able to enlighten me regarding this mock persistence across tests. If not, sure I’ll remove it.
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.
Gotcha. I can look at it more tomorrow or this weekend
More tests are always great, although I'm not the biggest fan of having to do the imports in every test. DRY Please remove or fix the commented code and we will happen my merge this however. Thanks for doing this! |
I think I had to do this because of the mock persistence, although I am not entirely sure anymore. |
Add unit tests for storage module
@JeanFred Thanks that makes sense. Merged! Feel free to write more if you feel so inclined. Sorry this took so long to get merged |
Thanks for merging @SEJeff! What about the commented out code − shall we just leave it there until someone figures it out ? Or let’s remove it as it will probably rot otherwise ? |
As I was trying to track down either a bug in Carbon parsing or a mistake in my
storage-aggregation.conf
file (for the story, it turned out my carbon deamon just had to be restarted :-°), I ended up writing this test suite for the storage module.The all
NoConfigSchemaLoadingTest
class, whose purpose is to test what happens whenCONF_DIR
leads nowhere, is commented out though. For some reason, the mock ofcarbon.conf.settings
persists between classes. (if I testNoConfigSchemaLoadingTest
by itself it works fine). I have fiddled around with trying toreload(carbon.conf)
in setUp or tearDown but to no avail. Maybe someone will have a better idea? Otherwise I suppose it’s fine removing this test class alltogether.Hope that helps!