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
Make test suite run faster #115
Conversation
… setup of asset types
Test results
|
To summarise: the main time savers are to:
|
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.
I commend you for this effort! I didn't check every test in itself, but they do still all pass, which is also some feedback, and some do so really fast. Kudos.
One thing I would want to see a little different concerns being explicit (as per usual):
As I see it, the biggest organisational change is that you divided many test files into the ones with function-level db creation, and the one with module-level db creation.
OI think that's fine, as it can guide future test authors to make a decision about this. We could even explicitly state that this is a part of writing tests now. A policy. Could be mentioned in the main conftest.
And the filenames go a little like this: test_fresh_api_v1.py
. I would be more explicit (what is "fresh_api"?), e.g. test_api_v1_fresh_db.py
I renamed according to your suggestions and updated the developer documentation in our main conftest. |
documentation/changelog.rst
Outdated
@@ -18,6 +18,7 @@ Bugfixes | |||
Infrastructure / Support | |||
---------------------- | |||
* Make assets use MW as their default unit and enforce that in CLI, as well (API already did) [see `PR #108 <http://www.github.com/SeitaBV/flexmeasures/pull/108>`_] | |||
* Recycle the test database to shave 2/3rd off of the time it takes for the FlexMeasures test suite to run [see `PR #115 <http://www.github.com/SeitaBV/flexmeasures/pull/115>`_] |
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.
I'd say "Re-use the database between the automated tests, if possible. This shaves 2/3rd off the time ..."
closes #114