zsoldosp / django-performance-testing Goto Github PK
View Code? Open in Web Editor NEWPerformance testing for Django through your automated tests!
License: BSD 3-Clause "New" or "Revised" License
Performance testing for Django through your automated tests!
License: BSD 3-Clause "New" or "Revised" License
Hi, is there any plan to support Django 2.0?
I'm getting this error:
Invalid template library specified. ImportError raised when trying to load 'django_performance_testing.templatetags.djpt_limits': cannot import name 'getargspec'
Thx
flake8 django_performance_testing tests proof-of-concepts
tests/testapp/sixmock.py:2:80: E501 line too long (86 > 79 characters)
make: *** [lint] Error 1
ERROR: InvocationError: '/usr/bin/make test lint docs'
e.g.: due to typo, upper-lowercase, etc.
only the settings_based limits
as currently it's initialized once
the difficulty why it wasn't done as part of #4 is that
['blah', 'no.such.module']
e.g.:
def my_function(*a, **kw):
with SomeLimit(name='first', total=4):
....
with SomeLimit(name='second', total=4):
....
so from the error message it's clear which one failed
so that template debugging becomes possible. Something along the lines of
{% block foo %}
{% TimeLimit total=0.1 %}
{{ block.super }}
{% EndTimeLimit %}
{% endblock %}
it was out of scope for #21 which already turned out to be quite big
the suggestion is to have a djpt_combine_result_files
command that takes filepaths as *args
(LabelCommand
) and reads all of them to memory, then write it out into a single file named django_performance_testing.serializer.get_datafile_path
The idea behind using labels instead of accepting file patterns and then converting them to filepaths based on glob
or re
or similar is to keep things simple here.
people running things in parallel would be expected to have different file names for each run in their settings (e.g.: djpt.results_collected.$$
to get the running process's id), and then do the bash magic themselves (e.g.: manage.py $(ls djpt.results_collected*)
). Probably this should be documented :)
for consistency and simplicity sake
current workaround to achieve this is
from django_performance_testing.signals import results_collected
def dump_queries(sender, results, context, **kwargs):
try:
write_result, = (r for r in results if r.name =='write')
if write_result.queries:
print '\n'.join(q['sql'] for q in write_result.queries)
except ValueError:
pass
results_collected.connect(dump_queries)
with QueryBatchLimit(write=0):
....
Hello, I use pytest-django to be able to run tests with pytest runner. Query limits work well, timing doesn't. Pytest is a popular test runner (2500 github stars) and allows for more comfortable asserting (assert 1 < 2 vs. self.assertGreaterThan(2,1))
Please look at possibility of supporting pytest.
$ pip freeze | egrep '(test|Django)'
Django==1.11.9
django-performance-testing==0.7.3
pytest==3.2.5
pytest-cov==2.5.1
pytest-django==3.1.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.