robotframework-pabot 4.0.6__tar.gz → 4.1.1__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.
Files changed (46) hide show
  1. robotframework_pabot-4.1.1/PKG-INFO +314 -0
  2. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/README.md +69 -47
  3. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/setup.cfg +2 -1
  4. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/__init__.py +1 -1
  5. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/arguments.py +3 -12
  6. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/execution_items.py +19 -7
  7. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/pabot.py +127 -82
  8. robotframework_pabot-4.1.1/src/robotframework_pabot.egg-info/PKG-INFO +314 -0
  9. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/robotframework_pabot.egg-info/SOURCES.txt +2 -0
  10. robotframework_pabot-4.1.1/tests/test_basic_arguments.py +62 -0
  11. robotframework_pabot-4.1.1/tests/test_depends.py +219 -0
  12. robotframework_pabot-4.1.1/tests/test_pabotprerunmodifier.py +244 -0
  13. robotframework_pabot-4.0.6/PKG-INFO +0 -24
  14. robotframework_pabot-4.0.6/src/robotframework_pabot.egg-info/PKG-INFO +0 -24
  15. robotframework_pabot-4.0.6/tests/test_depends.py +0 -145
  16. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/LICENSE.txt +0 -0
  17. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/MANIFEST.in +0 -0
  18. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/pyproject.toml +0 -0
  19. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/setup.py +0 -0
  20. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/SharedLibrary.py +0 -0
  21. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/clientwrapper.py +0 -0
  22. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/coordinatorwrapper.py +0 -0
  23. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/pabotlib.py +0 -0
  24. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/py3/__init__.py +0 -0
  25. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/py3/client.py +0 -0
  26. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/py3/coordinator.py +0 -0
  27. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/py3/messages.py +0 -0
  28. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/py3/worker.py +0 -0
  29. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/result_merger.py +0 -0
  30. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/robotremoteserver.py +0 -0
  31. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/pabot/workerwrapper.py +0 -0
  32. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/robotframework_pabot.egg-info/dependency_links.txt +0 -0
  33. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/robotframework_pabot.egg-info/entry_points.txt +0 -0
  34. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/robotframework_pabot.egg-info/requires.txt +0 -0
  35. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/src/robotframework_pabot.egg-info/top_level.txt +0 -0
  36. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_arguments_output.py +0 -0
  37. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_functional.py +0 -0
  38. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_ordering.py +0 -0
  39. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_pabot.py +0 -0
  40. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_pabotlib.py +0 -0
  41. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_pabotsuitenames_io.py +0 -0
  42. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_prerunmodifier.py +0 -0
  43. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_resultmerger.py +0 -0
  44. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_stacktrace.py +0 -0
  45. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_testlevelsplit_include.py +0 -0
  46. {robotframework_pabot-4.0.6 → robotframework_pabot-4.1.1}/tests/test_testlevelsplit_output_task_order.py +0 -0
