reportportal / agent-python-pytest

Framework integration with PyTest
Apache License 2.0
94 stars 102 forks source link

Is there a way to remove the full path from the test name created by ReportPortal #300

Closed shague closed 2 years ago

shague commented 2 years ago

We are currently using Report Portal 5.0.11 and cannot upgrade to 5.1 which has the tc_id marks. We want to make use of the history feature so that we can see the history of a test case. The history is only showing a single result, which we think is because the test case id is including the absolute path to the test but the path has a random id in it, that comes from the job infrastructure.

For example, a test name would be: \workspace\<123456>\tests\test_foo.py::test_foo. Notice the digits in the path. That number is generated by the execution infrastructure, it creates a workspace folder with that unique number and runs the test from that folder. RP then sees this as a unique test, so there is no history.

Is there a configuration to get RP to ignore the absolute path and instead use the path after the digits? Or relative to the pytest tests folder?

Is there a suggestion for a filter that can be used in the RP widgets and dashboards to achieve the same history view?

HardNorth commented 2 years ago

Well, today I merged 5.1 branch. So now you can take new code as example: https://github.com/reportportal/agent-python-pytest/blob/master/pytest_reportportal/service.py#L435