robotframework-pabot 4.1.0__tar.gz → 4.2.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-4.2.0/PKG-INFO +365 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/README.md +64 -3
- robotframework_pabot-4.2.0/pyproject.toml +3 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/setup.cfg +2 -1
- robotframework_pabot-4.2.0/setup.py +14 -0
- robotframework_pabot-4.2.0/src/pabot/__init__.py +10 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/arguments.py +6 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/execution_items.py +28 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/pabot.py +122 -9
- robotframework_pabot-4.2.0/src/robotframework_pabot.egg-info/PKG-INFO +365 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/robotframework_pabot.egg-info/SOURCES.txt +2 -0
- robotframework_pabot-4.2.0/tests/test_basic_arguments.py +62 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_ordering.py +70 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_pabotprerunmodifier.py +34 -2
- robotframework_pabot-4.2.0/tests/test_suite_structure.py +232 -0
- robotframework_pabot-4.1.0/PKG-INFO +0 -25
- robotframework_pabot-4.1.0/pyproject.toml +0 -3
- robotframework_pabot-4.1.0/setup.py +0 -5
- robotframework_pabot-4.1.0/src/pabot/__init__.py +0 -5
- robotframework_pabot-4.1.0/src/robotframework_pabot.egg-info/PKG-INFO +0 -25
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/LICENSE.txt +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/MANIFEST.in +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/SharedLibrary.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/clientwrapper.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/coordinatorwrapper.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/pabotlib.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/py3/__init__.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/py3/client.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/py3/coordinator.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/py3/messages.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/py3/worker.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/result_merger.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/robotremoteserver.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/pabot/workerwrapper.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/robotframework_pabot.egg-info/dependency_links.txt +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/robotframework_pabot.egg-info/entry_points.txt +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/robotframework_pabot.egg-info/requires.txt +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/src/robotframework_pabot.egg-info/top_level.txt +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_arguments_output.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_depends.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_functional.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_pabot.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_pabotlib.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_pabotsuitenames_io.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_prerunmodifier.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_resultmerger.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_stacktrace.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_testlevelsplit_include.py +0 -0
- {robotframework_pabot-4.1.0 → robotframework_pabot-4.2.0}/tests/test_testlevelsplit_output_task_order.py +0 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: robotframework-pabot
|
|
3
|
+
Version: 4.2.0
|
|
4
|
+
Summary: Parallel test runner for Robot Framework
|
|
5
|
+
Home-page: https://pabot.org
|
|
6
|
+
Download-URL: https://pypi.python.org/pypi/robotframework-pabot
|
|
7
|
+
Author: Mikko Korpela
|
|
8
|
+
Author-email: mikko.korpela@gmail.com
|
|
9
|
+
License: Apache License, Version 2.0
|
|
10
|
+
Project-URL: Source, https://github.com/mkorpela/pabot
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Software Development :: Testing
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
17
|
+
Classifier: Framework :: Robot Framework
|
|
18
|
+
Requires-Python: >=3.6
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE.txt
|
|
21
|
+
Requires-Dist: robotframework>=3.2
|
|
22
|
+
Requires-Dist: robotframework-stacktrace>=0.4.1
|
|
23
|
+
Requires-Dist: natsort>=8.2.0
|
|
24
|
+
Dynamic: download-url
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# Pabot
|
|
28
|
+
|
|
29
|
+
[中文版](README_zh.md)
|
|
30
|
+
|
|
31
|
+
[](https://pypi.python.org/pypi/robotframework-pabot)
|
|
32
|
+
[](http://pepy.tech/project/robotframework-pabot)
|
|
33
|
+
|
|
34
|
+
<img src="https://raw.githubusercontent.com/mkorpela/pabot/master/pabot.png" width="100">
|
|
35
|
+
|
|
36
|
+
----
|
|
37
|
+
|
|
38
|
+
A parallel executor for [Robot Framework](http://www.robotframework.org) tests. With Pabot you can split one execution into multiple and save test execution time.
|
|
39
|
+
|
|
40
|
+
[](https://youtu.be/i0RV6SJSIn8 "Pabot presentation at robocon.io 2018")
|
|
41
|
+
|
|
42
|
+
## Installation:
|
|
43
|
+
|
|
44
|
+
From PyPi:
|
|
45
|
+
|
|
46
|
+
pip install -U robotframework-pabot
|
|
47
|
+
|
|
48
|
+
OR clone this repository and run:
|
|
49
|
+
|
|
50
|
+
setup.py install
|
|
51
|
+
|
|
52
|
+
OR clone this repository and run:
|
|
53
|
+
|
|
54
|
+
pip install --editable .
|
|
55
|
+
|
|
56
|
+
## Basic use
|
|
57
|
+
|
|
58
|
+
Split execution to suite files.
|
|
59
|
+
|
|
60
|
+
pabot [path to tests]
|
|
61
|
+
|
|
62
|
+
Split execution on test level.
|
|
63
|
+
|
|
64
|
+
pabot --testlevelsplit [path to tests]
|
|
65
|
+
|
|
66
|
+
Run same tests with two different configurations.
|
|
67
|
+
|
|
68
|
+
pabot --argumentfile1 first.args --argumentfile2 second.args [path to tests]
|
|
69
|
+
|
|
70
|
+
For more complex cases please read onward.
|
|
71
|
+
|
|
72
|
+
## Contact
|
|
73
|
+
|
|
74
|
+
Join [Pabot Slack channel](https://robotframework.slack.com/messages/C7HKR2L6L) in Robot Framework slack.
|
|
75
|
+
[Get invite to Robot Framework slack](https://robotframework-slack-invite.herokuapp.com/).
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## Contributing to the project
|
|
79
|
+
|
|
80
|
+
There are several ways you can help in improving this tool:
|
|
81
|
+
|
|
82
|
+
- Report an issue or an improvement idea to the [issue tracker](https://github.com/mkorpela/pabot/issues)
|
|
83
|
+
- Contribute by programming and making a pull request (easiest way is to work on an issue from the issue tracker)
|
|
84
|
+
|
|
85
|
+
## Command-line options
|
|
86
|
+
<!-- START DOCSTRING -->
|
|
87
|
+
pabot [--verbose|--testlevelsplit|--command .. --end-command|
|
|
88
|
+
--processes num|--no-pabotlib|--pabotlibhost host|--pabotlibport port|
|
|
89
|
+
--processtimeout num|
|
|
90
|
+
--shard i/n|
|
|
91
|
+
--artifacts extensions|--artifactsinsubfolders|
|
|
92
|
+
--resourcefile file|--argumentfile[num] file|--suitesfrom file|--ordering file|
|
|
93
|
+
--chunk|
|
|
94
|
+
--pabotprerunmodifier modifier|
|
|
95
|
+
--no-rebot|
|
|
96
|
+
--help|--version]
|
|
97
|
+
[robot options] [path ...]
|
|
98
|
+
|
|
99
|
+
PabotLib remote server is started by default to enable locking and resource distribution between parallel test executions.
|
|
100
|
+
|
|
101
|
+
Supports all [Robot Framework command line options](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#all-command-line-options) and also following pabot options:
|
|
102
|
+
|
|
103
|
+
--verbose
|
|
104
|
+
More output from the parallel execution.
|
|
105
|
+
|
|
106
|
+
--testlevelsplit
|
|
107
|
+
Split execution on test level instead of default suite level. If .pabotsuitenames contains both tests and suites then
|
|
108
|
+
this will only affect new suites and split only them. Leaving this flag out when both suites and tests in
|
|
109
|
+
.pabotsuitenames file will also only affect new suites and add them as suite files.
|
|
110
|
+
|
|
111
|
+
--command [ACTUAL COMMANDS TO START ROBOT EXECUTOR] --end-command
|
|
112
|
+
RF script for situations where robot is not used directly.
|
|
113
|
+
|
|
114
|
+
--processes [NUMBER OF PROCESSES]
|
|
115
|
+
How many parallel executors to use (default max of 2 and cpu count). Special option "all" will use as many processes as
|
|
116
|
+
there are executable suites or tests.
|
|
117
|
+
|
|
118
|
+
--no-pabotlib
|
|
119
|
+
Disable the PabotLib remote server if you don't need locking or resource distribution features.
|
|
120
|
+
|
|
121
|
+
--pabotlibhost [HOSTNAME]
|
|
122
|
+
Connect to an already running instance of the PabotLib remote server at the given host (disables the local PabotLib
|
|
123
|
+
server start). For example, to connect to a remote PabotLib server running on another machine:
|
|
124
|
+
|
|
125
|
+
pabot --pabotlibhost 192.168.1.123 --pabotlibport 8271 tests/
|
|
126
|
+
|
|
127
|
+
The remote server can be also started and executed separately from pabot instances:
|
|
128
|
+
|
|
129
|
+
python -m pabot.pabotlib <path_to_resourcefile> <host> <port>
|
|
130
|
+
python -m pabot.pabotlib resource.txt 192.168.1.123 8271
|
|
131
|
+
|
|
132
|
+
This enables sharing a resource with multiple Robot Framework instances.
|
|
133
|
+
|
|
134
|
+
--pabotlibport [PORT]
|
|
135
|
+
Port number of the PabotLib remote server (default is 8270). See --pabotlibhost for more information.
|
|
136
|
+
|
|
137
|
+
--processtimeout [TIMEOUT]
|
|
138
|
+
Maximum time in seconds to wait for a process before killing it. If not set, there's no timeout.
|
|
139
|
+
|
|
140
|
+
--shard [INDEX]/[TOTAL]
|
|
141
|
+
Optionally split execution into smaller pieces. This can be used for distributing testing to multiple machines.
|
|
142
|
+
|
|
143
|
+
--artifacts [FILE EXTENSIONS]
|
|
144
|
+
List of file extensions (comma separated). Defines which files (screenshots, videos etc.) from separate reporting
|
|
145
|
+
directories would be copied and included in a final report. Possible links to copied files in RF log would be updated
|
|
146
|
+
(only relative paths supported). The default value is `png`.
|
|
147
|
+
|
|
148
|
+
Examples:
|
|
149
|
+
|
|
150
|
+
--artifacts png,mp4,txt
|
|
151
|
+
|
|
152
|
+
--artifactsinsubfolders
|
|
153
|
+
Copy artifacts located not only directly in the RF output dir, but also in it's sub-folders.
|
|
154
|
+
|
|
155
|
+
--resourcefile [FILEPATH]
|
|
156
|
+
Indicator for a file that can contain shared variables for distributing resources. This needs to be used together with
|
|
157
|
+
pabotlib option. Resource file syntax is same as Windows ini files. Where a section is a shared set of variables.
|
|
158
|
+
|
|
159
|
+
--argumentfile [INTEGER] [FILEPATH]
|
|
160
|
+
Run same suites with multiple [argumentfile](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#argument-files) options.
|
|
161
|
+
|
|
162
|
+
For example:
|
|
163
|
+
|
|
164
|
+
--argumentfile1 arg1.txt --argumentfile2 arg2.txt
|
|
165
|
+
|
|
166
|
+
--suitesfrom [FILEPATH TO OUTPUTXML]
|
|
167
|
+
Optionally read suites from output.xml file. Failed suites will run first and longer running ones will be executed
|
|
168
|
+
before shorter ones.
|
|
169
|
+
|
|
170
|
+
--ordering [FILE PATH]
|
|
171
|
+
Optionally give execution order from a file.
|
|
172
|
+
|
|
173
|
+
--chunk
|
|
174
|
+
Optionally chunk tests to PROCESSES number of robot runs. This can save time because all the suites will share the same
|
|
175
|
+
setups and teardowns.
|
|
176
|
+
|
|
177
|
+
--pabotprerunmodifier [PRERUNMODIFIER MODULE OR CLASS]
|
|
178
|
+
Like Robot Framework's --prerunmodifier, but executed only once in the pabot's main process after all other
|
|
179
|
+
--prerunmodifiers. But unlike the regular --prerunmodifier command, --pabotprerunmodifier is not executed again in each
|
|
180
|
+
pabot subprocesses. Depending on the intended use, this may be desirable as well as more efficient. Can be used, for
|
|
181
|
+
example, to modify the list of tests to be performed.
|
|
182
|
+
|
|
183
|
+
--no-rebot
|
|
184
|
+
If specified, the tests will execute as usual, but Rebot will not be called to merge the logs. This option is designed
|
|
185
|
+
for scenarios where Rebot should be run later due to large log files, ensuring better memory and resource availability.
|
|
186
|
+
Subprocess results are stored in the pabot_results folder.
|
|
187
|
+
|
|
188
|
+
--help
|
|
189
|
+
Print usage instructions.
|
|
190
|
+
|
|
191
|
+
--version
|
|
192
|
+
Print version information.
|
|
193
|
+
|
|
194
|
+
Example usages:
|
|
195
|
+
|
|
196
|
+
pabot test_directory
|
|
197
|
+
pabot --exclude FOO directory_to_tests
|
|
198
|
+
pabot --command java -jar robotframework.jar --end-command --include SMOKE tests
|
|
199
|
+
pabot --processes 10 tests
|
|
200
|
+
pabot --pabotlibhost 192.168.1.123 --pabotlibport 8271 --processes 10 tests
|
|
201
|
+
pabot --artifacts png,mp4,txt --artifactsinsubfolders directory_to_tests
|
|
202
|
+
# To disable PabotLib:
|
|
203
|
+
pabot --no-pabotlib tests
|
|
204
|
+
|
|
205
|
+
<!-- END DOCSTRING -->
|
|
206
|
+
### PabotLib
|
|
207
|
+
|
|
208
|
+
pabot.PabotLib provides keywords that will help communication and data sharing between the executor processes.
|
|
209
|
+
These can be helpful when you must ensure that only one of the processes uses some piece of data or operates on some part of the system under test at a time.
|
|
210
|
+
|
|
211
|
+
PabotLib Docs are located at https://pabot.org/PabotLib.html.
|
|
212
|
+
|
|
213
|
+
### PabotLib example:
|
|
214
|
+
|
|
215
|
+
test.robot
|
|
216
|
+
|
|
217
|
+
*** Settings ***
|
|
218
|
+
Library pabot.PabotLib
|
|
219
|
+
|
|
220
|
+
*** Test Case ***
|
|
221
|
+
Testing PabotLib
|
|
222
|
+
Acquire Lock MyLock
|
|
223
|
+
Log This part is critical section
|
|
224
|
+
Release Lock MyLock
|
|
225
|
+
${valuesetname}= Acquire Value Set admin-server
|
|
226
|
+
${host}= Get Value From Set host
|
|
227
|
+
${username}= Get Value From Set username
|
|
228
|
+
${password}= Get Value From Set password
|
|
229
|
+
Log Do something with the values (for example access host with username and password)
|
|
230
|
+
Release Value Set
|
|
231
|
+
Log After value set release others can obtain the variable values
|
|
232
|
+
|
|
233
|
+
valueset.dat
|
|
234
|
+
|
|
235
|
+
[Server1]
|
|
236
|
+
tags=admin-server
|
|
237
|
+
HOST=123.123.123.123
|
|
238
|
+
USERNAME=user1
|
|
239
|
+
PASSWORD=password1
|
|
240
|
+
|
|
241
|
+
[Server2]
|
|
242
|
+
tags=server
|
|
243
|
+
HOST=121.121.121.121
|
|
244
|
+
USERNAME=user2
|
|
245
|
+
PASSWORD=password2
|
|
246
|
+
|
|
247
|
+
[Server3]
|
|
248
|
+
tags=admin-server
|
|
249
|
+
HOST=222.222.222.222
|
|
250
|
+
USERNAME=user3
|
|
251
|
+
PASSWORD=password4
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
pabot call using resources from valueset.dat
|
|
255
|
+
|
|
256
|
+
pabot --pabotlib --resourcefile valueset.dat test.robot
|
|
257
|
+
|
|
258
|
+
### Controlling execution order and level of parallelism
|
|
259
|
+
|
|
260
|
+
.pabotsuitenames file contains the list of suites that will be executed.
|
|
261
|
+
File is created during pabot execution if not already there.
|
|
262
|
+
The file is a cache that pabot uses when re-executing same tests to speed up processing.
|
|
263
|
+
This file can be partially manually edited but easier option is to use ```--ordering FILENAME```.
|
|
264
|
+
First 4 rows contain information that should not be edited - pabot will edit these when something changes.
|
|
265
|
+
After this come the suite names.
|
|
266
|
+
|
|
267
|
+
With ```--ordering FILENAME``` you can have a list that controls order also. The syntax is same as .pabotsuitenames file syntax but does not contain 4 hash rows that are present in .pabotsuitenames.
|
|
268
|
+
|
|
269
|
+
There different possibilities to influence the execution:
|
|
270
|
+
|
|
271
|
+
* The order of suites can be changed.
|
|
272
|
+
* If a directory (or a directory structure) should be executed sequentially, add the directory suite name to a row as a ```--suite``` option.
|
|
273
|
+
* If the base suite name is changing with robot option [```--name / -N```](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#setting-the-name) you can also give partial suite name without the base suite.
|
|
274
|
+
* You can add a line with text `#WAIT` to force executor to wait until all previous suites have been executed.
|
|
275
|
+
* You can group suites and tests together to same executor process by adding line `{` before the group and `}`after.
|
|
276
|
+
* You can introduce dependencies using the word `#DEPENDS` after a test declaration. Can be used several times if it is necessary to refer to several different tests. Please take care that in case of circular dependencies an exception will be thrown. An example could be.
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
--test robotTest.1 Scalar.Test With Environment Variables #DEPENDS robotTest.1 Scalar.Test with BuiltIn Variables of Robot Framework
|
|
280
|
+
--test robotTest.1 Scalar.Test with BuiltIn Variables of Robot Framework
|
|
281
|
+
--test robotTest.2 Lists.Test with Keywords and a list
|
|
282
|
+
#WAIT
|
|
283
|
+
--test robotTest.2 Lists.Test with a Keyword that accepts multiple arguments
|
|
284
|
+
--test robotTest.2 Lists.Test with some Collections keywords
|
|
285
|
+
--test robotTest.2 Lists.Test to access list entries
|
|
286
|
+
--test robotTest.3 Dictionary.Test that accesses Dictionaries
|
|
287
|
+
--test robotTest.3 Dictionary.Dictionaries for named arguments #DEPENDS robotTest.3 Dictionary.Test that accesses Dictionaries
|
|
288
|
+
--test robotTest.1 Scalar.Test Case With Variables #DEPENDS robotTest.3 Dictionary.Test that accesses Dictionaries
|
|
289
|
+
--test robotTest.1 Scalar.Test with Numbers #DEPENDS robotTest.1 Scalar.Test With Arguments and Return Values
|
|
290
|
+
--test robotTest.1 Scalar.Test Case with Return Values #DEPENDS robotTest.1 Scalar.Test with Numbers
|
|
291
|
+
--test robotTest.1 Scalar.Test With Arguments and Return Values
|
|
292
|
+
--test robotTest.3 Dictionary.Test with Dictionaries as Arguments
|
|
293
|
+
--test robotTest.3 Dictionary.Test with FOR loops and Dictionaries #DEPENDS robotTest.1 Scalar.Test Case with Return Values
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
* By using the command `#SLEEP X`, where `X` is an integer in the range [0-3600] (in seconds), you can
|
|
297
|
+
define a startup delay for each subprocess. `#SLEEP` affects the next line unless the next line starts a
|
|
298
|
+
group with `{`, in which case the delay applies to the entire group. If the next line begins with `--test`
|
|
299
|
+
or `--suite`, the delay is applied to that specific item. Any other occurrences of `#SLEEP` are ignored.
|
|
300
|
+
|
|
301
|
+
The following example clarifies the behavior:
|
|
302
|
+
|
|
303
|
+
```sh
|
|
304
|
+
pabot --process 2 --ordering order.txt data_1
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
where order.txt is:
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
#SLEEP 1
|
|
311
|
+
{
|
|
312
|
+
#SLEEP 2
|
|
313
|
+
--suite Data 1.suite A
|
|
314
|
+
#SLEEP 3
|
|
315
|
+
--suite Data 1.suite B
|
|
316
|
+
#SLEEP 4
|
|
317
|
+
}
|
|
318
|
+
#SLEEP 5
|
|
319
|
+
#SLEEP 6
|
|
320
|
+
--suite Data 1.suite C
|
|
321
|
+
#SLEEP 7
|
|
322
|
+
--suite Data 1.suite D
|
|
323
|
+
#SLEEP 8
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
prints something like this:
|
|
327
|
+
|
|
328
|
+
```
|
|
329
|
+
2025-02-15 19:15:00.408321 [0] [ID:1] SLEEPING 6 SECONDS BEFORE STARTING Data 1.suite C
|
|
330
|
+
2025-02-15 19:15:00.408321 [1] [ID:0] SLEEPING 1 SECONDS BEFORE STARTING Group_Data 1.suite A_Data 1.suite B
|
|
331
|
+
2025-02-15 19:15:01.409389 [PID:52008] [1] [ID:0] EXECUTING Group_Data 1.suite A_Data 1.suite B
|
|
332
|
+
2025-02-15 19:15:06.409024 [PID:1528] [0] [ID:1] EXECUTING Data 1.suite C
|
|
333
|
+
2025-02-15 19:15:09.257564 [PID:52008] [1] [ID:0] PASSED Group_Data 1.suite A_Data 1.suite B in 7.8 seconds
|
|
334
|
+
2025-02-15 19:15:09.259067 [1] [ID:2] SLEEPING 7 SECONDS BEFORE STARTING Data 1.suite D
|
|
335
|
+
2025-02-15 19:15:09.647342 [PID:1528] [0] [ID:1] PASSED Data 1.suite C in 3.2 seconds
|
|
336
|
+
2025-02-15 19:15:16.260432 [PID:48156] [1] [ID:2] EXECUTING Data 1.suite D
|
|
337
|
+
2025-02-15 19:15:18.696420 [PID:48156] [1] [ID:2] PASSED Data 1.suite D in 2.4 seconds
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Programmatic use
|
|
341
|
+
|
|
342
|
+
Library offers an endpoint `main_program` that will not call `sys.exit`. This can help in developing your own python program around pabot.
|
|
343
|
+
|
|
344
|
+
```Python
|
|
345
|
+
import sys
|
|
346
|
+
from pabot.pabot import main_program
|
|
347
|
+
|
|
348
|
+
def amazing_new_program():
|
|
349
|
+
print("Before calling pabot")
|
|
350
|
+
exit_code = main_program(['tests'])
|
|
351
|
+
print(f"After calling pabot (return code {exit_code})")
|
|
352
|
+
sys.exit(exit_code)
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### Global variables
|
|
357
|
+
|
|
358
|
+
Pabot will insert following global variables to Robot Framework namespace. These are here to enable PabotLib functionality and for custom listeners etc. to get some information on the overall execution of pabot.
|
|
359
|
+
|
|
360
|
+
PABOTQUEUEINDEX - this contains a unique index number for the execution. Indexes start from 0.
|
|
361
|
+
PABOTLIBURI - this contains the URI for the running PabotLib server
|
|
362
|
+
PABOTEXECUTIONPOOLID - this contains the pool id (an integer) for the current Robot Framework executor. This is helpful for example when visualizing the execution flow from your own listener.
|
|
363
|
+
PABOTNUMBEROFPROCESSES - max number of concurrent processes that pabot may use in execution.
|
|
364
|
+
CALLER_ID - a universally unique identifier for this execution.
|
|
365
|
+
|
|
@@ -23,6 +23,10 @@ OR clone this repository and run:
|
|
|
23
23
|
|
|
24
24
|
setup.py install
|
|
25
25
|
|
|
26
|
+
OR clone this repository and run:
|
|
27
|
+
|
|
28
|
+
pip install --editable .
|
|
29
|
+
|
|
26
30
|
## Basic use
|
|
27
31
|
|
|
28
32
|
Split execution to suite files.
|
|
@@ -59,9 +63,11 @@ pabot [--verbose|--testlevelsplit|--command .. --end-command|
|
|
|
59
63
|
--processtimeout num|
|
|
60
64
|
--shard i/n|
|
|
61
65
|
--artifacts extensions|--artifactsinsubfolders|
|
|
62
|
-
--resourcefile file|--argumentfile[num] file|--suitesfrom file|--ordering file
|
|
63
|
-
--chunk
|
|
64
|
-
--pabotprerunmodifier modifier
|
|
66
|
+
--resourcefile file|--argumentfile[num] file|--suitesfrom file|--ordering file|
|
|
67
|
+
--chunk|
|
|
68
|
+
--pabotprerunmodifier modifier|
|
|
69
|
+
--no-rebot|
|
|
70
|
+
--help|--version]
|
|
65
71
|
[robot options] [path ...]
|
|
66
72
|
|
|
67
73
|
PabotLib remote server is started by default to enable locking and resource distribution between parallel test executions.
|
|
@@ -148,6 +154,17 @@ Supports all [Robot Framework command line options](https://robotframework.org/r
|
|
|
148
154
|
pabot subprocesses. Depending on the intended use, this may be desirable as well as more efficient. Can be used, for
|
|
149
155
|
example, to modify the list of tests to be performed.
|
|
150
156
|
|
|
157
|
+
--no-rebot
|
|
158
|
+
If specified, the tests will execute as usual, but Rebot will not be called to merge the logs. This option is designed
|
|
159
|
+
for scenarios where Rebot should be run later due to large log files, ensuring better memory and resource availability.
|
|
160
|
+
Subprocess results are stored in the pabot_results folder.
|
|
161
|
+
|
|
162
|
+
--help
|
|
163
|
+
Print usage instructions.
|
|
164
|
+
|
|
165
|
+
--version
|
|
166
|
+
Print version information.
|
|
167
|
+
|
|
151
168
|
Example usages:
|
|
152
169
|
|
|
153
170
|
pabot test_directory
|
|
@@ -248,6 +265,50 @@ There different possibilities to influence the execution:
|
|
|
248
265
|
--test robotTest.1 Scalar.Test With Arguments and Return Values
|
|
249
266
|
--test robotTest.3 Dictionary.Test with Dictionaries as Arguments
|
|
250
267
|
--test robotTest.3 Dictionary.Test with FOR loops and Dictionaries #DEPENDS robotTest.1 Scalar.Test Case with Return Values
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
* By using the command `#SLEEP X`, where `X` is an integer in the range [0-3600] (in seconds), you can
|
|
271
|
+
define a startup delay for each subprocess. `#SLEEP` affects the next line unless the next line starts a
|
|
272
|
+
group with `{`, in which case the delay applies to the entire group. If the next line begins with `--test`
|
|
273
|
+
or `--suite`, the delay is applied to that specific item. Any other occurrences of `#SLEEP` are ignored.
|
|
274
|
+
|
|
275
|
+
The following example clarifies the behavior:
|
|
276
|
+
|
|
277
|
+
```sh
|
|
278
|
+
pabot --process 2 --ordering order.txt data_1
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
where order.txt is:
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
#SLEEP 1
|
|
285
|
+
{
|
|
286
|
+
#SLEEP 2
|
|
287
|
+
--suite Data 1.suite A
|
|
288
|
+
#SLEEP 3
|
|
289
|
+
--suite Data 1.suite B
|
|
290
|
+
#SLEEP 4
|
|
291
|
+
}
|
|
292
|
+
#SLEEP 5
|
|
293
|
+
#SLEEP 6
|
|
294
|
+
--suite Data 1.suite C
|
|
295
|
+
#SLEEP 7
|
|
296
|
+
--suite Data 1.suite D
|
|
297
|
+
#SLEEP 8
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
prints something like this:
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
2025-02-15 19:15:00.408321 [0] [ID:1] SLEEPING 6 SECONDS BEFORE STARTING Data 1.suite C
|
|
304
|
+
2025-02-15 19:15:00.408321 [1] [ID:0] SLEEPING 1 SECONDS BEFORE STARTING Group_Data 1.suite A_Data 1.suite B
|
|
305
|
+
2025-02-15 19:15:01.409389 [PID:52008] [1] [ID:0] EXECUTING Group_Data 1.suite A_Data 1.suite B
|
|
306
|
+
2025-02-15 19:15:06.409024 [PID:1528] [0] [ID:1] EXECUTING Data 1.suite C
|
|
307
|
+
2025-02-15 19:15:09.257564 [PID:52008] [1] [ID:0] PASSED Group_Data 1.suite A_Data 1.suite B in 7.8 seconds
|
|
308
|
+
2025-02-15 19:15:09.259067 [1] [ID:2] SLEEPING 7 SECONDS BEFORE STARTING Data 1.suite D
|
|
309
|
+
2025-02-15 19:15:09.647342 [PID:1528] [0] [ID:1] PASSED Data 1.suite C in 3.2 seconds
|
|
310
|
+
2025-02-15 19:15:16.260432 [PID:48156] [1] [ID:2] EXECUTING Data 1.suite D
|
|
311
|
+
2025-02-15 19:15:18.696420 [PID:48156] [1] [ID:2] PASSED Data 1.suite D in 2.4 seconds
|
|
251
312
|
```
|
|
252
313
|
|
|
253
314
|
### Programmatic use
|
|
@@ -8,7 +8,8 @@ project_urls =
|
|
|
8
8
|
Source = https://github.com/mkorpela/pabot
|
|
9
9
|
version = attr: pabot.__version__
|
|
10
10
|
description = Parallel test runner for Robot Framework
|
|
11
|
-
long_description =
|
|
11
|
+
long_description = file: README.md
|
|
12
|
+
long_description_content_type = text/markdown
|
|
12
13
|
license = Apache License, Version 2.0
|
|
13
14
|
classifiers =
|
|
14
15
|
Intended Audience :: Developers
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
from setuptools import setup
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
# Add src to path so that version can be imported
|
|
8
|
+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
|
|
9
|
+
from pabot import __version__
|
|
10
|
+
|
|
11
|
+
setup(
|
|
12
|
+
name="robotframework-pabot",
|
|
13
|
+
version=__version__,
|
|
14
|
+
)
|
|
@@ -16,6 +16,7 @@ from .execution_items import (
|
|
|
16
16
|
SuiteItem,
|
|
17
17
|
TestItem,
|
|
18
18
|
WaitItem,
|
|
19
|
+
SleepItem,
|
|
19
20
|
)
|
|
20
21
|
|
|
21
22
|
ARGSMATCHER = re.compile(r"--argumentfile(\d+)")
|
|
@@ -79,6 +80,7 @@ def _parse_pabot_args(args): # type: (List[str]) -> Tuple[List[str], Dict[str,
|
|
|
79
80
|
"command": ["pybot" if ROBOT_VERSION < "3.1" else "robot"],
|
|
80
81
|
"verbose": False,
|
|
81
82
|
"help": False,
|
|
83
|
+
"version": False,
|
|
82
84
|
"testlevelsplit": False,
|
|
83
85
|
"pabotlib": True,
|
|
84
86
|
"pabotlibhost": "127.0.0.1",
|
|
@@ -90,6 +92,7 @@ def _parse_pabot_args(args): # type: (List[str]) -> Tuple[List[str], Dict[str,
|
|
|
90
92
|
"shardindex": 0,
|
|
91
93
|
"shardcount": 1,
|
|
92
94
|
"chunk": False,
|
|
95
|
+
"no-rebot": False,
|
|
93
96
|
}
|
|
94
97
|
# Explicitly define argument types for validation
|
|
95
98
|
flag_args = {
|
|
@@ -99,6 +102,7 @@ def _parse_pabot_args(args): # type: (List[str]) -> Tuple[List[str], Dict[str,
|
|
|
99
102
|
"pabotlib",
|
|
100
103
|
"artifactsinsubfolders",
|
|
101
104
|
"chunk",
|
|
105
|
+
"no-rebot"
|
|
102
106
|
}
|
|
103
107
|
value_args = {
|
|
104
108
|
"hive": str,
|
|
@@ -216,6 +220,8 @@ def parse_execution_item_line(text): # type: (str) -> ExecutionItem
|
|
|
216
220
|
if text.startswith("DYNAMICTEST"):
|
|
217
221
|
suite, test = text[12:].split(" :: ")
|
|
218
222
|
return DynamicTestItem(test, suite)
|
|
223
|
+
if text.startswith("#SLEEP "):
|
|
224
|
+
return SleepItem(text[7:])
|
|
219
225
|
if text == "#WAIT":
|
|
220
226
|
return WaitItem()
|
|
221
227
|
if text == "{":
|
|
@@ -12,6 +12,7 @@ class ExecutionItem(object):
|
|
|
12
12
|
isWait = False
|
|
13
13
|
type = None # type: str
|
|
14
14
|
name = None # type: str
|
|
15
|
+
sleep = 0 # type: int
|
|
15
16
|
|
|
16
17
|
def top_name(self):
|
|
17
18
|
# type: () -> str
|
|
@@ -29,6 +30,14 @@ class ExecutionItem(object):
|
|
|
29
30
|
# type: () -> str
|
|
30
31
|
return ""
|
|
31
32
|
|
|
33
|
+
def set_sleep(self, sleep_time):
|
|
34
|
+
# type: (int) -> None
|
|
35
|
+
self.sleep = sleep_time
|
|
36
|
+
|
|
37
|
+
def get_sleep(self):
|
|
38
|
+
# type: () -> int
|
|
39
|
+
return self.sleep
|
|
40
|
+
|
|
32
41
|
def modify_options_for_executor(self, options):
|
|
33
42
|
options[self.type] = self.name
|
|
34
43
|
|
|
@@ -82,6 +91,8 @@ class GroupItem(ExecutionItem):
|
|
|
82
91
|
)
|
|
83
92
|
if len(self._items) > 0:
|
|
84
93
|
self.name += "_"
|
|
94
|
+
if self.get_sleep() < item.get_sleep(): # TODO: check!
|
|
95
|
+
self.set_sleep(item.get_sleep())
|
|
85
96
|
self.name += item.name
|
|
86
97
|
self._element_type = item.type
|
|
87
98
|
self._items.append(item)
|
|
@@ -274,6 +285,23 @@ class WaitItem(ExecutionItem):
|
|
|
274
285
|
return self.name
|
|
275
286
|
|
|
276
287
|
|
|
288
|
+
class SleepItem(ExecutionItem):
|
|
289
|
+
type = "sleep"
|
|
290
|
+
|
|
291
|
+
def __init__(self, time):
|
|
292
|
+
try:
|
|
293
|
+
assert 3600 >= int(time) >= 0 # 1 h max.
|
|
294
|
+
self.name = time
|
|
295
|
+
self.sleep = int(time)
|
|
296
|
+
except ValueError:
|
|
297
|
+
raise ValueError("#SLEEP value %s is not integer" % time)
|
|
298
|
+
except AssertionError:
|
|
299
|
+
raise ValueError("#SLEEP value %s is not in between 0 and 3600" % time)
|
|
300
|
+
|
|
301
|
+
def line(self):
|
|
302
|
+
return "#SLEEP " + self.name
|
|
303
|
+
|
|
304
|
+
|
|
277
305
|
class GroupStartItem(ExecutionItem):
|
|
278
306
|
type = "group"
|
|
279
307
|
|