diff options
| author | Jeffrey Pautler <jeffrey.pautler@ni.com> | 2017-07-10 10:02:19 -0500 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-07-10 11:46:15 -0400 |
| commit | d95b0b5d0de99c3d40f164eb5953efae3df3e5f8 (patch) | |
| tree | a644df9ab472b84fee08e712223372cca207b8f3 /meta-openstack/recipes-devtools/python/python-salttesting | |
| parent | 6535b4a3ec1f2c2c62dd394f17227a6fa18d03cb (diff) | |
| download | meta-cloud-services-d95b0b5d0de99c3d40f164eb5953efae3df3e5f8.tar.gz | |
python-salttesting: Modify patch to improve ptest output
Current test case output includes shortDescription and looks like this:
PASS: [CPU:24.1%|MEM:17.4%] First line of test case doc string
New test case output replaces shortDescription with test name and looks
like this:
PASS: test_case_function_name
Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-salttesting')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-salttesting/0001-Add-ptest-output-option-to-test-suite.patch | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-salttesting/0001-Add-ptest-output-option-to-test-suite.patch b/meta-openstack/recipes-devtools/python/python-salttesting/0001-Add-ptest-output-option-to-test-suite.patch index c297320..e86768a 100644 --- a/meta-openstack/recipes-devtools/python/python-salttesting/0001-Add-ptest-output-option-to-test-suite.patch +++ b/meta-openstack/recipes-devtools/python/python-salttesting/0001-Add-ptest-output-option-to-test-suite.patch | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | From 7e2642530bfd4ac0226b90404e7a4511e44756b6 Mon Sep 17 00:00:00 2001 | 1 | From 1950b943b7173198f345a1cff7b7f771cbac2244 Mon Sep 17 00:00:00 2001 |
| 2 | From: Collin Richards <collin.richards@ni.com> | 2 | From: Collin Richards <collin.richards@ni.com> |
| 3 | Date: Tue, 28 Jun 2016 16:02:22 -0500 | 3 | Date: Tue, 28 Jun 2016 16:02:22 -0500 |
| 4 | Subject: [PATCH] Add ptest output option to test suite | 4 | Subject: [PATCH] Add ptest output option to test suite |
| @@ -12,12 +12,12 @@ Signed-off-by: Collin Richards <collin.richards@ni.com> | |||
| 12 | Natinst-ReviewBoard-ID: 143279 | 12 | Natinst-ReviewBoard-ID: 143279 |
| 13 | --- | 13 | --- |
| 14 | salttesting/parser/__init__.py | 12 +++ | 14 | salttesting/parser/__init__.py | 12 +++ |
| 15 | salttesting/ptest.py | 168 +++++++++++++++++++++++++++++++++++++++++ | 15 | salttesting/ptest.py | 165 +++++++++++++++++++++++++++++++++++++++++ |
| 16 | 2 files changed, 180 insertions(+) | 16 | 2 files changed, 177 insertions(+) |
| 17 | create mode 100644 salttesting/ptest.py | 17 | create mode 100644 salttesting/ptest.py |
| 18 | 18 | ||
| 19 | diff --git a/salttesting/parser/__init__.py b/salttesting/parser/__init__.py | 19 | diff --git a/salttesting/parser/__init__.py b/salttesting/parser/__init__.py |
| 20 | index 1e7275b4b65ef29deb89049a70bf6a074e11873d..d8cba0cb1e4814b7065b6896186c25300048ec92 100644 | 20 | index 1e7275b..d8cba0c 100644 |
| 21 | --- a/salttesting/parser/__init__.py | 21 | --- a/salttesting/parser/__init__.py |
| 22 | +++ b/salttesting/parser/__init__.py | 22 | +++ b/salttesting/parser/__init__.py |
| 23 | @@ -25,6 +25,7 @@ from functools import partial | 23 | @@ -25,6 +25,7 @@ from functools import partial |
| @@ -55,10 +55,10 @@ index 1e7275b4b65ef29deb89049a70bf6a074e11873d..d8cba0cb1e4814b7065b6896186c2530 | |||
| 55 | stream=sys.stdout, | 55 | stream=sys.stdout, |
| 56 | diff --git a/salttesting/ptest.py b/salttesting/ptest.py | 56 | diff --git a/salttesting/ptest.py b/salttesting/ptest.py |
| 57 | new file mode 100644 | 57 | new file mode 100644 |
| 58 | index 0000000000000000000000000000000000000000..9780886bc8f9d400aab2e96a33b14af980e64315 | 58 | index 0000000..4c50f57 |
| 59 | --- /dev/null | 59 | --- /dev/null |
| 60 | +++ b/salttesting/ptest.py | 60 | +++ b/salttesting/ptest.py |
| 61 | @@ -0,0 +1,168 @@ | 61 | @@ -0,0 +1,165 @@ |
| 62 | +# -*- coding: utf-8 -*- | 62 | +# -*- coding: utf-8 -*- |
| 63 | + | 63 | + |
| 64 | +""" | 64 | +""" |
| @@ -158,10 +158,7 @@ index 0000000000000000000000000000000000000000..9780886bc8f9d400aab2e96a33b14af9 | |||
| 158 | + self.descriptions = descriptions | 158 | + self.descriptions = descriptions |
| 159 | + | 159 | + |
| 160 | + def getDescription(self, test): | 160 | + def getDescription(self, test): |
| 161 | + if self.descriptions: | 161 | + return str(test) |
| 162 | + return test.shortDescription() or str(test) | ||
| 163 | + else: | ||
| 164 | + return str(test) | ||
| 165 | + | 162 | + |
| 166 | + def startTest(self, test): | 163 | + def startTest(self, test): |
| 167 | + TestResult.startTest(self, test) | 164 | + TestResult.startTest(self, test) |
| @@ -228,5 +225,5 @@ index 0000000000000000000000000000000000000000..9780886bc8f9d400aab2e96a33b14af9 | |||
| 228 | + self.stream.writeln() | 225 | + self.stream.writeln() |
| 229 | + return result | 226 | + return result |
| 230 | -- | 227 | -- |
| 231 | 1.9.1 | 228 | 2.13.2 |
| 232 | 229 | ||
