summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core/tests
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-12 11:10:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-18 10:18:41 +0100
commit4e4958cba2e083eac20e2770e04bfc7d56d9db42 (patch)
treeb8fb57f9b3a3e37b3a5f095c70c127af9bce82fa /meta/lib/oeqa/core/tests
parentebd97e728ae1bd9442299c871a07a1b3b9f9efdf (diff)
downloadpoky-4e4958cba2e083eac20e2770e04bfc7d56d9db42.tar.gz
oeqa/core/threaded: Remove in favour of using concurrenttests
We have several options for parallel processing in oeqa, parallel execution of modules, threading and mulitple processes for the runners. After much experimentation is appears the most scalable and least invasive approach is multiple processes using concurrenttestsuite from testtools. This means we can drop the current threading code which is only used by the sdk test execution. oeqa/decorator/depends: Remove threading code Revert "oeqa/sdk: Enable usage of OEQA thread mode" This reverts commit adc434c0636b7dea2ef70c8d2c8e61cdb5c703b1. Revert "oeqa/core/tests: Add tests of OEQA Threaded mode" This reverts commit a4eef558c9933eb32413b61ff80a11b999951b40. Revert "oeqa/core/decorator/oetimeout: Add support for OEQA threaded mode" This reverts commit d3d4ba902dee8b19fa1054330cffdf73f9b81fe7. (From OE-Core rev: a98ab5e560e73b6988512fbae5cefe9e42ceed53) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/tests')
-rw-r--r--meta/lib/oeqa/core/tests/cases/loader/threaded/threaded.py12
-rw-r--r--meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_alone.py8
-rw-r--r--meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_depends.py10
-rw-r--r--meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_module.py12
-rw-r--r--meta/lib/oeqa/core/tests/common.py10
-rwxr-xr-xmeta/lib/oeqa/core/tests/test_decorators.py12
-rwxr-xr-xmeta/lib/oeqa/core/tests/test_loader.py30
7 files changed, 1 insertions, 93 deletions
diff --git a/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded.py b/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded.py
deleted file mode 100644
index 0fe4cb3f11..0000000000
--- a/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded.py
+++ /dev/null
@@ -1,12 +0,0 @@
1# Copyright (C) 2017 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from oeqa.core.case import OETestCase
5
6class ThreadedTest(OETestCase):
7 def test_threaded_no_depends(self):
8 self.assertTrue(True, msg='How is this possible?')
9
10class ThreadedTest2(OETestCase):
11 def test_threaded_same_module(self):
12 self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_alone.py b/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_alone.py
deleted file mode 100644
index 905f397846..0000000000
--- a/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_alone.py
+++ /dev/null
@@ -1,8 +0,0 @@
1# Copyright (C) 2017 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from oeqa.core.case import OETestCase
5
6class ThreadedTestAlone(OETestCase):
7 def test_threaded_alone(self):
8 self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_depends.py b/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_depends.py
deleted file mode 100644
index 0c158d3bac..0000000000
--- a/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_depends.py
+++ /dev/null
@@ -1,10 +0,0 @@
1# Copyright (C) 2017 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from oeqa.core.case import OETestCase
5from oeqa.core.decorator.depends import OETestDepends
6
7class ThreadedTest3(OETestCase):
8 @OETestDepends(['threaded.ThreadedTest.test_threaded_no_depends'])
9 def test_threaded_depends(self):
10 self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_module.py b/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_module.py
deleted file mode 100644
index 63d17e0401..0000000000
--- a/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_module.py
+++ /dev/null
@@ -1,12 +0,0 @@
1# Copyright (C) 2017 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from oeqa.core.case import OETestCase
5
6class ThreadedTestModule(OETestCase):
7 def test_threaded_module(self):
8 self.assertTrue(True, msg='How is this possible?')
9
10class ThreadedTestModule2(OETestCase):
11 def test_threaded_module2(self):
12 self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/common.py b/meta/lib/oeqa/core/tests/common.py
index 1932323409..52b18a1c3e 100644
--- a/meta/lib/oeqa/core/tests/common.py
+++ b/meta/lib/oeqa/core/tests/common.py
@@ -33,13 +33,3 @@ class TestBase(unittest.TestCase):
33 tc.loadTests(self.cases_path, modules=modules, tests=tests, 33 tc.loadTests(self.cases_path, modules=modules, tests=tests,
34 filters=filters) 34 filters=filters)
35 return tc 35 return tc
36
37 def _testLoaderThreaded(self, d={}, modules=[],
38 tests=[], filters={}):
39 from oeqa.core.threaded import OETestContextThreaded
40
41 tc = OETestContextThreaded(d, self.logger)
42 tc.loadTests(self.cases_path, modules=modules, tests=tests,
43 filters=filters)
44
45 return tc
diff --git a/meta/lib/oeqa/core/tests/test_decorators.py b/meta/lib/oeqa/core/tests/test_decorators.py
index cf99e0d72d..f7d11e885a 100755
--- a/meta/lib/oeqa/core/tests/test_decorators.py
+++ b/meta/lib/oeqa/core/tests/test_decorators.py
@@ -131,17 +131,5 @@ class TestTimeoutDecorator(TestBase):
131 msg = "OETestTimeout didn't restore SIGALRM" 131 msg = "OETestTimeout didn't restore SIGALRM"
132 self.assertIs(alarm_signal, signal.getsignal(signal.SIGALRM), msg=msg) 132 self.assertIs(alarm_signal, signal.getsignal(signal.SIGALRM), msg=msg)
133 133
134 def test_timeout_thread(self):
135 tests = ['timeout.TimeoutTest.testTimeoutPass']
136 msg = 'Failed to run test using OETestTimeout'
137 tc = self._testLoaderThreaded(modules=self.modules, tests=tests)
138 self.assertTrue(tc.runTests().wasSuccessful(), msg=msg)
139
140 def test_timeout_threaded_fail(self):
141 tests = ['timeout.TimeoutTest.testTimeoutFail']
142 msg = "OETestTimeout test didn't timeout as expected"
143 tc = self._testLoaderThreaded(modules=self.modules, tests=tests)
144 self.assertFalse(tc.runTests().wasSuccessful(), msg=msg)
145
146if __name__ == '__main__': 134if __name__ == '__main__':
147 unittest.main() 135 unittest.main()
diff --git a/meta/lib/oeqa/core/tests/test_loader.py b/meta/lib/oeqa/core/tests/test_loader.py
index e0d917d317..b79b8bad4d 100755
--- a/meta/lib/oeqa/core/tests/test_loader.py
+++ b/meta/lib/oeqa/core/tests/test_loader.py
@@ -1,6 +1,6 @@
1#!/usr/bin/env python3 1#!/usr/bin/env python3
2 2
3# Copyright (C) 2016-2017 Intel Corporation 3# Copyright (C) 2016 Intel Corporation
4# Released under the MIT license (see COPYING.MIT) 4# Released under the MIT license (see COPYING.MIT)
5 5
6import os 6import os
@@ -82,33 +82,5 @@ class TestLoader(TestBase):
82 msg = 'Expected modules from two different paths' 82 msg = 'Expected modules from two different paths'
83 self.assertEqual(modules, expected_modules, msg=msg) 83 self.assertEqual(modules, expected_modules, msg=msg)
84 84
85 def test_loader_threaded(self):
86 cases_path = self.cases_path
87
88 self.cases_path = [os.path.join(self.cases_path, 'loader', 'threaded')]
89
90 tc = self._testLoaderThreaded()
91 self.assertEqual(len(tc.suites), 3, "Expected to be 3 suites")
92
93 case_ids = ['threaded.ThreadedTest.test_threaded_no_depends',
94 'threaded.ThreadedTest2.test_threaded_same_module',
95 'threaded_depends.ThreadedTest3.test_threaded_depends']
96 for case in tc.suites[0]._tests:
97 self.assertEqual(case.id(),
98 case_ids[tc.suites[0]._tests.index(case)])
99
100 case_ids = ['threaded_alone.ThreadedTestAlone.test_threaded_alone']
101 for case in tc.suites[1]._tests:
102 self.assertEqual(case.id(),
103 case_ids[tc.suites[1]._tests.index(case)])
104
105 case_ids = ['threaded_module.ThreadedTestModule.test_threaded_module',
106 'threaded_module.ThreadedTestModule2.test_threaded_module2']
107 for case in tc.suites[2]._tests:
108 self.assertEqual(case.id(),
109 case_ids[tc.suites[2]._tests.index(case)])
110
111 self.cases_path = cases_path
112
113if __name__ == '__main__': 85if __name__ == '__main__':
114 unittest.main() 86 unittest.main()