Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rerun when reusing exisitng launch_uuid #252

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ramir-dn
Copy link

@ramir-dn ramir-dn commented Jan 8, 2025

Fix an issue with rerun, while providing the rp.rerun.of and also the rp.launch.uuid.
According to documentation here:

To start a launch rerun using the agent, set rp.rerun=true and rp.rerun.of=launch_uuid in the reportportal.properties file. If you want to save rerun results in the original launch without creating a new one, also set rp.launch.uuid=launch_uuid.

This didn't work because of the flow in start_launch flow: if the rp.launch.uuid is provided, there is no call start launch API call, and on rerun it is important to call it so it will mark the launch as rerun.

This PR fixes, that on rerun, start launch will happen, and also finish launch.

@ramir-dn ramir-dn marked this pull request as ready for review January 8, 2025 13:12
@ramir-dn
Copy link
Author

ramir-dn commented Jan 8, 2025

Hello @HardNorth, just submitted this PR but will be great if you could give it a look. Thanks!

@HardNorth
Copy link
Member

@ramir-dn It looks like documentation issue. If you want to rerun any particular launch just use rp_rerun and rp_rerun_of and that's it. If you want to just append results, use rp_launch_uuid.

@ramir-dn
Copy link
Author

ramir-dn commented Jan 8, 2025

@HardNorth , you are correct, setting rp_rerun and rp_rerun_of works, but, it the launch receives a new launch_uuid.
The paragraph I copied above from the documentation, explains how to solve it, and it is by adding the rp_launch_uuid.
I don't think that this is a documentation issue. After that paragraph it also describes how to do it and gives this example - mind the last 3 lines:

rp.endpoint=https://rp.com
rp.apiKey=caccb4bd-f6e7-48f2-af3a-eca0f566b3bd
rp.launch=rerun_test_example
rp.project=reporting-test
rp.reporting.async=true
rp.rerun=true
rp.rerun.of=79446272-a439-45f9-8073-5ca7869f140b
rp.launch.uuid=79446272-a439-45f9-8073-5ca7869f140b

I was actually surprised to see that the default rp_rerun_of behavior is that the launch receives a new launch_uuid. We need to keep the same launch uuid because we perform rerun of different tests from parallel executions. I breaks if the launch_uuid changes.

Editing:
Based on the server code, this is also not a documentation error. I saw this in the service-api repo:

public Launch handleLaunch(StartLaunchRQ request, Long projectId, ReportPortalUser user) {
...
ofNullable(request.getUuid()).ifPresent(launch::setUuid);
...

If provided, it uses the launch uuid from the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants