bjoern
bjoern copied to clipboard
Port of test scripts to unit tests
Closes #52.
This is really great. Thanks a million.
Minor suggestions in the review.
Maybe you can also add some proper test description docstrings rather than tests/fileabc.py
-- at this point you know better than I what the tests do! (Single sentence should be enough!)
One thing we have to think about is that some of the tests are useful only when called 1000s of times, for example the exception tests, which are used to check for memory leaks. Not sure if that's easily automated; otherwise there should be a way to run a list of WSGI applications without the actual test code so we can use the "old" way of bombarding bjoern using make ab
etc
One thing we have to think about is that some of the tests are useful only when called 1000s of times, for example the exception tests, which are used to check for memory leaks.
I will look into it, however I'm not sure whether it is a task for unit tests and pytest
. Does it look more like load testing? Usually I write load tests with locust
, would it be an option for you?
I will look into it, however I'm not sure whether it is a task for unit tests and
pytest
. Does it look more like load testing? Usually I write load tests withlocust
, would it be an option for you?
Sorry for the delay!
Locust is fine for me, or any other tool pretty much.
Yes it's more like load testing. Best case we can load test a bjoern instance and monitor memory use
BUT some of the tests I also used for manual load/performance testing, for example when comparing requests/s for two revisions of bjoern. So if we could have a way to start an instance with a single test case WSGI app that would be awesome
Is there any plans to merge this PR? Its great for helping development.
Yes when the things I mentioned above are implemented.
I think that an idea could be to merge this PR and add an issue (improvement) for missing tests, probably, if @hoefling are currently busy, other contributors could help on. @jonashaag what do you think about?
No. That does not solve the problem that nobody is working on this PR at the moment. The current version is strictly less valuable than the one in the repo.
This PR (and the other one I have started working at for #121) were parts of making bjoern
pass the requirements of our internal QA & security team. Since then, we have moved from WSGI, so bjoern
is not a requirement anymore; I thus don't have the time to work on the tests anymore. Feel free to use the code in this PR if you want to finish the task - just create your own PR and apply the diff from this one.
However, I don't see any issues with merging the current state as IIRC the existing test scripts are not removed so they are still usable for manual load tests.
You have a policy that 3rd party application test suites must be automated? 😀