robotframework-pabot 3.0.0__tar.gz → 3.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/PKG-INFO +4 -1
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/__init__.py +1 -1
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/pabot.py +6 -5
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/robotframework_pabot.egg-info/PKG-INFO +4 -1
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/robotframework_pabot.egg-info/SOURCES.txt +12 -1
- robotframework_pabot-3.1.0/tests/test_arguments_output.py +67 -0
- robotframework_pabot-3.1.0/tests/test_depends.py +133 -0
- robotframework_pabot-3.1.0/tests/test_functional.py +51 -0
- robotframework_pabot-3.1.0/tests/test_ordering.py +194 -0
- robotframework_pabot-3.1.0/tests/test_pabot.py +1335 -0
- robotframework_pabot-3.1.0/tests/test_pabotlib.py +315 -0
- robotframework_pabot-3.1.0/tests/test_pabotsuitenames_io.py +65 -0
- robotframework_pabot-3.1.0/tests/test_resultmerger.py +73 -0
- robotframework_pabot-3.1.0/tests/test_stacktrace.py +45 -0
- robotframework_pabot-3.1.0/tests/test_testlevelsplit_include.py +53 -0
- robotframework_pabot-3.1.0/tests/test_testlevelsplit_output_task_order.py +90 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/LICENSE.txt +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/MANIFEST.in +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/README.md +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/pyproject.toml +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/setup.cfg +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/setup.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/SharedLibrary.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/arguments.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/clientwrapper.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/coordinatorwrapper.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/execution_items.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/pabotlib.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/py3/__init__.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/py3/client.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/py3/coordinator.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/py3/messages.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/py3/worker.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/result_merger.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/robotremoteserver.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/pabot/workerwrapper.py +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/robotframework_pabot.egg-info/dependency_links.txt +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/robotframework_pabot.egg-info/entry_points.txt +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/robotframework_pabot.egg-info/requires.txt +0 -0
- {robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/robotframework_pabot.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: robotframework-pabot
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.1.0
|
|
4
4
|
Summary: Parallel test runner for Robot Framework
|
|
5
5
|
Home-page: https://pabot.org
|
|
6
6
|
Download-URL: https://pypi.python.org/pypi/robotframework-pabot
|
|
@@ -17,5 +17,8 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
|
17
17
|
Classifier: Framework :: Robot Framework
|
|
18
18
|
Requires-Python: >=3.6
|
|
19
19
|
License-File: LICENSE.txt
|
|
20
|
+
Requires-Dist: robotframework>=3.2
|
|
21
|
+
Requires-Dist: robotframework-stacktrace>=0.4.1
|
|
22
|
+
Requires-Dist: natsort>=8.2.0
|
|
20
23
|
|
|
21
24
|
A parallel executor for Robot Framework tests. With Pabot you can split one execution into multiple and save test execution time.
|
|
@@ -1152,14 +1152,15 @@ def generate_suite_names_with_builder(outs_dir, datasources, options):
|
|
|
1152
1152
|
settings = RobotSettings(opts)
|
|
1153
1153
|
|
|
1154
1154
|
# Note: first argument (included_suites) is deprecated from RobotFramework 6.1
|
|
1155
|
-
if ROBOT_VERSION
|
|
1155
|
+
if ROBOT_VERSION >= "6.1":
|
|
1156
1156
|
builder = TestSuiteBuilder(
|
|
1157
|
-
settings
|
|
1157
|
+
included_extensions=settings.extension, rpa=settings.rpa, lang=opts.get("language")
|
|
1158
1158
|
)
|
|
1159
1159
|
else:
|
|
1160
1160
|
builder = TestSuiteBuilder(
|
|
1161
|
-
|
|
1162
|
-
)
|
|
1161
|
+
settings["SuiteNames"], settings.extension, rpa=settings.rpa
|
|
1162
|
+
)
|
|
1163
|
+
|
|
1163
1164
|
suite = builder.build(*datasources)
|
|
1164
1165
|
settings.rpa = builder.rpa
|
|
1165
1166
|
suite.configure(**settings.suite_config)
|
|
@@ -1775,7 +1776,7 @@ def _create_execution_items_for_dry_run(
|
|
|
1775
1776
|
chunk_size = (
|
|
1776
1777
|
round(len(items) / processes_count)
|
|
1777
1778
|
if len(items) > processes_count
|
|
1778
|
-
else
|
|
1779
|
+
else 1
|
|
1779
1780
|
)
|
|
1780
1781
|
chunked_items = list(_chunk_items(items, chunk_size))
|
|
1781
1782
|
_NUMBER_OF_ITEMS_TO_BE_EXECUTED += len(chunked_items)
|
{robotframework-pabot-3.0.0 → robotframework_pabot-3.1.0}/src/robotframework_pabot.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: robotframework-pabot
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.1.0
|
|
4
4
|
Summary: Parallel test runner for Robot Framework
|
|
5
5
|
Home-page: https://pabot.org
|
|
6
6
|
Download-URL: https://pypi.python.org/pypi/robotframework-pabot
|
|
@@ -17,5 +17,8 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
|
17
17
|
Classifier: Framework :: Robot Framework
|
|
18
18
|
Requires-Python: >=3.6
|
|
19
19
|
License-File: LICENSE.txt
|
|
20
|
+
Requires-Dist: robotframework>=3.2
|
|
21
|
+
Requires-Dist: robotframework-stacktrace>=0.4.1
|
|
22
|
+
Requires-Dist: natsort>=8.2.0
|
|
20
23
|
|
|
21
24
|
A parallel executor for Robot Framework tests. With Pabot you can split one execution into multiple and save test execution time.
|
|
@@ -25,4 +25,15 @@ src/robotframework_pabot.egg-info/SOURCES.txt
|
|
|
25
25
|
src/robotframework_pabot.egg-info/dependency_links.txt
|
|
26
26
|
src/robotframework_pabot.egg-info/entry_points.txt
|
|
27
27
|
src/robotframework_pabot.egg-info/requires.txt
|
|
28
|
-
src/robotframework_pabot.egg-info/top_level.txt
|
|
28
|
+
src/robotframework_pabot.egg-info/top_level.txt
|
|
29
|
+
tests/test_arguments_output.py
|
|
30
|
+
tests/test_depends.py
|
|
31
|
+
tests/test_functional.py
|
|
32
|
+
tests/test_ordering.py
|
|
33
|
+
tests/test_pabot.py
|
|
34
|
+
tests/test_pabotlib.py
|
|
35
|
+
tests/test_pabotsuitenames_io.py
|
|
36
|
+
tests/test_resultmerger.py
|
|
37
|
+
tests/test_stacktrace.py
|
|
38
|
+
tests/test_testlevelsplit_include.py
|
|
39
|
+
tests/test_testlevelsplit_output_task_order.py
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import tempfile
|
|
3
|
+
import textwrap
|
|
4
|
+
import unittest
|
|
5
|
+
import shutil
|
|
6
|
+
import subprocess
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class PabotArgumentsOutputsTest(unittest.TestCase):
|
|
10
|
+
def setUp(self):
|
|
11
|
+
self.tmpdir = tempfile.mkdtemp()
|
|
12
|
+
|
|
13
|
+
def tearDown(self):
|
|
14
|
+
shutil.rmtree(self.tmpdir)
|
|
15
|
+
|
|
16
|
+
def _run_tests_with(self, testfile, arg1file, arg2file):
|
|
17
|
+
robot_file = open("{}/test.robot".format(self.tmpdir), "w")
|
|
18
|
+
robot_file.write(textwrap.dedent(testfile))
|
|
19
|
+
robot_file.close()
|
|
20
|
+
with open("{}/arg1.txt".format(self.tmpdir), "w") as f:
|
|
21
|
+
f.write(textwrap.dedent(arg1file))
|
|
22
|
+
with open("{}/arg2.txt".format(self.tmpdir), "w") as f:
|
|
23
|
+
f.write(textwrap.dedent(arg2file))
|
|
24
|
+
process = subprocess.Popen(
|
|
25
|
+
[
|
|
26
|
+
sys.executable,
|
|
27
|
+
"-m" "pabot.pabot",
|
|
28
|
+
"--processes",
|
|
29
|
+
"2",
|
|
30
|
+
"--argumentfile1",
|
|
31
|
+
"{}/arg1.txt".format(self.tmpdir),
|
|
32
|
+
"--argumentfile2",
|
|
33
|
+
"{}/arg2.txt".format(self.tmpdir),
|
|
34
|
+
"--outputdir",
|
|
35
|
+
self.tmpdir,
|
|
36
|
+
"--output",
|
|
37
|
+
"test.xml",
|
|
38
|
+
"{}/test.robot".format(self.tmpdir),
|
|
39
|
+
],
|
|
40
|
+
cwd=self.tmpdir,
|
|
41
|
+
stdout=subprocess.PIPE,
|
|
42
|
+
stderr=subprocess.PIPE,
|
|
43
|
+
)
|
|
44
|
+
return process.communicate(), process.returncode
|
|
45
|
+
|
|
46
|
+
def test_argumentfile_outputs(self):
|
|
47
|
+
(stdout, stderr), rc = self._run_tests_with(
|
|
48
|
+
"""
|
|
49
|
+
*** Test Cases ***
|
|
50
|
+
Test 1
|
|
51
|
+
Log ${VALUE}
|
|
52
|
+
Should Be True ${VALUE} == 2
|
|
53
|
+
""",
|
|
54
|
+
"""
|
|
55
|
+
--variable VALUE:1
|
|
56
|
+
""",
|
|
57
|
+
"""
|
|
58
|
+
--variable VALUE:2
|
|
59
|
+
""",
|
|
60
|
+
)
|
|
61
|
+
self.assertEqual(rc, 1)
|
|
62
|
+
if sys.version_info < (3, 0):
|
|
63
|
+
self.assertIn("PASSED", stdout, stderr)
|
|
64
|
+
self.assertIn("failed", stdout, stderr)
|
|
65
|
+
else:
|
|
66
|
+
self.assertIn(b"PASSED", stdout, stderr)
|
|
67
|
+
self.assertIn(b"failed", stdout, stderr)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
import sys
|
|
3
|
+
import textwrap
|
|
4
|
+
import shutil
|
|
5
|
+
import tempfile
|
|
6
|
+
import unittest
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _string_convert(byte_string):
|
|
10
|
+
legacy_python = sys.version_info < (3, 0)
|
|
11
|
+
return byte_string.decode() if legacy_python else byte_string
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class DependsTest(unittest.TestCase):
|
|
15
|
+
test_file = """
|
|
16
|
+
*** Settings ***
|
|
17
|
+
Test Template Test1
|
|
18
|
+
*** Test Cases ***
|
|
19
|
+
The Test S1Test 01 1
|
|
20
|
+
The Test S1Test 02 1
|
|
21
|
+
The Test S1Test 03 1
|
|
22
|
+
The Test S1Test 04 1
|
|
23
|
+
The Test S1Test 05 1
|
|
24
|
+
The Test S1Test 06 1
|
|
25
|
+
The Test S1Test 07 1
|
|
26
|
+
The Test S1Test 08 1
|
|
27
|
+
The Test S1Test 09 1
|
|
28
|
+
The Test S1Test 10 1
|
|
29
|
+
The Test S1Test 11 1
|
|
30
|
+
The Test S1Test 12 1
|
|
31
|
+
*** Keywords ***
|
|
32
|
+
Test1
|
|
33
|
+
[Arguments] ${arg}
|
|
34
|
+
Log Test
|
|
35
|
+
"""
|
|
36
|
+
passed = _string_convert(b"PASSED")
|
|
37
|
+
failed = _string_convert(b"FAILED")
|
|
38
|
+
test_01 = _string_convert(b"S1Test 01")
|
|
39
|
+
test_02 = _string_convert(b"S1Test 02")
|
|
40
|
+
test_08 = _string_convert(b"S1Test 08")
|
|
41
|
+
|
|
42
|
+
def setUp(self):
|
|
43
|
+
self.tmpdir = tempfile.mkdtemp()
|
|
44
|
+
|
|
45
|
+
def tearDown(self):
|
|
46
|
+
shutil.rmtree(self.tmpdir)
|
|
47
|
+
|
|
48
|
+
def _run_tests_with(self, testfile, orderfile):
|
|
49
|
+
robot_file = open("{}/test.robot".format(self.tmpdir), "w")
|
|
50
|
+
robot_file.write(textwrap.dedent(testfile))
|
|
51
|
+
robot_file.close()
|
|
52
|
+
with open("{}/order.dat".format(self.tmpdir), "w") as f:
|
|
53
|
+
f.write(textwrap.dedent(orderfile))
|
|
54
|
+
process = subprocess.Popen(
|
|
55
|
+
[
|
|
56
|
+
sys.executable,
|
|
57
|
+
"-m" "pabot.pabot",
|
|
58
|
+
"--testlevelsplit",
|
|
59
|
+
"--ordering",
|
|
60
|
+
"{}/order.dat".format(self.tmpdir),
|
|
61
|
+
"{}/test.robot".format(self.tmpdir),
|
|
62
|
+
],
|
|
63
|
+
cwd=self.tmpdir,
|
|
64
|
+
stdout=subprocess.PIPE,
|
|
65
|
+
stderr=subprocess.PIPE,
|
|
66
|
+
)
|
|
67
|
+
return process.communicate()
|
|
68
|
+
|
|
69
|
+
def test_dependency_ok(self):
|
|
70
|
+
stdout, stderr = self._run_tests_with(
|
|
71
|
+
self.test_file,
|
|
72
|
+
"""
|
|
73
|
+
--test Test.The Test S1Test 01 #DEPENDS Test.The Test S1Test 02
|
|
74
|
+
--test Test.The Test S1Test 02 #DEPENDS Test.The Test S1Test 08
|
|
75
|
+
--test Test.The Test S1Test 08
|
|
76
|
+
""",
|
|
77
|
+
)
|
|
78
|
+
self.assertIn(self.passed, stdout, stderr)
|
|
79
|
+
self.assertNotIn(self.failed, stdout, stderr)
|
|
80
|
+
self.assertEqual(stdout.count(self.passed), 12)
|
|
81
|
+
test_01_index = stdout.find(self.test_01)
|
|
82
|
+
test_02_index = stdout.find(self.test_02)
|
|
83
|
+
test_08_index = stdout.find(self.test_08)
|
|
84
|
+
self.assertNotEqual(test_01_index, -1)
|
|
85
|
+
self.assertNotEqual(test_02_index, -1)
|
|
86
|
+
self.assertNotEqual(test_08_index, -1)
|
|
87
|
+
self.assertTrue(test_08_index < test_02_index)
|
|
88
|
+
self.assertTrue(test_02_index < test_01_index)
|
|
89
|
+
|
|
90
|
+
def test_circular_dependency(self):
|
|
91
|
+
stdout, stderr = self._run_tests_with(
|
|
92
|
+
self.test_file,
|
|
93
|
+
"""
|
|
94
|
+
--test Test.The Test S1Test 01 #DEPENDS Test.The Test S1Test 02
|
|
95
|
+
--test Test.The Test S1Test 02 #DEPENDS Test.The Test S1Test 01
|
|
96
|
+
--test Test.The Test S1Test 08
|
|
97
|
+
""",
|
|
98
|
+
)
|
|
99
|
+
self.assertIn(b"circular or unmet dependencies", stderr)
|
|
100
|
+
|
|
101
|
+
def test_unmet_dependency(self):
|
|
102
|
+
stdout, stderr = self._run_tests_with(
|
|
103
|
+
self.test_file,
|
|
104
|
+
"""
|
|
105
|
+
--test Test.The Test S1Test 01
|
|
106
|
+
--test Test.The Test S1Test 02 #DEPENDS Test.The Test S1Test 23
|
|
107
|
+
--test Test.The Test S1Test 08
|
|
108
|
+
""",
|
|
109
|
+
)
|
|
110
|
+
self.assertIn(b"circular or unmet dependencies", stderr)
|
|
111
|
+
|
|
112
|
+
def test_same_reference(self):
|
|
113
|
+
stdout, stderr = self._run_tests_with(
|
|
114
|
+
self.test_file,
|
|
115
|
+
"""
|
|
116
|
+
--test Test.The Test S1Test 01
|
|
117
|
+
--test Test.The Test S1Test 02 #DEPENDS Test.The Test S1Test 02
|
|
118
|
+
--test Test.The Test S1Test 08
|
|
119
|
+
""",
|
|
120
|
+
)
|
|
121
|
+
self.assertIn(b"circular or unmet dependencies", stderr)
|
|
122
|
+
|
|
123
|
+
def test_wait(self):
|
|
124
|
+
stdout, stderr = self._run_tests_with(
|
|
125
|
+
self.test_file,
|
|
126
|
+
"""
|
|
127
|
+
--test Test.The Test S1Test 01
|
|
128
|
+
--test Test.The Test S1Test 02 #DEPENDS Test.The Test S1Test 08
|
|
129
|
+
#WAIT
|
|
130
|
+
--test Test.The Test S1Test 08
|
|
131
|
+
""",
|
|
132
|
+
)
|
|
133
|
+
self.assertIn(b"circular or unmet dependencies", stderr)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import tempfile
|
|
4
|
+
import textwrap
|
|
5
|
+
import unittest
|
|
6
|
+
import shutil
|
|
7
|
+
import subprocess
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
if os.name != "posix":
|
|
11
|
+
raise unittest.SkipTest("Only posix test")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PabotPassJsonUsingVariableOptionTests(unittest.TestCase):
|
|
15
|
+
def setUp(self):
|
|
16
|
+
self.tmpdir = tempfile.mkdtemp()
|
|
17
|
+
robot_file = open("{}/test.robot".format(self.tmpdir), "w")
|
|
18
|
+
robot_file.write(
|
|
19
|
+
textwrap.dedent(
|
|
20
|
+
"""
|
|
21
|
+
*** Test Cases ***
|
|
22
|
+
Test Passing Json With -v option
|
|
23
|
+
Should Be Equal ${custom_var} {"key": "value"}
|
|
24
|
+
"""
|
|
25
|
+
)
|
|
26
|
+
)
|
|
27
|
+
robot_file.close()
|
|
28
|
+
|
|
29
|
+
process = subprocess.Popen(
|
|
30
|
+
[
|
|
31
|
+
sys.executable,
|
|
32
|
+
"-m" "pabot.pabot",
|
|
33
|
+
"-v",
|
|
34
|
+
'custom_var:{"key": "value"}',
|
|
35
|
+
"{}/test.robot".format(self.tmpdir),
|
|
36
|
+
],
|
|
37
|
+
cwd=self.tmpdir,
|
|
38
|
+
stdout=subprocess.PIPE,
|
|
39
|
+
stderr=subprocess.PIPE,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
self.stdout, self.stderr = process.communicate()
|
|
43
|
+
|
|
44
|
+
def test_stdout_should_display_passed_test(self):
|
|
45
|
+
if sys.version_info < (3, 0):
|
|
46
|
+
self.assertIn("PASSED Test", self.stdout, self.stderr)
|
|
47
|
+
else:
|
|
48
|
+
self.assertIn(b"PASSED Test", self.stdout, self.stderr)
|
|
49
|
+
|
|
50
|
+
def tearDown(self):
|
|
51
|
+
shutil.rmtree(self.tmpdir)
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
from robot import __version__ as ROBOT_VERSION
|
|
2
|
+
import sys
|
|
3
|
+
import tempfile
|
|
4
|
+
import textwrap
|
|
5
|
+
import unittest
|
|
6
|
+
import shutil
|
|
7
|
+
import subprocess
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PabotOrderingGroupTest(unittest.TestCase):
|
|
11
|
+
def setUp(self):
|
|
12
|
+
self.tmpdir = tempfile.mkdtemp()
|
|
13
|
+
|
|
14
|
+
def tearDown(self):
|
|
15
|
+
shutil.rmtree(self.tmpdir)
|
|
16
|
+
|
|
17
|
+
def _run_tests_with(self, testfile, orderfile):
|
|
18
|
+
robot_file = open("{}/test.robot".format(self.tmpdir), "w")
|
|
19
|
+
robot_file.write(textwrap.dedent(testfile))
|
|
20
|
+
robot_file.close()
|
|
21
|
+
with open("{}/order.dat".format(self.tmpdir), "w") as f:
|
|
22
|
+
f.write(textwrap.dedent(orderfile))
|
|
23
|
+
process = subprocess.Popen(
|
|
24
|
+
[
|
|
25
|
+
sys.executable,
|
|
26
|
+
"-m" "pabot.pabot",
|
|
27
|
+
"--testlevelsplit",
|
|
28
|
+
"--ordering",
|
|
29
|
+
"{}/order.dat".format(self.tmpdir),
|
|
30
|
+
"{}/test.robot".format(self.tmpdir),
|
|
31
|
+
],
|
|
32
|
+
cwd=self.tmpdir,
|
|
33
|
+
stdout=subprocess.PIPE,
|
|
34
|
+
stderr=subprocess.PIPE,
|
|
35
|
+
)
|
|
36
|
+
return process.communicate()
|
|
37
|
+
|
|
38
|
+
def test_orders(self):
|
|
39
|
+
stdout, stderr = self._run_tests_with(
|
|
40
|
+
"""
|
|
41
|
+
*** Variables ***
|
|
42
|
+
${SCALAR} Hello, globe!
|
|
43
|
+
|
|
44
|
+
*** Test Cases ***
|
|
45
|
+
First Test
|
|
46
|
+
Set Suite Variable ${SCALAR} Hello, world!
|
|
47
|
+
|
|
48
|
+
Second Test
|
|
49
|
+
Should Be Equal ${SCALAR} Hello, world!
|
|
50
|
+
|
|
51
|
+
Third Test
|
|
52
|
+
Should Be Equal ${SCALAR} Hello, globe!
|
|
53
|
+
""",
|
|
54
|
+
"""
|
|
55
|
+
{
|
|
56
|
+
--test Test.First Test
|
|
57
|
+
--test Test.Second Test
|
|
58
|
+
}
|
|
59
|
+
--test Test.Third Test
|
|
60
|
+
""",
|
|
61
|
+
)
|
|
62
|
+
if sys.version_info < (3, 0):
|
|
63
|
+
self.assertIn("PASSED", stdout, stderr)
|
|
64
|
+
self.assertNotIn("FAILED", stdout, stderr)
|
|
65
|
+
self.assertEqual(stdout.count("PASSED"), 2)
|
|
66
|
+
else:
|
|
67
|
+
self.assertIn(b"PASSED", stdout, stderr)
|
|
68
|
+
self.assertNotIn(b"FAILED", stdout, stderr)
|
|
69
|
+
self.assertEqual(stdout.count(b"PASSED"), 2)
|
|
70
|
+
|
|
71
|
+
def test_two_orders(self):
|
|
72
|
+
stdout, stderr = self._run_tests_with(
|
|
73
|
+
"""
|
|
74
|
+
*** Variables ***
|
|
75
|
+
${SCALAR} Hello, globe!
|
|
76
|
+
|
|
77
|
+
*** Test Cases ***
|
|
78
|
+
First Test
|
|
79
|
+
Set Suite Variable ${SCALAR} Hello, world!
|
|
80
|
+
|
|
81
|
+
Second Test
|
|
82
|
+
Should Be Equal ${SCALAR} Hello, world!
|
|
83
|
+
|
|
84
|
+
Second And Quarter
|
|
85
|
+
Should Be Equal ${SCALAR} Hello, globe!
|
|
86
|
+
|
|
87
|
+
Second And Half
|
|
88
|
+
Should Be Equal ${SCALAR} Hello, globe!
|
|
89
|
+
|
|
90
|
+
Third Test
|
|
91
|
+
Should Be Equal ${SCALAR} Hello, globe!
|
|
92
|
+
""",
|
|
93
|
+
"""
|
|
94
|
+
{
|
|
95
|
+
--test Test.First Test
|
|
96
|
+
--test Test.Second Test
|
|
97
|
+
}
|
|
98
|
+
{
|
|
99
|
+
--test Test.Second And Quarter
|
|
100
|
+
--test Test.Second And Half
|
|
101
|
+
}
|
|
102
|
+
--test Test.Third Test
|
|
103
|
+
""",
|
|
104
|
+
)
|
|
105
|
+
if sys.version_info < (3, 0):
|
|
106
|
+
self.assertIn("PASSED", stdout, stderr)
|
|
107
|
+
self.assertNotIn("FAILED", stdout, stderr)
|
|
108
|
+
if ROBOT_VERSION < "4.0":
|
|
109
|
+
expected_write = "5 critical tests, 5 passed, 0 failed"
|
|
110
|
+
else:
|
|
111
|
+
expected_write = "5 tests, 5 passed, 0 failed, 0 skipped."
|
|
112
|
+
self.assertIn(expected_write, stdout, stderr)
|
|
113
|
+
self.assertEqual(stdout.count("PASSED"), 3)
|
|
114
|
+
else:
|
|
115
|
+
self.assertIn(b"PASSED", stdout, stderr)
|
|
116
|
+
self.assertNotIn(b"FAILED", stdout, stderr)
|
|
117
|
+
if ROBOT_VERSION < "4.0":
|
|
118
|
+
expected_write = b"5 critical tests, 5 passed, 0 failed"
|
|
119
|
+
else:
|
|
120
|
+
expected_write = b"5 tests, 5 passed, 0 failed, 0 skipped."
|
|
121
|
+
self.assertIn(expected_write, stdout, stderr)
|
|
122
|
+
self.assertEqual(stdout.count(b"PASSED"), 3)
|
|
123
|
+
|
|
124
|
+
def test_too_big_testname(self):
|
|
125
|
+
stdout, stderr = self._run_tests_with(
|
|
126
|
+
"""
|
|
127
|
+
*** Test Cases ***
|
|
128
|
+
Test Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eu velit nunc. Duis eget purus eget orci porta blandit sed ut tortor. Nunc vel nulla bibendum, auctor sem ac, molestie risus. Sed eu metus volutpat, hendrerit nibh in, auctor urna. Nunc a sodales.
|
|
129
|
+
Log Test
|
|
130
|
+
|
|
131
|
+
""",
|
|
132
|
+
"""
|
|
133
|
+
--test Invalid
|
|
134
|
+
""",
|
|
135
|
+
)
|
|
136
|
+
if sys.version_info < (3, 0):
|
|
137
|
+
self.assertIn("PASSED", stdout, stderr)
|
|
138
|
+
self.assertNotIn("FAILED", stdout, stderr)
|
|
139
|
+
self.assertEqual(stdout.count("PASSED"), 1)
|
|
140
|
+
else:
|
|
141
|
+
self.assertIn(b"PASSED", stdout, stderr)
|
|
142
|
+
self.assertNotIn(b"FAILED", stdout, stderr)
|
|
143
|
+
self.assertEqual(stdout.count(b"PASSED"), 1)
|
|
144
|
+
|
|
145
|
+
def test_longnames_in_tests(self):
|
|
146
|
+
stdout, stderr = self._run_tests_with(
|
|
147
|
+
"""
|
|
148
|
+
*** Settings ***
|
|
149
|
+
Test Template Test1
|
|
150
|
+
*** Test Cases ***
|
|
151
|
+
The Somewhat Long Name Of The Test S1Test 01 1
|
|
152
|
+
The Somewhat Long Name Of The Test S1Test 02 1
|
|
153
|
+
The Somewhat Long Name Of The Test S1Test 03 1
|
|
154
|
+
The Somewhat Long Name Of The Test S1Test 04 1
|
|
155
|
+
The Somewhat Long Name Of The Test S1Test 05 1
|
|
156
|
+
The Somewhat Long Name Of The Test S1Test 06 1
|
|
157
|
+
The Somewhat Long Name Of The Test S1Test 07 1
|
|
158
|
+
The Somewhat Long Name Of The Test S1Test 08 1
|
|
159
|
+
The Somewhat Long Name Of The Test S1Test 09 1
|
|
160
|
+
The Somewhat Long Name Of The Test S1Test 10 1
|
|
161
|
+
The Somewhat Long Name Of The Test S1Test 11 1
|
|
162
|
+
The Somewhat Long Name Of The Test S1Test 12 1
|
|
163
|
+
*** Keywords ***
|
|
164
|
+
Test1
|
|
165
|
+
[Arguments] ${arg}
|
|
166
|
+
Log Test
|
|
167
|
+
""",
|
|
168
|
+
"""
|
|
169
|
+
{
|
|
170
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 01
|
|
171
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 02
|
|
172
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 03
|
|
173
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 04
|
|
174
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 05
|
|
175
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 06
|
|
176
|
+
}
|
|
177
|
+
{
|
|
178
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 07
|
|
179
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 08
|
|
180
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 09
|
|
181
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 10
|
|
182
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 11
|
|
183
|
+
--test Test.The Somewhat Long Name Of The Test S1Test 12
|
|
184
|
+
}
|
|
185
|
+
""",
|
|
186
|
+
)
|
|
187
|
+
if sys.version_info < (3, 0):
|
|
188
|
+
self.assertIn("PASSED", stdout, stderr)
|
|
189
|
+
self.assertNotIn("FAILED", stdout, stderr)
|
|
190
|
+
self.assertEqual(stdout.count("PASSED"), 2)
|
|
191
|
+
else:
|
|
192
|
+
self.assertIn(b"PASSED", stdout, stderr)
|
|
193
|
+
self.assertNotIn(b"FAILED", stdout, stderr)
|
|
194
|
+
self.assertEqual(stdout.count(b"PASSED"), 2)
|