← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~powersj/cloud-init:unittest-add-timing into cloud-init:master

 

Joshua Powers has proposed merging ~powersj/cloud-init:unittest-add-timing into cloud-init:master.

Commit message:
tox: add nose timer output

This adds the output of the nose timer plugin to the py27
enviornment to tox. This will print out the 10 longest running
tests and automatically turn tests longer than 1 second "red".

Requested reviews:
  cloud-init commiters (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/330111
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~powersj/cloud-init:unittest-add-timing into cloud-init:master.
diff --git a/test-requirements.txt b/test-requirements.txt
index d9d41b5..6583422 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -2,6 +2,7 @@
 httpretty>=0.7.1
 mock
 nose
+nose-timer
 unittest2
 coverage
 
diff --git a/tox.ini b/tox.ini
index ec96e85..33b38df 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,7 +3,7 @@ envlist = py27, py3, flake8, xenial, pylint
 recreate = True
 
 [testenv]
-commands = python -m nose {posargs:tests/unittests}
+commands = python -m nose --with-timer --timer-top-n 10 {posargs:tests/unittests}
 setenv =
     LC_ALL = en_US.utf-8
 

Follow ups