@@ -0,0 +1,314 @@
1
+ Metadata-Version: 2.2
2
+ Name: robotframework-pabot
3
+ Version: 4.1.1
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
+
26
+ # Pabot
27
+
28
+ [中文版](README_zh.md)
29
+
30
+ [![Version](https://img.shields.io/pypi/v/robotframework-pabot.svg)](https://pypi.python.org/pypi/robotframework-pabot)
31
+ [![Downloads](http://pepy.tech/badge/robotframework-pabot)](http://pepy.tech/project/robotframework-pabot)
32
+
33
+ <img src="https://raw.githubusercontent.com/mkorpela/pabot/master/pabot.png" width="100">
34
+
35
+ ----
36
+
37
+ 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.
38
+
39
+ [![Pabot presentation at robocon.io 2018](http://img.youtube.com/vi/i0RV6SJSIn8/0.jpg)](https://youtu.be/i0RV6SJSIn8 "Pabot presentation at robocon.io 2018")
40
+
41
+ ## Installation:
42
+
43
+ From PyPi:
44
+
45
+ pip install -U robotframework-pabot
46
+
47
+ OR clone this repository and run:
48
+
49
+ setup.py install
50
+
51
+ OR clone this repository and run:
52
+
53
+ pip install --editable .
54
+
55
+ ## Basic use
56
+
57
+ Split execution to suite files.
58
+
59
+ pabot [path to tests]
60
+
61
+ Split execution on test level.
62
+
63
+ pabot --testlevelsplit [path to tests]
64
+
65
+ Run same tests with two different configurations.
66
+
67
+ pabot --argumentfile1 first.args --argumentfile2 second.args [path to tests]
68
+
69
+ For more complex cases please read onward.
70
+
71
+ ## Contact
72
+
73
+ Join [Pabot Slack channel](https://robotframework.slack.com/messages/C7HKR2L6L) in Robot Framework slack.
74
+ [Get invite to Robot Framework slack](https://robotframework-slack-invite.herokuapp.com/).
75
+
76
+
77
+ ## Contributing to the project
78
+
79
+ There are several ways you can help in improving this tool:
80
+
81
+ - Report an issue or an improvement idea to the [issue tracker](https://github.com/mkorpela/pabot/issues)
82
+ - Contribute by programming and making a pull request (easiest way is to work on an issue from the issue tracker)
83
+
84
+ ## Command-line options
85
+ <!-- START DOCSTRING -->
86
+ pabot [--verbose|--testlevelsplit|--command .. --end-command|
87
+ --processes num|--no-pabotlib|--pabotlibhost host|--pabotlibport port|
88
+ --processtimeout num|
89
+ --shard i/n|
90
+ --artifacts extensions|--artifactsinsubfolders|
91
+ --resourcefile file|--argumentfile[num] file|--suitesfrom file|--ordering file
92
+ --chunk
93
+ --pabotprerunmodifier modifier
94
+ --help|--version]
95
+ [robot options] [path ...]
96
+
97
+ PabotLib remote server is started by default to enable locking and resource distribution between parallel test executions.
98
+
99
+ Supports all [Robot Framework command line options](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#all-command-line-options) and also following pabot options:
100
+
101
+ --verbose
102
+ More output from the parallel execution.
103
+
104
+ --testlevelsplit
105
+ Split execution on test level instead of default suite level. If .pabotsuitenames contains both tests and suites then
106
+ this will only affect new suites and split only them. Leaving this flag out when both suites and tests in
107
+ .pabotsuitenames file will also only affect new suites and add them as suite files.
108
+
109
+ --command [ACTUAL COMMANDS TO START ROBOT EXECUTOR] --end-command
110
+ RF script for situations where robot is not used directly.
111
+
112
+ --processes [NUMBER OF PROCESSES]
113
+ How many parallel executors to use (default max of 2 and cpu count). Special option "all" will use as many processes as
114
+ there are executable suites or tests.
115
+
116
+ --no-pabotlib
117
+ Disable the PabotLib remote server if you don't need locking or resource distribution features.
118
+
119
+ --pabotlibhost [HOSTNAME]
120
+ Connect to an already running instance of the PabotLib remote server at the given host (disables the local PabotLib
121
+ server start). For example, to connect to a remote PabotLib server running on another machine:
122
+
123
+ pabot --pabotlibhost 192.168.1.123 --pabotlibport 8271 tests/
124
+
125
+ The remote server can be also started and executed separately from pabot instances:
126
+
127
+ python -m pabot.pabotlib <path_to_resourcefile> <host> <port>
128
+ python -m pabot.pabotlib resource.txt 192.168.1.123 8271
129
+
130
+ This enables sharing a resource with multiple Robot Framework instances.
131
+
132
+ --pabotlibport [PORT]
133
+ Port number of the PabotLib remote server (default is 8270). See --pabotlibhost for more information.
134
+
135
+ --processtimeout [TIMEOUT]
136
+ Maximum time in seconds to wait for a process before killing it. If not set, there's no timeout.
137
+
138
+ --shard [INDEX]/[TOTAL]
139
+ Optionally split execution into smaller pieces. This can be used for distributing testing to multiple machines.
140
+
141
+ --artifacts [FILE EXTENSIONS]
142
+ List of file extensions (comma separated). Defines which files (screenshots, videos etc.) from separate reporting
143
+ directories would be copied and included in a final report. Possible links to copied files in RF log would be updated
144
+ (only relative paths supported). The default value is `png`.
145
+
146
+ Examples:
147
+
148
+ --artifacts png,mp4,txt
149
+
150
+ --artifactsinsubfolders
151
+ Copy artifacts located not only directly in the RF output dir, but also in it's sub-folders.
152
+
153
+ --resourcefile [FILEPATH]
154
+ Indicator for a file that can contain shared variables for distributing resources. This needs to be used together with
155
+ pabotlib option. Resource file syntax is same as Windows ini files. Where a section is a shared set of variables.
156
+
157
+ --argumentfile [INTEGER] [FILEPATH]
158
+ Run same suites with multiple [argumentfile](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#argument-files) options.
159
+
160
+ For example:
161
+
162
+ --argumentfile1 arg1.txt --argumentfile2 arg2.txt
163
+
164
+ --suitesfrom [FILEPATH TO OUTPUTXML]
165
+ Optionally read suites from output.xml file. Failed suites will run first and longer running ones will be executed
166
+ before shorter ones.
167
+
168
+ --ordering [FILE PATH]
169
+ Optionally give execution order from a file.
170
+
171
+ --chunk
172
+ Optionally chunk tests to PROCESSES number of robot runs. This can save time because all the suites will share the same
173
+ setups and teardowns.
174
+
175
+ --pabotprerunmodifier [PRERUNMODIFIER MODULE OR CLASS]
176
+ Like Robot Framework's --prerunmodifier, but executed only once in the pabot's main process after all other
177
+ --prerunmodifiers. But unlike the regular --prerunmodifier command, --pabotprerunmodifier is not executed again in each
178
+ pabot subprocesses. Depending on the intended use, this may be desirable as well as more efficient. Can be used, for
179
+ example, to modify the list of tests to be performed.
180
+
181
+ --help
182
+ Print usage instructions.
183
+
184
+ --version
185
+ Print version information.
186
+
187
+ Example usages:
188
+
189
+ pabot test_directory
190
+ pabot --exclude FOO directory_to_tests
191
+ pabot --command java -jar robotframework.jar --end-command --include SMOKE tests
192
+ pabot --processes 10 tests
193
+ pabot --pabotlibhost 192.168.1.123 --pabotlibport 8271 --processes 10 tests
194
+ pabot --artifacts png,mp4,txt --artifactsinsubfolders directory_to_tests
195
+ # To disable PabotLib:
196
+ pabot --no-pabotlib tests
197
+
198
+ <!-- END DOCSTRING -->
199
+ ### PabotLib
200
+
201
+ pabot.PabotLib provides keywords that will help communication and data sharing between the executor processes.
202
+ 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.
203
+
204
+ PabotLib Docs are located at https://pabot.org/PabotLib.html.
205
+
206
+ ### PabotLib example:
207
+
208
+ test.robot
209
+
210
+ *** Settings ***
211
+ Library pabot.PabotLib
212
+
213
+ *** Test Case ***
214
+ Testing PabotLib
215
+ Acquire Lock MyLock
216
+ Log This part is critical section
217
+ Release Lock MyLock
218
+ ${valuesetname}= Acquire Value Set admin-server
219
+ ${host}= Get Value From Set host
220
+ ${username}= Get Value From Set username
221
+ ${password}= Get Value From Set password
222
+ Log Do something with the values (for example access host with username and password)
223
+ Release Value Set
224
+ Log After value set release others can obtain the variable values
225
+
226
+ valueset.dat
227
+
228
+ [Server1]
229
+ tags=admin-server
230
+ HOST=123.123.123.123
231
+ USERNAME=user1
232
+ PASSWORD=password1
233
+
234
+ [Server2]
235
+ tags=server
236
+ HOST=121.121.121.121
237
+ USERNAME=user2
238
+ PASSWORD=password2
239
+
240
+ [Server3]
241
+ tags=admin-server
242
+ HOST=222.222.222.222
243
+ USERNAME=user3
244
+ PASSWORD=password4
245
+
246
+
247
+ pabot call using resources from valueset.dat
248
+
249
+ pabot --pabotlib --resourcefile valueset.dat test.robot
250
+
251
+ ### Controlling execution order and level of parallelism
252
+
253
+ .pabotsuitenames file contains the list of suites that will be executed.
254
+ File is created during pabot execution if not already there.
255
+ The file is a cache that pabot uses when re-executing same tests to speed up processing.
256
+ This file can be partially manually edited but easier option is to use ```--ordering FILENAME```.
257
+ First 4 rows contain information that should not be edited - pabot will edit these when something changes.
258
+ After this come the suite names.
259
+
260
+ 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.
261
+
262
+ There different possibilities to influence the execution:
263
+
264
+ * The order of suites can be changed.
265
+ * If a directory (or a directory structure) should be executed sequentially, add the directory suite name to a row as a ```--suite``` option.
266
+ * 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.
267
+ * You can add a line with text `#WAIT` to force executor to wait until all previous suites have been executed.
268
+ * You can group suites and tests together to same executor process by adding line `{` before the group and `}`after.
269
+ * 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.
270
+
271
+ ```
272
+ --test robotTest.1 Scalar.Test With Environment Variables #DEPENDS robotTest.1 Scalar.Test with BuiltIn Variables of Robot Framework
273
+ --test robotTest.1 Scalar.Test with BuiltIn Variables of Robot Framework
274
+ --test robotTest.2 Lists.Test with Keywords and a list
275
+ #WAIT
276
+ --test robotTest.2 Lists.Test with a Keyword that accepts multiple arguments
277
+ --test robotTest.2 Lists.Test with some Collections keywords
278
+ --test robotTest.2 Lists.Test to access list entries
279
+ --test robotTest.3 Dictionary.Test that accesses Dictionaries
280
+ --test robotTest.3 Dictionary.Dictionaries for named arguments #DEPENDS robotTest.3 Dictionary.Test that accesses Dictionaries
281
+ --test robotTest.1 Scalar.Test Case With Variables #DEPENDS robotTest.3 Dictionary.Test that accesses Dictionaries
282
+ --test robotTest.1 Scalar.Test with Numbers #DEPENDS robotTest.1 Scalar.Test With Arguments and Return Values
283
+ --test robotTest.1 Scalar.Test Case with Return Values #DEPENDS robotTest.1 Scalar.Test with Numbers
284
+ --test robotTest.1 Scalar.Test With Arguments and Return Values
285
+ --test robotTest.3 Dictionary.Test with Dictionaries as Arguments
286
+ --test robotTest.3 Dictionary.Test with FOR loops and Dictionaries #DEPENDS robotTest.1 Scalar.Test Case with Return Values
287
+ ```
288
+
289
+ ### Programmatic use
290
+
291
+ Library offers an endpoint `main_program` that will not call `sys.exit`. This can help in developing your own python program around pabot.
292
+
293
+ ```Python
294
+ import sys
295
+ from pabot.pabot import main_program
296
+
297
+ def amazing_new_program():
298
+ print("Before calling pabot")
299
+ exit_code = main_program(['tests'])
300
+ print(f"After calling pabot (return code {exit_code})")
301
+ sys.exit(exit_code)
302
+
303
+ ```
304
+
305
+ ### Global variables
306
+
307
+ 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.
308
+
309
+ PABOTQUEUEINDEX - this contains a unique index number for the execution. Indexes start from 0.
310
+ PABOTLIBURI - this contains the URI for the running PabotLib server
311
+ 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.
312
+ PABOTNUMBEROFPROCESSES - max number of concurrent processes that pabot may use in execution.
313
+ CALLER_ID - a universally unique identifier for this execution.
314
+
@@ -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.
@@ -53,45 +57,46 @@ There are several ways you can help in improving this tool:
53
57
  - Contribute by programming and making a pull request (easiest way is to work on an issue from the issue tracker)
54
58
 
55
59
  ## Command-line options
56
-
57
- pabot [--verbose|--testlevelsplit|--command .. --end-command|
58
- --processes num|--no-pabotlib|--pabotlibhost host|--pabotlibport port|
59
- --processtimeout num|
60
- --shard i/n|
61
- --artifacts extensions|--artifactsinsubfolders|
62
- --resourcefile file|--argumentfile[num] file|--suitesfrom file]
63
- [robot options] [path ...]
60
+ <!-- START DOCSTRING -->
61
+ pabot [--verbose|--testlevelsplit|--command .. --end-command|
62
+ --processes num|--no-pabotlib|--pabotlibhost host|--pabotlibport port|
63
+ --processtimeout num|
64
+ --shard i/n|
65
+ --artifacts extensions|--artifactsinsubfolders|
66
+ --resourcefile file|--argumentfile[num] file|--suitesfrom file|--ordering file
67
+ --chunk
68
+ --pabotprerunmodifier modifier
69
+ --help|--version]
70
+ [robot options] [path ...]
71
+
72
+ PabotLib remote server is started by default to enable locking and resource distribution between parallel test executions.
64
73
 
65
74
  Supports all [Robot Framework command line options](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#all-command-line-options) and also following pabot options:
66
75
 
67
76
  --verbose
68
- more output from the parallel execution
77
+ More output from the parallel execution.
69
78
 
70
79
  --testlevelsplit
71
- Split execution on test level instead of default suite level.
72
- If .pabotsuitenames contains both tests and suites then this
73
- will only affect new suites and split only them.
74
- Leaving this flag out when both suites and tests in
75
- .pabotsuitenames file will also only affect new suites and
76
- add them as suite files.
80
+ Split execution on test level instead of default suite level. If .pabotsuitenames contains both tests and suites then
81
+ this will only affect new suites and split only them. Leaving this flag out when both suites and tests in
82
+ .pabotsuitenames file will also only affect new suites and add them as suite files.
77
83
 
78
84
  --command [ACTUAL COMMANDS TO START ROBOT EXECUTOR] --end-command
79
- RF script for situations where robot is not used directly
85
+ RF script for situations where robot is not used directly.
80
86
 
81
- --processes [NUMBER OF PROCESSES]
82
- How many parallel executors to use (default max of 2 and cpu count).
83
- Special option "all" will use as many processes as there are
84
- executable suites or tests.
87
+ --processes [NUMBER OF PROCESSES]
88
+ How many parallel executors to use (default max of 2 and cpu count). Special option "all" will use as many processes as
89
+ there are executable suites or tests.
85
90
 
86
- PabotLib remote server is started by default to enable locking and resource distribution
87
- between parallel test executions.
88
-
89
- --no-pabotlib
91
+ --no-pabotlib
90
92
  Disable the PabotLib remote server if you don't need locking or resource distribution features.
91
93
 
92
- --pabotlibhost [HOSTNAME]
93
- Connect to an already running instance of the PabotLib remote server at the given host
94
- (disables the local PabotLib server start).
94
+ --pabotlibhost [HOSTNAME]
95
+ Connect to an already running instance of the PabotLib remote server at the given host (disables the local PabotLib
96
+ server start). For example, to connect to a remote PabotLib server running on another machine:
97
+
98
+ pabot --pabotlibhost 192.168.1.123 --pabotlibport 8271 tests/
99
+
95
100
  The remote server can be also started and executed separately from pabot instances:
96
101
 
97
102
  python -m pabot.pabotlib <path_to_resourcefile> <host> <port>
@@ -99,21 +104,20 @@ between parallel test executions.
99
104
 
100
105
  This enables sharing a resource with multiple Robot Framework instances.
101
106
 
102
- --pabotlibport [PORT]
103
- Port number of the PabotLib remote server (default is 8270)
104
- See --pabotlibhost for more information
107
+ --pabotlibport [PORT]
108
+ Port number of the PabotLib remote server (default is 8270). See --pabotlibhost for more information.
105
109
 
106
- --processtimeout [TIMEOUT]
110
+ --processtimeout [TIMEOUT]
107
111
  Maximum time in seconds to wait for a process before killing it. If not set, there's no timeout.
108
112
 
109
- --resourcefile [FILEPATH]
110
- Indicator for a file that can contain shared variables for distributing resources. This needs to be used together with pabotlib option. Resource file syntax is same as Windows ini files. Where a section is a shared set of variables.
113
+ --shard [INDEX]/[TOTAL]
114
+ Optionally split execution into smaller pieces. This can be used for distributing testing to multiple machines.
111
115
 
112
116
  --artifacts [FILE EXTENSIONS]
113
- List of file extensions (comma separated).
114
- Defines which files (screenshots, videos etc.) from separate reporting directories would be copied and included in a final report.
115
- Possible links to copied files in RF log would be updated (only relative paths supported).
116
- The default value is `png`.
117
+ List of file extensions (comma separated). Defines which files (screenshots, videos etc.) from separate reporting
118
+ directories would be copied and included in a final report. Possible links to copied files in RF log would be updated
119
+ (only relative paths supported). The default value is `png`.
120
+
117
121
  Examples:
118
122
 
119
123
  --artifacts png,mp4,txt
@@ -121,22 +125,39 @@ between parallel test executions.
121
125
  --artifactsinsubfolders
122
126
  Copy artifacts located not only directly in the RF output dir, but also in it's sub-folders.
123
127
 
124
- --argumentfile[INTEGER] [FILEPATH]
128
+ --resourcefile [FILEPATH]
129
+ Indicator for a file that can contain shared variables for distributing resources. This needs to be used together with
130
+ pabotlib option. Resource file syntax is same as Windows ini files. Where a section is a shared set of variables.
131
+
132
+ --argumentfile [INTEGER] [FILEPATH]
125
133
  Run same suites with multiple [argumentfile](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#argument-files) options.
134
+
126
135
  For example:
127
136
 
128
137
  --argumentfile1 arg1.txt --argumentfile2 arg2.txt
129
138
 
130
- --suitesfrom [FILEPATH TO OUTPUTXML]
131
- Optionally read suites from output.xml file. Failed suites will run
132
- first and longer running ones will be executed before shorter ones.
139
+ --suitesfrom [FILEPATH TO OUTPUTXML]
140
+ Optionally read suites from output.xml file. Failed suites will run first and longer running ones will be executed
141
+ before shorter ones.
133
142
 
134
- --shard [INDEX]/[TOTAL]
135
- Optionally split execution into smaller pieces. This can
136
- be used for distributing testing to multiple machines.
143
+ --ordering [FILE PATH]
144
+ Optionally give execution order from a file.
137
145
 
138
- --chunk
139
- Optionally chunk tests to PROCESSES number of robot runs. This can save time because all the suites will share the same setups and teardowns.
146
+ --chunk
147
+ Optionally chunk tests to PROCESSES number of robot runs. This can save time because all the suites will share the same
148
+ setups and teardowns.
149
+
150
+ --pabotprerunmodifier [PRERUNMODIFIER MODULE OR CLASS]
151
+ Like Robot Framework's --prerunmodifier, but executed only once in the pabot's main process after all other
152
+ --prerunmodifiers. But unlike the regular --prerunmodifier command, --pabotprerunmodifier is not executed again in each
153
+ pabot subprocesses. Depending on the intended use, this may be desirable as well as more efficient. Can be used, for
154
+ example, to modify the list of tests to be performed.
155
+
156
+ --help
157
+ Print usage instructions.
158
+
159
+ --version
160
+ Print version information.
140
161
 
141
162
  Example usages:
142
163
 
@@ -149,6 +170,7 @@ Example usages:
149
170
  # To disable PabotLib:
150
171
  pabot --no-pabotlib tests
151
172
 
173
+ <!-- END DOCSTRING -->
152
174
  ### PabotLib
153
175
 
154
176
  pabot.PabotLib provides keywords that will help communication and data sharing between the executor processes.
@@ -219,7 +241,7 @@ There different possibilities to influence the execution:
219
241
  * 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.
220
242
  * You can add a line with text `#WAIT` to force executor to wait until all previous suites have been executed.
221
243
  * You can group suites and tests together to same executor process by adding line `{` before the group and `}`after.
222
- * You can introduce dependencies using the word `#DEPENDS` after a test declaration. Please take care that in case of circular dependencies an exception will be thrown. An example could be.
244
+ * 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.
223
245
 
224
246
  ```
225
247
  --test robotTest.1 Scalar.Test With Environment Variables #DEPENDS robotTest.1 Scalar.Test with BuiltIn Variables of Robot Framework
@@ -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 = A parallel executor for Robot Framework tests. With Pabot you can split one execution into multiple and save test execution time.
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
@@ -2,4 +2,4 @@ from __future__ import absolute_import
2
2
 
3
3
  from .pabotlib import PabotLib
4
4
 
5
- __version__ = "4.0.6"
5
+ __version__ = "4.1.1"
@@ -79,6 +79,7 @@ def _parse_pabot_args(args): # type: (List[str]) -> Tuple[List[str], Dict[str,
79
79
  "command": ["pybot" if ROBOT_VERSION < "3.1" else "robot"],
80
80
  "verbose": False,
81
81
  "help": False,
82
+ "version": False,
82
83
  "testlevelsplit": False,
83
84
  "pabotlib": True,
84
85
  "pabotlibhost": "127.0.0.1",
@@ -106,8 +107,9 @@ def _parse_pabot_args(args): # type: (List[str]) -> Tuple[List[str], Dict[str,
106
107
  "resourcefile": str,
107
108
  "pabotlibhost": str,
108
109
  "pabotlibport": int,
110
+ "pabotprerunmodifier": str,
109
111
  "processtimeout": int,
110
- "ordering": _parse_ordering,
112
+ "ordering": str,
111
113
  "suitesfrom": str,
112
114
  "artifacts": lambda x: x.split(","),
113
115
  "shard": _parse_shard,
@@ -195,17 +197,6 @@ def _parse_pabot_args(args): # type: (List[str]) -> Tuple[List[str], Dict[str,
195
197
  return remaining_args, pabot_args
196
198
 
197
199
 
198
- def _parse_ordering(filename): # type: (str) -> List[ExecutionItem]
199
- try:
200
- with open(filename, "r") as orderingfile:
201
- return [
202
- parse_execution_item_line(line.strip())
203
- for line in orderingfile.readlines()
204
- ]
205
- except:
206
- raise DataError("Error parsing ordering file '%s'" % filename)
207
-
208
-
209
200
  def _delete_none_keys(d): # type: (Dict[str, Optional[object]]) -> Dict[str, object]
210
201
  keys = set()
211
202
  for k in d:
@@ -5,6 +5,7 @@ from robot import __version__ as ROBOT_VERSION
5
5
  from robot.errors import DataError
6
6
  from robot.utils import PY2, is_unicode
7
7
 
8
+ import re
8
9
 
9
10
  @total_ordering
10
11
  class ExecutionItem(object):
@@ -97,20 +98,31 @@ class GroupItem(ExecutionItem):
97
98
  class RunnableItem(ExecutionItem):
98
99
  pass
99
100
 
100
- depends = None # type: str
101
+ depends = None # type: List[str]
101
102
  depends_keyword = "#DEPENDS"
102
103
 
104
+ def _split_dependencies(self, line_name, depends_indexes):
105
+ depends_lst = [] if len(depends_indexes) < 2 else [line_name[i + len(self.depends_keyword) : j].strip() for i, j in zip(depends_indexes, depends_indexes[1:])]
106
+ depends_lst.append(line_name[depends_indexes[-1] + len(self.depends_keyword) : ].strip())
107
+ return depends_lst
108
+
109
+ def _merge_dependencies(self, line_start):
110
+ output_line = line_start
111
+ for d in self.depends:
112
+ output_line = output_line + " " + self.depends_keyword + " " + d
113
+ return output_line
114
+
103
115
  def set_name_and_depends(self, name):
104
116
  line_name = name.encode("utf-8") if PY2 and is_unicode(name) else name
105
- depends_begin_index = line_name.find(self.depends_keyword)
117
+ depends_indexes = [d.start() for d in re.finditer(self.depends_keyword, line_name)]
106
118
  self.name = (
107
119
  line_name
108
- if depends_begin_index == -1
109
- else line_name[0:depends_begin_index].strip()
120
+ if len(depends_indexes) == 0
121
+ else line_name[0:depends_indexes[0]].strip()
110
122
  )
111
123
  self.depends = (
112
- line_name[depends_begin_index + len(self.depends_keyword) :].strip()
113
- if depends_begin_index != -1
124
+ self._split_dependencies(line_name, depends_indexes)
125
+ if len(depends_indexes) != 0
114
126
  else None
115
127
  )
116
128
 
@@ -118,7 +130,7 @@ class RunnableItem(ExecutionItem):
118
130
  # type: () -> str
119
131
  line_without_depends = "--" + self.type + " " + self.name
120
132
  return (
121
- line_without_depends + " " + self.depends_keyword + " " + self.depends
133
+ self._merge_dependencies(line_without_depends)
122
134
  if self.depends
123
135
  else line_without_depends
124
136
  )