Giter Club home page Giter Club logo

pabot's Introduction

Pabot

Русская версия 中文版

Version Downloads


A parallel executor for Robot Framework tests. With Pabot you can split one execution into multiple and save test execution time.

Pabot presentation at robocon.io 2018

Installation:

From PyPi:

 pip install -U robotframework-pabot

OR clone this repository and run:

 setup.py  install

Basic use

Split execution to suite files.

 pabot [path to tests]

Split execution on test level.

 pabot --testlevelsplit [path to tests]

Run same tests with two different configurations.

 pabot --argumentfile1 first.args --argumentfile2 second.args [path to tests]

For more complex cases please read onward.

Contact

Join Pabot Slack channel in Robot Framework slack. Get invite to Robot Framework slack.

Contributing to the project

There are several ways you can help in improving this tool:

  • Report an issue or an improvement idea to the issue tracker
  • Contribute by programming and making a pull request (easiest way is to work on an issue from the issue tracker)

Command-line options

pabot [--verbose|--testlevelsplit|--command .. --end-command|
       --processes num|--pabotlib|--pabotlibhost host|--pabotlibport port|
       --processtimeout num|
       --shard i/n|
       --artifacts extensions|--artifactsinsubfolders|
       --resourcefile file|--argumentfile[num] file|--suitesfrom file] 
      [robot options] [path ...]

Supports all Robot Framework command line options and also following options (these must be before RF options):

--verbose
more output from the parallel execution

--testlevelsplit
Split execution on test level instead of default suite level. If .pabotsuitenames contains both tests and suites then this will only affect new suites and split only them. Leaving this flag out when both suites and tests in .pabotsuitenames file will also only affect new suites and add them as suite files.

--command [ACTUAL COMMANDS TO START ROBOT EXECUTOR] --end-command
RF script for situations where robot is not used directly

--processes [NUMBER OF PROCESSES]
How many parallel executors to use (default max of 2 and cpu count). Special option "all" will use as many processes as there are executable suites or tests.

--pabotlib
Start PabotLib remote server. This enables locking and resource distribution between parallel test executions.

