agent-Python-RobotFramework icon indicating copy to clipboard operation
agent-Python-RobotFramework copied to clipboard

Tutorial for beginners

Open Tset-Noitamotua opened this issue 9 years ago • 7 comments

I would like to try ReportPortal with Robot-Framework and Python unittests/pytest.

In order to better understand things I would like to make a tutorial about that. But I am kind of lost and don't know where to start :-/. So please give me some guidance and I will publish a tutorial in a Github repo or Gist.

So far I have a Ubuntu 16.04 with Docker up and running as a VirtubalBox VM on a Windows host machine. Inside that VM I have ReportPortal running by following the installation steps from your README and your docs. I can access ReportPortal UI inside VM at http://localhost:8080. Further I have cloned Robotframework repository which has a great set of over 1500 Python unittests and over 4000 acceptance test in Robot-Framework format. I want to use this tests as example for the integration with ReportPortal.

What I have in short:

  • Ubuntu VM with ReportPortal started with docker-compose up
  • set of Python unittests
  • set of RobotFramework tests

What are the next steps I have to work on to see the results of above mentioned tests after execution inside ReportPortal?

Tset-Noitamotua avatar Jun 12 '17 18:06 Tset-Noitamotua

Hi @Tset-Noitamotua, I'm ready to provide some assistance to you. I'm going to replicate your steps now. Will get back to you soon with more details.

frizzby avatar Jun 16 '17 12:06 frizzby

  1. The command to execute RobotFramework acceptance tests with Report Portal looks like this atest/run.py python --listener robotframework_reportportal.listener --variable RP_UUID:"your_uuid" --variable RP_ENDPOINT:"https://endpoint" --variable RP_LAUNCH:”ROBOT” --variable RP_PROJECT:"your_project_name" atest/robot/ But likely you will see a few errors #10 #12 #11.

  2. Regarding RobotFramework UnitTests. I afraid it will not work in this case since RobotFramework unit tests are implemented with python's unittest, but in order to work with ReportPortal unit tests should be executed with pytest.

frizzby avatar Jun 25 '17 00:06 frizzby

Great! Thanks a lot! I will play with that today.

Pytest claims to be able to deal with Python's regular unittests (more details here). So it might be possible to run Robot's unit test with pytest with some tweaking. I'll see what I can find out.

Tset-Noitamotua avatar Jun 26 '17 05:06 Tset-Noitamotua

Results from first test run

A) without ReportPortal

> atest/run.py python atest/robot/
...
Run suite 'Robot' with 4470 tests in 7 minutes 23 seconds 202 milliseconds.

FAILED
4470 critical tests, 4322 passed, 148 failed
4470 tests total, 4322 passed, 148 failed

B) with ReportPortal

> atest/run.py python --listener robotframework_reportportal.listener --variable RP_UUID:"XXX" \
--variable RP_ENDPOINT:"http://0.0.0.0:8080" \
--variable RP_LAUNCH:"ROBOT FRAMEWORK" \
--variable RP_PROJECT:"ROBOT_INTEGRATION" atest/robot/
...
Run suite 'Robot' with 4470 tests in 14 minutes 28 seconds 791 milliseconds.

FAILED
4470 critical tests, 4322 passed, 148 failed
4470 tests total, 4322 passed, 148 failed

@frizzby Did you have similar results?

It's notable that test execution with ReportPortal integration takes twice as much time as without it.

Approx. 15 minutes after test launch ReportPortal still shows the test running. Why? What needs to be done to finish test launch correctly?

Tset-Noitamotua avatar Jun 26 '17 06:06 Tset-Noitamotua

Regarding RobotFramework UnitTests. I afraid it will not work in this case since RobotFramework unit tests are implemented with python's unittest, but in order to work with ReportPortal unit tests should be executed with pytest.

@frizzby just run Robot's unittests with pytest :))))

follow up ... @frizzby I was able to run Robot's unittests with pytest

image

Tset-Noitamotua avatar Jun 29 '17 15:06 Tset-Noitamotua

@Tset-Noitamotua @frizzby Folks, can we have smthn like Tutorial from it?

DzmitryHumianiuk avatar Oct 25 '17 16:10 DzmitryHumianiuk

Not related to the Agent itself

HardNorth avatar Mar 18 '24 09:03 HardNorth