Skip to content

Commit

Permalink
Never skip the performance tests.
Browse files Browse the repository at this point in the history
The previous commit had the effect that they were run by default,
and only were skipped when the env variable was zero.
But that does not make much sense.

Also, even with a high test verbosity level (`bin/test -vvvvvv`),
sometimes the skip reason was shown and sometimes not.
The length of the reason seemed to matter at some point, but I could not get a grip on that.
  • Loading branch information
mauritsvanrees committed Feb 13, 2019
1 parent 9e0b125 commit 99efffd
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions plone/app/redirector/tests/test_performance.py
Expand Up @@ -10,7 +10,7 @@
env_name = 'PLONE_APP_REDIRECTOR_PERFORMANCE_NUMBER'
if env_name in os.environ:
# This could fail with a ValueError, but that seems a fine error message.
NUMBER = int(os.getenv(env_name))
NUMBER = max(int(os.getenv(env_name)), 1)
VERBOSE = True
else:
# No environment variable set.
Expand Down Expand Up @@ -46,16 +46,9 @@ def timeit(self, message, limit=0):
'{0}: {1:.2f} seconds (max {2})'.format(message, total, limit)
)

@unittest.skipIf(NUMBER <= 0, '{0} env variable not set'.format(env_name))
def test_storage_performance(self):
"""Test the performance of some of the code.
This is skipped by default, unless you set an environment variable.
If you don't set this, or set this to zero or less, you will see
a skip reason when you run the tests with enough verbosity:
$ bin/test -s plone.app.redirector -m test_performance -vvv
Sample run with one million inserts:
$ PLONE_APP_REDIRECTOR_PERFORMANCE_NUMBER=1000000 \
Expand Down

0 comments on commit 99efffd

Please sign in to comment.