Releases: NyanKiyoshi/pytest-django-queries
Releases · NyanKiyoshi/pytest-django-queries
Support of pytest-xdist 2.0
- pytest-xdist compatibility was fixed for latest major version: 2.0. The bad terminologies (slaves and masters) were removed;
- Deprecated support of pytest-xdist <2.0, will be dropped on pytest-django-queries 2.0 release;
- Official compatibility for Python 2.7, 3.4 and 3.5 was dropped.
Fixed daily CI job against PyPi
The daily CI ensuring the package is working fine upstream was failing, it is now fixed.
Fix compatibility with latest pytest-xdist - deprecate bad terminologies
- Some tests were failing probably from a old file formatting.
- pytest-xdist compatibility was fixed for latest major version: 2.0
the bad terminologies (slaves and masters) were removed. - Deprecated support of pytest-xdist <2.0, will be dropped on
pytest-django-queries 2.0 release. - Official compatibility for Python 2.7, 3.4 and 3.5 was dropped
as many dependencies are no longer supporting those versions.
Use this plugin on those Python version at your own risk.
Display duplicate query count
- The cli tools now display the number of duplicated queries.
First stable release!
- Released the stable v1.0.0 release without any changes.
Third and final release candidate! Lots of workers!
The plugin now supports pytest-xdist
which allows you to run as many tests per worker as you want while running our plugin!
In the second release candidate we also did:
- Renamed the marker description to be more meaningful about was it does.
- Fixed a typo in the project description (PyPi and GitHub).
- Added help texts for named parameters in the cli.
- Fixed the wrong help text saying it is taking an integer when it actually expects a file path.
- Users can now mark tests without having the
count_queries
fixture injected automatically if a custom order or manual usage is needed. - Added a better filtering of unwanted keywords in humanization of test names. It now handles test cases names inside modules (dotted import names).
- Added a
backup
command todjango-queries
to make it easier of making a copy of the current results.
First release candidate! Stability!
v1.0.0rc1 - May 24th 2019
- Users can now backup/copy their previous results using the
--django-backup-queries
parameter when runningpytest
. - The HTML cli command now exports to
django-queries-results.html
by default instead ofstdout
, instead, users have to rundjango-queries html -
for the output to go instdout
. - The code now enforces the Black code style and Flake 8 checks in addition to isort.
Diff command!
First alpha! - The save path is now a constant
- In #12, stopped storing the benchmark results in a file named after the current date and time.
Instead, it will always save into.django-queries
and won't contain ajson
file extension
anymore to make it less appealing as it's not meant to be read by a human. - In #12, dropped the environment variable
PYTEST_QUERIES_SAVE_PATH
and replaced
and introduced the--django-db-bench PATH
option instead, which does exactly the same thing.
TL;DR: a report will be generated in your current working directory and will be called .pytest-queries
.
To override the save path, pass the --django-db-bench PATH
option to pytest.
The result visualizing tools are now implemented
- Introduced the cli (#3) with two commands:
-
show
that process a given benchmark result to render a summary table -
html
render the table in HTML, the template can be customized using--template <path>
-
Usage: django-queries [OPTIONS] COMMAND [ARGS]...
Command line tool for pytest-django-queries.
Options:
--help Show this message and exit.
Commands:
html Render the results as HTML instead of a raw table.
show View a given rapport.
Visualising Results
You can generate a table from the tests results by using the show
command:
django-queries show <json file>
You will get something like this to represent the results:
+---------+-------------------------+
| Module | Tests |
+---------+-------------------------+
| module1 | +-----------+---------+ |
| | | Test Name | Queries | |
| | +-----------+---------+ |
| | | test1 | 0 | |
| | +-----------+---------+ |
| | | test2 | 1 | |
| | +-----------+---------+ |
+---------+-------------------------+
| module2 | +-----------+---------+ |
| | | Test Name | Queries | |
| | +-----------+---------+ |
| | | test1 | 123 | |
| | +-----------+---------+ |
+---------+-------------------------+
| module3 | |
+---------+-------------------------+
Exporting the results (HTML)
For a nicer presentation, use the html
command, to export the results as HTML.
django-queries html <json file> > results.html