summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Pautler <jeffrey.pautler@ni.com>2017-07-10 10:02:19 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-07-10 11:46:15 -0400
commitd95b0b5d0de99c3d40f164eb5953efae3df3e5f8 (patch)
treea644df9ab472b84fee08e712223372cca207b8f3
parent6535b4a3ec1f2c2c62dd394f17227a6fa18d03cb (diff)
downloadmeta-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>
-rw-r--r--meta-openstack/recipes-devtools/python/python-salttesting/0001-Add-ptest-output-option-to-test-suite.patch19
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 @@
1From 7e2642530bfd4ac0226b90404e7a4511e44756b6 Mon Sep 17 00:00:00 2001 1From 1950b943b7173198f345a1cff7b7f771cbac2244 Mon Sep 17 00:00:00 2001
2From: Collin Richards <collin.richards@ni.com> 2From: Collin Richards <collin.richards@ni.com>
3Date: Tue, 28 Jun 2016 16:02:22 -0500 3Date: Tue, 28 Jun 2016 16:02:22 -0500
4Subject: [PATCH] Add ptest output option to test suite 4Subject: [PATCH] Add ptest output option to test suite
@@ -12,12 +12,12 @@ Signed-off-by: Collin Richards <collin.richards@ni.com>
12Natinst-ReviewBoard-ID: 143279 12Natinst-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
19diff --git a/salttesting/parser/__init__.py b/salttesting/parser/__init__.py 19diff --git a/salttesting/parser/__init__.py b/salttesting/parser/__init__.py
20index 1e7275b4b65ef29deb89049a70bf6a074e11873d..d8cba0cb1e4814b7065b6896186c25300048ec92 100644 20index 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,
56diff --git a/salttesting/ptest.py b/salttesting/ptest.py 56diff --git a/salttesting/ptest.py b/salttesting/ptest.py
57new file mode 100644 57new file mode 100644
58index 0000000000000000000000000000000000000000..9780886bc8f9d400aab2e96a33b14af980e64315 58index 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--
2311.9.1 2282.13.2
232 229