Skip to content

Distributed/parallel execution of Robot Framework test suites using multiple docker containers

License

Notifications You must be signed in to change notification settings

rajeevnaikte/distbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

distbot

Distributed/parallel execution of Robot Framework (RF) test suites using multiple docker containers

Demo

https://www.youtube.com/watch?v=KL4V0QkMMVc

How it works

Start multiple docker containers of rajeevnaikte/distbot (e.g. docker-compose up --scale=4), with all pointing to a shared volume folder (please refer docker-compose volumes for configurations), where the robot framework test suites are stored, and set argument --mode distributed (e.g. in docker-compose.yml file). Each robot suite/file will be run in a separate process/container. This program will automatically distribute the suites among the docker containers and run in parallel (without need of a master node). Also, in each container multiple suites can be run in parallel as per the --max-* configurations mentioned below. Once all suites are completed, one of the container will execute rebot of robot framework to combine all the reports. The report will be stored in same shared volume folder (You can also specify different location using --outputdir argument of robot frameowrk).

Usage

pip install robotframework-distbot
Run the docker container or python -m distbot with -h argument to see all options of the progam.

usage: -e ENV [options] main_suite [robot arguments]

Explanation: first give options from below list as per your need (these are specific to this library),
next give main suite name (folder name), next give RF arguments as per your needs (these are RF specific as mentioned in thier guide).
If there is a conflicting options between this library and RF, then you can use full name for that option in RF.
E.g. -e is used by this library for ENV, but RF as well has it for exclude option. So you can use --exclude for RF.
i.e. -e ENV my_suite --exclude something

positional arguments:
  main_suite            Folder name containing all the robot framework scripts.

optional arguments:
  -h, --help            show this help message and exit
  -e E                  dev, stage, prod etc. This value will be available as variable ENV.
  -b B                  This value will be available as variable BROWSER.
  --mode {sequential,distributed}
  --max-cpu-percent MAX_CPU_PERCENT
                        Program will stop spawning new process when cpu usage reaches this value.
  --max-memory MAX_MEMORY
                        Program will stop spawning new process when memory usage reaches this value.
  --max-processes MAX_PROCESSES
                        Program will stop spawning new process when running processes count is this value.
  -d OUTPUTDIR, --outputdir OUTPUTDIR
                        Directory to save report files. Default is workingdir/report
  -s SUITE, --suite SUITE
                        Only run suites matching this value

Assistant mode

There is an assistant library here to use during development. This program will keep the robot framework running, and allow you to type in the keywords from terminal/cmd prompt. It is a good tool for web-developers while coding to see the effect while trying out differnet logics.
Starting assistant is simply using keywork 'start assistant'. e.g. in this repo there is file Assistant/assistant.robot. Just run that -
python -m distbot -e local -b ff Assistant

About

Distributed/parallel execution of Robot Framework test suites using multiple docker containers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published