Hi Jenny,
RFSwarm is a performance test tool that uses robot framework tests for generating load against a test system.
RFSwarm has 3 components:
For this discussion you’ll care about the Manager and the Agent.
As RFSwarm is a performance test tool, in the manager you select a robot file, then select a test case from that robot file and assign the number of robots you want to run.
In a performance test you run the Agent component on each load generating machine and the Manager on a single machine, the Agent on all the Agent machines are configured to poll the Manager machine, when the performance test is started the Manager assigns the number of robots each agent should run for each test case selected, the Agent machines then run a robot for each robot job assigned to the agent.
The manager in RFSwarm runs a simple http server and this is what the Agents connect to making REST calls to the manager. The REST API is documented here Agent Communication
As RFSwarm is Open source, you are free to look at the code, or use components of it however you need. So you could write your own application that assigned jobs to agents however you want and reuse the agent component to do the actual execution of the robot framework tests. Your software just needs have a web server to respond as the Agent’s REST requests as the Agent expects.
Some examples of how this might be useful:
- Say you had a test suite with 100,000 tests that you want to distribute across 100 Agent machines, you might write your server to read all the tests in the suite, and place them in a test queue, then it could pull tests from the queue and assign them to Agents monitoring the agents performance so you don’t overload the Agents, then as an agent finishes a test another is pulled from the queue and assigned to the agent until the queue is empty.
- Say you want to run the same test at 20 different locations every hour, you might run an agent machine in each site, then write your server to assign that test to job to run on each of the Agents, then your server would sleep for an hour and then schedule the job to run again on each Agent, the server might also collect the results returned from the agent and update your system monitoring dashboard
Obviously I don’t know of any software that does any of these examples now, but there’s nothing stopping someone doing this or anything else they might want to do. Re-using the agent component of RFSwarm could save you a lot of work as that part is built, packaged, working, and quite well tested by now.
If you want to write a server that distributes jobs to agents in Python, you’ll probably want to look at the code for RFSwarm Manager, you may even want to copy some of the functions a large portion of the AgentServer class.
If you want to use a different language to write your server, then the manager code might still be useful as a guide. As the communication is all REST over http it should be possible to write the server in whatever language you are comfortable with.
I would suggest before you embark on something like this that you
- read the RFSwarm documentation so you understand what RFSwarm is designed to do, particularly Overview / Concepts, especially the Robot File handling (transfer from Manager to Agent) section.
- setup at least 2 machines, one Manager and one Agent, and run a small performance test with one of your test cases, watch the test files get transferred to the agent and the logs get transferred to the manager, even watch the communication with a packet sniffer if you want
And perhaps just using RFSwarm as is might do what you want, while it was designed for performance testing, there’s no reason that you have to use it for that, might be possible to achieve something close to both those examples with RFSwarm as is.
Hopefully that’s the information you were after,
Dave.