--pabotlibhost [HOSTNAME]
Host name of the PabotLib remote server (default is 127.0.0.1) If used with --pabotlib option, will change the host listen address of the created remote server (see https://github.com/robotframework/PythonRemoteServer) If used without the --pabotlib option, will connect to already running instance of the PabotLib remote server in the given host. The remote server can be also started and executed separately from pabot instances:

  python -m pabot.pabotlib <path_to_resourcefile> <host> <port>
  python -m pabot.pabotlib resource.txt 192.168.1.123 8271

This enables sharing a resource with multiple Robot Framework instances.

--pabotlibport [PORT]
Port number of the PabotLib remote server (default is 8270) See --pabotlibhost for more information

--processtimeout [TIMEOUT]
Maximum time in seconds to wait for a process before killing it. If not set, there's no timeout.

--resourcefile [FILEPATH]
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.

--artifacts [FILE EXTENSIONS]
List of file extensions (comma separated).
Defines which files (screenshots, videos etc.) from separate reporting directories would be copied and included in a final report.
Possible links to copied files in RF log would be updated (only relative paths supported).
The default value is png.
Examples:

 --artifacts png,mp4,txt

--artifactsinsubfolders
Copy artifacts located not only directly in the RF output dir, but also in it's sub-folders.

--argumentfile[INTEGER] [FILEPATH]
Run same suites with multiple argumentfile options. For example:

 --argumentfile1 arg1.txt --argumentfile2 arg2.txt

--suitesfrom [FILEPATH TO OUTPUTXML]
Optionally read suites from output.xml file. Failed suites will run first and longer running ones will be executed before shorter ones.

--shard [INDEX]/[TOTAL] Optionally split execution into smaller pieces. This can be used for distributing testing to multiple machines.

--chunk Optionally chunk tests to PROCESSES number of robot runs. This can save time because all the suites will share the same setups and teardowns.

Example usages:

 pabot test_directory
 pabot --exclude FOO directory_to_tests
 pabot --command java -jar robotframework.jar --end-command --include SMOKE tests
 pabot --processes 10 tests     
 pabot --pabotlibhost 192.168.1.123 --pabotlibport 8271 --processes 10 tests
 pabot --pabotlib --pabotlibhost 192.168.1.111 --pabotlibport 8272 --processes 10 tests
 pabot --artifacts png,mp4,txt --artifactsinsubfolders directory_to_tests

PabotLib

pabot.PabotLib provides keywords that will help communication and data sharing between the executor processes. 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.

PabotLib Docs are located at https://pabot.org/PabotLib.html.

PabotLib example:

test.robot

  *** Settings ***
  Library    pabot.PabotLib
  
  *** Test Case ***
  Testing PabotLib
    Acquire Lock   MyLock
    Log   This part is critical section
    Release Lock   MyLock
    ${valuesetname}=    Acquire Value Set  admin-server
    ${host}=   Get Value From Set   host
    ${username}=     Get Value From Set   username
    ${password}=     Get Value From Set   password
    Log   Do something with the values (for example access host with username and password)
    Release Value Set
    Log   After value set release others can obtain the variable values

valueset.dat

  [Server1]
  tags=admin-server
  HOST=123.123.123.123
  USERNAME=user1
  PASSWORD=password1
  
  [Server2]
  tags=server
  HOST=121.121.121.121
  USERNAME=user2
  PASSWORD=password2

  [Server3]
  tags=admin-server
  HOST=222.222.222.222
  USERNAME=user3
  PASSWORD=password4

pabot call using resources from valueset.dat

  pabot --pabotlib --resourcefile valueset.dat test.robot

Controlling execution order and level of parallelism

.pabotsuitenames file contains the list of suites that will be executed. File is created during pabot execution if not already there. The file is a cache that pabot uses when re-executing same tests to speed up processing. This file can be partially manually edited but easier option is to use --ordering FILENAME. First 4 rows contain information that should not be edited - pabot will edit these when something changes. After this come the suite names.

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.

There different possibilities to influence the execution:

  • The order of suites can be changed.
  • If a directory (or a directory structure) should be executed sequentially, add the directory suite name to a row as a --suite option.
  • If the base suite name is changing with robot option --name / -N you can also give partial suite name without the base suite.
  • You can add a line with text #WAIT to force executor to wait until all previous suites have been executed.
  • You can group suites and tests together to same executor process by adding line { before the group and }after.
  • 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.
--test robotTest.1 Scalar.Test With Environment Variables #DEPENDS robotTest.1 Scalar.Test with BuiltIn Variables of Robot Framework
--test robotTest.1 Scalar.Test with BuiltIn Variables of Robot Framework
--test robotTest.2 Lists.Test with Keywords and a list
#WAIT
--test robotTest.2 Lists.Test with a Keyword that accepts multiple arguments
--test robotTest.2 Lists.Test with some Collections keywords
--test robotTest.2 Lists.Test to access list entries
--test robotTest.3 Dictionary.Test that accesses Dictionaries
--test robotTest.3 Dictionary.Dictionaries for named arguments #DEPENDS robotTest.3 Dictionary.Test that accesses Dictionaries
--test robotTest.1 Scalar.Test Case With Variables #DEPENDS robotTest.3 Dictionary.Test that accesses Dictionaries
--test robotTest.1 Scalar.Test with Numbers #DEPENDS robotTest.1 Scalar.Test With Arguments and Return Values
--test robotTest.1 Scalar.Test Case with Return Values #DEPENDS robotTest.1 Scalar.Test with Numbers
--test robotTest.1 Scalar.Test With Arguments and Return Values
--test robotTest.3 Dictionary.Test with Dictionaries as Arguments
--test robotTest.3 Dictionary.Test with FOR loops and Dictionaries #DEPENDS robotTest.1 Scalar.Test Case with Return Values

Programmatic use

Library offers an endpoint main_program that will not call sys.exit. This can help in developing your own python program around pabot.

import sys
from pabot.pabot import main_program

def amazing_new_program():
    print("Before calling pabot")
    exit_code = main_program(['tests'])
    print(f"After calling pabot (return code {exit_code})")
    sys.exit(exit_code)

Global variables

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.

  PABOTQUEUEINDEX - this contains a unique index number for the execution. Indexes start from 0.
  PABOTLIBURI - this contains the URI for the running PabotLib server
  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.
  PABOTNUMBEROFPROCESSES - max number of concurrent processes that pabot may use in execution.
  CALLER_ID - a universally unique identifier for this execution.

pabot's People

Contributors

aaltat avatar aleskarovadi avatar allblackt avatar amochin avatar bollwyvl avatar chenrui333 avatar codci avatar coxx avatar dirkrichter avatar hicycle avatar hirsivaja avatar jimni avatar karrukola avatar krizm avatar massukio avatar medic8601 avatar mhagen-vmware avatar mkorpela avatar molsky avatar oboehmer avatar ombre42 avatar patos98 avatar pyup-bot avatar reubenmiller avatar tbnhan avatar tmarenko avatar vmaillol-altair avatar vmaksymiv avatar webjunkie avatar xylix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pabot's Issues

Pictures doesn't show up in report and log files

In OSX when final report and log files are generated the log file has wrong file paths for pictures that RF has taken (or the pictures are not moved to right place with correct name). At the moment pictures are stored in pabot_results folder in own folders (in my case each test case has it's own subfolder inside pabot_results folder) and there pictures are named selenium-screenshot-1...n.png. In log.html file paths to pictures are referred to same directory where the html file is.

When `-d or --outputdir` not specified, pabot throws an error

When executing a robot test (e.g. pabot RobotTest.robot), the following error is generated:

Traceback (most recent call last):
  File "/usr/local/bin/pabot", line 6, in <module>
    main(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/pabot/pabot.py", line 337, in main
    sys.exit(_report_results(outs_dir, options, start_time_string))
  File "/usr/local/lib/python2.7/dist-packages/pabot/pabot.py", line 278, in _report_results
    _copy_screenshots(options)
  File "/usr/local/lib/python2.7/dist-packages/pabot/pabot.py", line 265, in _copy_screenshots
    outputdir = options['outputdir']
KeyError: 'outputdir'

Parsing massive test case file takes lot of time

We are auto generating robot framework testcase through some automation scripts the generated robot framework testcase size approximately 50 MB, while i used to

pabot --name "Conformance Tests" --doc --timestampoutputs --splitlog --outputdir olt_reports generated

It took around 30 minutes to analyse the testcase after that it started actual execution and completed in 4 minutes

The number of lines in testcase approximately 4,00,000

Is there any methods to find why it took so much time analyse the testcase?

If not are there any methods to solve this issue?

The same issue we raised at robot-framework robotframework/robotframework#2231

Pabot issues with running failed testcases.

HI @dmizverev,

Apologies for filling this new issue. I was unable to reopen the issue #10 so filling this one.

I solved the problem while re-running the failed testcases by using --name and --suite variables. However when I tried to merge the re-run result with first run result I am getting the same issue which you have mentioned in the issue #10 .

I observed output.xml from both runs and found that in first run has following line for suite name.

However in re-run adds one additional line:

I guess this is causing the problem. It would be great if you could have a look at it.

Thanks & Regards,
Sachin Nikam

Warning for missing resource file

If the resource file is not found in the code we just silently continue.
In pabotlib.py we could add some simple logging that the resource file cannot be found. This would make more sense when the 'resourcefile' is not None.

In my opinion if the resource file is not set to empty and is not found, we should throw an exception, but if this is not wanted a mere warning is enough.

Invalid syntax error when using pabot with Python 2.6.9

We've been successfully using pabot with 2.7.5, but recently we have a server which we can't upgrade and is using 2.6.9.

The following is the output:

Traceback (most recent call last):
File "/Users/ramses/od-tests/odvenv2.6/bin/pabot", line 3, in
from pabot.pabot import main
File "/Users/ramses/od-tests/odvenv2.6/lib/python2.6/site-packages/pabot/pabot.py", line 58
with open(os.path.join(outs_dir, 'stdout.txt'), 'w') as stdout,
^
SyntaxError: invalid syntax

Again, we've done some debugging and the same code works fine on 2.7.5.

screen shot 2015-03-04 at 10 59 51 am

Run long suites first

If small proportion of suites is big part of the execution time, this should have a very good performance gain.

Unable to re-run failed testcases

HI All,

Need help with this issue. I have made changes suggested by you but still facing the issue.

I have a test suite with name test. My pybot command is :

pybot --name "Test" --loglevel INFO --outputdir G:\workspace\output --output output.xml --log log.html --report report.html --reporttitle "Robot test" g:\workspace\test

g:\workspace\test is the path of my main suite.

pybot

This works fine.

pybot --name "Test" --loglevel INFO --outputdir G:\workspace\output --output output.xml --log log.html --report report.html --reporttitle "Robot test" g:\workspace\test

which gives me output as below

pabot

Under Statistics by Suite section, it adds Test.Test due to which if there is any failure in the suite I am unable to re-run those cases.

I got following error:

G:>pybot -R g:\workspace\output\output.xml g:\workspace\test
[ ERROR ] Suite 'Test' contains no tests named 'Test.Test.Main suite3.Child suite3.test'.

@dmizverev @mkorpela Can you please let me know what is wrong with my execution.

Thanks & Regards,
Sachin Nikam

Assert error when running pabot using variables.py with ;-separator

I noticed that when using --variablefile variables.py with ;-separator that quotes don't work the same way they work with pybot. When using either "- or '-quotes (i.e. "variables.py;arg1;arg2" or 'variables.py;arg1;arg2') pabot crashes with AssertError.

I have a simple test.robot:

(robot)# cat test.robot
*** TEST CASES ***
test0001
  Log To Console      ${TEST1}
  Log To Console      ${TEST2}

variables.py

(robot)# cat variables.py
def get_variables(arg1, arg2):
    variables = {   "TEST1": arg1,
                    "TEST2": arg2
                }
    return variables

my environment:

(robot)# python --version
Python 2.7.10
(robot)# pip list|grep robotframework
robotframework (2.9)
robotframework-pabot (0.16)

When I run the test with pybot:

(robot)# pybot --variablefile "variables.py;http://www.google.com;http://www.yahoo.com" test.robot
==============================================================================
Test
==============================================================================
test0001                                                              http://www.google.com
.http://www.yahoo.com
test0001                                                              | PASS |
------------------------------------------------------------------------------
Test                                                                  | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output:  /Users/jiuweigui/Examples/robot/output.xml
Log:     /Users/jiuweigui/Examples/robot/log.html
Report:  /Users/jiuweigui/Examples/robot/report.html

When I try to run the same thing with pabot:

(robot)# pabot --variablefile "variables.py;http://google.com;http://www.yahoo.com" test.robot
[PID:2310] EXECUTING Test
FAILED Test
Elapsed time: 0 minutes 0.454 seconds
Traceback (most recent call last):
  File "/Users/jiuweigui/.virtualenvs/robot/bin/pabot", line 6, in <module>
    main(sys.argv[1:])
  File "/Users/jiuweigui/.virtualenvs/robot/lib/python2.7/site-packages/pabot/pabot.py", line 354, in main
    sys.exit(_report_results(outs_dir, options, start_time_string, _get_suite_root_name(suite_names)))
  File "/Users/jiuweigui/.virtualenvs/robot/lib/python2.7/site-packages/pabot/pabot.py", line 286, in _report_results
    merge(sorted(glob(os.path.join(outs_dir, '**/*.xml'))), options, tests_root_name).save(output_path)
  File "/Users/jiuweigui/.virtualenvs/robot/lib/python2.7/site-packages/pabot/result_merger.py", line 116, in merge
    assert len(result_files) > 0
AssertionError
(robot)#

and 

(robot)# pabot --variablefile 'variables.py;http://google.com;http://www.yahoo.com' test.robot
[PID:2319] EXECUTING Test
FAILED Test
Elapsed time: 0 minutes 0.450 seconds
Traceback (most recent call last):
  File "/Users/jiuweigui/.virtualenvs/robot/bin/pabot", line 6, in <module>
    main(sys.argv[1:])
  File "/Users/jiuweigui/.virtualenvs/robot/lib/python2.7/site-packages/pabot/pabot.py", line 354, in main
    sys.exit(_report_results(outs_dir, options, start_time_string, _get_suite_root_name(suite_names)))
  File "/Users/jiuweigui/.virtualenvs/robot/lib/python2.7/site-packages/pabot/pabot.py", line 286, in _report_results
    merge(sorted(glob(os.path.join(outs_dir, '**/*.xml'))), options, tests_root_name).save(output_path)
  File "/Users/jiuweigui/.virtualenvs/robot/lib/python2.7/site-packages/pabot/result_merger.py", line 116, in merge
    assert len(result_files) > 0
AssertionError
(robot)#

However if I use both quotes everything passes and there's no assert:

(robot)# pabot --variablefile "'variables.py;http://google.com;http://www.yahoo.com'" test.robot
[PID:2328] EXECUTING Test
PASSED Test
Output:  /Users/jiuweigui/Examples/robot/output.xml
Log:     /Users/jiuweigui/Examples/robot/log.html
Report:  /Users/jiuweigui/Examples/robot/report.html
Elapsed time: 0 minutes 0.487 seconds
(robot)# cat pabot_results/Test/stdout.txt
==============================================================================
Test
==============================================================================
test0001                                                              http://google.com
http://www.yahoo.com
| PASS |
------------------------------------------------------------------------------
Test                                                                  | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output:  /Users/jiuweigui/Examples/robot/pabot_results/Test/output.xml
(robot)#

Based on the errors seen it looks like pabot interprets variables with ;-separator as shell commands and doesn't seem to honour quotes as pybot does. Using double and single quotes combined seems to solve the problem but is most likely not the intended way.

Pabot fails when using asterisk wildcard in file names

Asterisk wildcard works fine when there are only few test scripts that matches but in following case there were 12 files matching to given argument for files to include and result was Assertion Error.

(venv) pabot regression-set/Example_Test_*
Elapsed time: 0 minutes 3.287 seconds
Traceback (most recent call last):
  File "/Users/USER/robot_venv/venv/bin/pabot", line 6, in <module>
    main(sys.argv[1:])
  File "/Users/USER/robot_venv/venv/lib/python2.7/site-packages/pabot/pabot.py", line 372, in main
    sys.exit(_report_results(outs_dir, options, start_time_string, _get_suite_root_name(suite_names)))
  File "/Users/USER/robot_venv/venv/lib/python2.7/site-packages/pabot/pabot.py", line 301, in _report_results
    merge(sorted(glob(os.path.join(outs_dir, '**/*.xml'))), options, tests_root_name).save(output_path)
  File "/Users/USER/robot_venv/venv/lib/python2.7/site-packages/pabot/result_merger.py", line 125, in merge
    assert len(result_files) > 0
AssertionError

pabot: 0.22
robotframework: 3.0

error when used with -x (xunit output)

Hello, I'm trying to incorporate pabot into our CI process which demands xunit output, but I get this error:

$ pabot --processes 4 -x robot-xunit.xml mytests
[PID:7112] EXECUTING mytests.Test mytest
PASSED mytests.Test mytest
Elapsed time: 0 minutes 11.893 seconds
Traceback (most recent call last):
  File "~/env/bin/pabot", line 6, in <module>
    main(sys.argv[1:])
  File "~/env/lib/python2.7/site-packages/pabot/pabot.py", line 260, in main
    sys.exit(_report_results(outs_dir, options, start_time_string))
  File "~/env/lib/python2.7/site-packages/pabot/pabot.py", line 246, in _report_results
    merge(*sorted(glob(os.path.join(outs_dir, '**/*.xml')))).save(output_path)
  File "~/env/lib/python2.7/site-packages/pabot/result_merger.py", line 82, in merge
    merger.merge(ExecutionResult(result))
  File "~/env/lib/python2.7/site-packages/robot/result/resultbuilder.py", line 44, in ExecutionResult
    return _single_result(sources[0], options)
  File "~/env/lib/python2.7/site-packages/robot/result/resultbuilder.py", line 68, in _single_result
    raise DataError("Reading XML source '%s' failed: %s" % (unicode(ets), error))
robot.errors.DataError: Reading XML source './pabot_results/mytests.Test mytest/robot-xunit.xml' failed: Incompatible XML element 'testsuite'.

Not sure what the problem is here, am I missing something?

warning messages with robotframework 2.9

Hi @mkorpela,

I have updated robotframework to 2.9.

After that I am getting following warning messages when using pabot.

[ WARN ] Option '--monitorcolors' is deprecated. Use '--consolecolors' instead.
[ WARN ] Option '--monitormarkers' is deprecated. Use '--consolemarkers' instead.

Looks like parameter names are changed in robotframework 2.9

Thanks & Regards,
Sachin Nikam

options not recognized

When I run for example:

pabot --verbose .

I get this error:

Traceback (most recent call last):
  File "/usr/local/bin/pabot", line 6, in <module>
    main(sys.argv[1:])
  File "/Library/Python/2.7/site-packages/pabot/pabot.py", line 356, in main
    options, datasources, pabot_args = _parse_args(args)
  File "/Library/Python/2.7/site-packages/pabot/pabot.py", line 190, in _parse_args
    options, datasources = ArgumentParser(USAGE, auto_pythonpath=False, auto_argumentfile=False).parse_args(args)
  File "/Library/Python/2.7/site-packages/robot/utils/argumentparser.py", line 149, in parse_args
    opts, args = self._parse_args(args)
  File "/Library/Python/2.7/site-packages/robot/utils/argumentparser.py", line 179, in _parse_args
    raise DataError(err.msg)
robot.errors.DataError: option --verbose not recognized

The same happens with all command-line options listed in readme, for example with --processes.

Pabot is broken with RF 3.0

Launching test suite with pabot fails immediately.

python: 2.7.11
pabot: 0.20
robotframework: 3.0 beta1

Traceback (most recent call last):
  File "/Users/USER/robot_venv/venv/bin/pabot", line 3, in <module>
    from pabot.pabot import main
  File "/Users/USER/robot_venv/venv/lib/python2.7/site-packages/pabot/pabot.py", line 40, in <module>
    from result_merger import merge
  File "/Users/USER/robot_venv/venv/lib/python2.7/site-packages/pabot/result_merger.py", line 22, in <module>
    from robot.result.testsuite import TestSuite
ImportError: No module named testsuite

Pabot -processes not working

Hi.

I'm trying to execute scripts in parallel on a folder. The problem that I have is when I run PABOT --processes 5 C:\Scripts\1\test.tsv displays No test to execute. I can execute the test using RIDE but not with Pabot. I'm missing something?

Thanks.

Improve command line output

  • Status for each test suite execution should be shown in a more user-friendly way ( ON GOING / PASSED / FAILED etc )
  • Improve ability to kill certain test execution (process PID should be present at this time)

pabot -h results in stacktrace before dumping pybot help output

When I did a "pabot -h" I got the following. Should pabot offer its own help first and then maybe dump out pybot's help screen?

pabot --help
Elapsed time: 0 minutes 0.15 seconds
Traceback (most recent call last):
File "/usr/local/bin/pabot", line 6, in
main(sys.argv[1:])
File "/Library/Python/2.7/site-packages/pabot/pabot.py", line 236, in main
options, datasources, pabot_args = _parse_args(args)
File "/Library/Python/2.7/site-packages/pabot/pabot.py", line 135, in _parse_args
options, datasources = ArgumentParser(USAGE, auto_pythonpath=False, auto_argumentfile=False).parse_args(args)
File "/Library/Python/2.7/site-packages/robot/utils/argumentparser.py", line 132, in parse_args
opts, args = self._handle_special_options(opts, args)
File "/Library/Python/2.7/site-packages/robot/utils/argumentparser.py", line 142, in _handle_special_options
self._raise_help()
File "/Library/Python/2.7/site-packages/robot/utils/argumentparser.py", line 329, in _raise_help
raise Information(msg)
robot.errors.Information: Robot Framework -- A generic test automation framework

Version: 2.8.4 (Python 2.7.5 on darwin)

Usage: pybot|jybot|ipybot [options] data_sources
or: python|jython|ipy -m robot.run [options] data_sources
or: python|jython|ipy path/to/robot/run.py [options] data_sources
or: java -jar robotframework.jar run [options] data_sources

Not ending execution

I'm sure you know this already but test execution never ends (at least not for me), which of course can be problematic when running through TeamCity

Great tool, by the way, been looking for robot parallel execution for months

Dont work --name and --reporttitle options

By pybot I use command (for Jenkins):

pybot --suite check_availability --name Check_availability --loglevel INFO --outputdir %WORKSPACE%\output\release_stand --output availability_output.xml --log availability_log.html --report availability_report.html --exclude develop --reportbackground white:white:white --monitorwidth 150 --reporttitle "Availability tests" --noncritical noncritical --randomize suites --removekeywords FOR --removekeywords WUKS %WORKSPACE%\test\release_stand\test & exit 0

I have log.html with title and header "Check availability" and parent suite start with "Check availability".
1

If I run tests by pabot:

pabot --suite check_availability --name Check_availability --loglevel INFO --outputdir %WORKSPACE%\output\release_stand --output availability_output.xml --log availability_log.html --report availability_report.html --exclude develop --reportbackground white:white:white --monitorwidth 150 --reporttitle "Availability tests" --noncritical noncritical --randomize suites --removekeywords FOR --removekeywords WUKS %WORKSPACE%\test\release_stand\test & exit 0

I have log.html with full path to suites
2

--timestampoutputs breaks pabot

If you use the pybot option --timestampoutputs in the command line to pabot, it breaks pabot because the suite_names.xml file does not exist (suite_names_.xml does exist but pabot doesn't find it.

add a --deterministic option

I'm going to implement a --deterministic option. Before, I would appreciate your opinion on this idea.

I would like that, when launched several times, pabot distributes the test suites in a deterministic manner.

This will require to add a new distribution function that split the list of suite names into N parts and then launch N processes, one for each part.

What do you think ?

RF 3.0: New 'robot' start-up script and compatibility with older RF versions in the future

https://github.com/robotframework/robotframework/blob/master/doc/releasenotes/rf-3.0b1.rst#new-robot-start-up-script

New generic robot start-up script has been introduced to allow running tests like robot tests.robot regardless the Python interprete. Old interpreter specific pybot, jybot and ipybot scripts still work as earlier, but the plan is to deprecate and remove them in the future major releases.

This might be possible issue in the future if there is need to offer support for RF version 2.9 and older.

Pabot process keeps running for long time on jenkins

Hi,
I am using pabot to run automation test scripts for UI written in python + selenium. While running these scripts on jenkins, I found that most of the times a random process keeps running till timeout and after timeout ends in failure with BadStatusLine error. Unable to sort it out

pabot.PabotLib.Get Value conflicts with Selenium2Library

Hi Mikko,

In my testcases, I am using Get Value keyword from selenium2library. I found that in new version of pabot there is a keyword with same name. Due to which my testcases starts failing.

Found: 'Selenium2Library.Get Value' and 'pabot.PabotLib.Get Value'

To fix this i had to create alias for the resp. library.

Not sure if we can consider this as a bug.

resource management

I've seen on the mailing list some messages that suggests that I'm not the only one to require a resource management.

I plan to implement and propose a pull request with the following feature:

  • add a new option --resources filename.txt
  • filename.txt would be made of several lines, one line per resource.
  • each line would consist in a set of arguments that have to be provided to pybot.

For instance, if filename.txt is build like this:
--variable servername:server1
--variable servername:server2
--variable servername:server3

pabot --resources filename.txt TEST_DIR reduces the number of subprocesses to 3 and adds to the pybot arguments: '--variable servername:serverX' to the subprocess. It also ensures that only one subprocess at a time is using the same servername.

What do you think of this idea ?

Can't call --name from inside a config file

Hi guys,

Thank you for the great work on pabot. Thank you, really.

Introduction

On pybot, I have a config file looking like this:

--variable env:test
--variable platform:chrome
--name A Test
tests/PublicSite/

Then I call:

$ pybot --argumentfile globals/scenarios/test

This is a simple example, but it is a very nice way to define which tests to run against which scenarios, all inside a single (or multiple) config files. That way I have well defined and clean command line calls.

The Issue

That doesn't work on pabot (at least for me). Here is the error:

$ pybot --argumentfile globals/scenarios/test
get_suite_names: output_file='./pabot_results/suite_names.xml' does not exist
No tests to execute
Elapsed time: 0 minutes 0.12 seconds

Please let me know if you are in need of any other information. I would be more than happy to help.

Thank you all!

Python 2 and 3 compatible code

RF 3.0 is coming soon and the biggest change there is support for Python 3. Pabot should also add support for Python 3 (3.4 & 3.5).

code contains a reference to GPL

LICENSE.txt contains the Apache license, but toward the end of pabot.py is the string "Copyright 2015 Mikko Korpela - GPLv3".

pabot in Jenkins does not give realtime console output

When we run pabot in Jenkins, it does not print any output to the console until the whole run is over. After that all the output is shown normally.

When I added --verbose to the command, I noticed that the extra outputs related to the verbose option get printed immediately:

[PID:12250] EXECUTING PARALLEL SUITE Tests.Accept Terms In Login with command:
pybot --variable PABOTLIBURI:127.0.0.1:8270 --outputdir "./pabot_results/Tests.Accept Terms In Login" --log NONE --consolecolors off --report NONE --consolemarkers off --xunit NONE --suite "Tests.Accept Terms In Login" .

When the last "EXECUTING PARALLEL..." output is printed, the non-verbose outputs won't appear until the run is finished. Maybe the verbose outputs are flushed differently than the normal output?

Screenshot path is wrong when using Selenium2Library's 'Set Screenshot Directory' keyword

I am using Selenium2Library's 'Set Screenshot Directory' keyword to set different path for screenshots in all tests.

Set Screenshot Directory  robot_screenshots  persist=True

Then I run couple of tests with Pabot and after I opened log file the path for screenshots is wrong.

test_suite_folder example_user$ pabot test1.robot test2.robot

# After that opened log.html file and tried to view screenshots
What it should be: file:///Users/example_user/test_suite_folder/robot_screenshots/selenium-screenshot-3.png
How it actually is: file:///Users/robot_screenshots/selenium-screenshot-3.png

OS X: 10.10.5
robotframework-pabot: 0.20
robotframework: 1.9.2
robotframework-selenium2library: 1.7.4

Pabot takes too long to start test in case of multiple files

Issue:
My project directories has six sub directories (which has sub directories in it), in which there are around 215 test suites files (there are equal number of resource files). When I run the test for it, it takes more then 107 minutes to start the execution. When I did the debugging I found that it was taking time on this line "run(_datasources, *_opts)" in function solve_suite_names in file pabot.py.

Some other help needed:
I have different script written in Java which does the same thing, and it starts immediately. Only reason I am coming to Pabot is that it combines all the reports file to one output.xml. Even If combning alone can work then can continue till this is fixed.

-Vinay

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.