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

Rerun filtered environments button #179

Merged
merged 26 commits into from
May 10, 2024
Merged

Conversation

omar-selo
Copy link
Collaborator

Resolves https://warthogs.atlassian.net/browse/RTW-307

Changes:

  • Modify POST /v1/test-executions/reruns endpoint to take a set of test execution ids to rerun instead of just one
  • Remove POST /v1/artefacts/<artefact-id>/reruns endpoint as I used the endpoint above instead. The reason is that this endpoint will have to filter exactly as the frontend does. This could be prone to errors, so instead I'd rather rerun exactly what the frontend user can see
  • Add the button RerunFilteredEnvironments you can see how it works in the video below
  • Replace filteredTestExecutionIds provider with filteredTestExecutions
Screencast.from.2024-05-09.13-34-33.webm

@omar-selo omar-selo force-pushed the rerun-filtered-environments-button branch from 78dea65 to 4d0404f Compare May 9, 2024 10:47
Copy link
Contributor

@andrejvelichkovski andrejvelichkovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me, but I have two small concerns

backend/test_observer/controllers/artefacts/models.py Outdated Show resolved Hide resolved
if not te:
msg = f"No test execution with id {request.test_execution_id} found"
msg = f"No test execution with id {test_execution_id} found"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way of checking whether the Test Execution ID is valid might lead us to the API behaving somewhat inconsistent. For example, if only one of the test execution IDs provided is invalid, then all test executions appearing before it would have been rerun, while the ones after it wont.

Maybe a better way we can handle this is to firstly filter just test executions whose id is in the set, and then create TestExecutionRerunRequest just for those? Or maybe just ignore the ones that have invalid ID, instead of raising the HTTPException

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I opted to rerun everything that can be rerun. Then return a list of what was rerun. If nothing gets rerun then I return a status code of 404. If everything gets rerun then a status code of 200. And if some rerun and others don't then I return 207.

@omar-selo omar-selo force-pushed the rerun-filtered-environments-button branch from 4d0404f to 4f3b12c Compare May 10, 2024 09:52
@omar-selo omar-selo force-pushed the rerun-filtered-environments-button branch from 6330619 to e610c23 Compare May 10, 2024 11:18
Copy link
Contributor

@andrejvelichkovski andrejvelichkovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the issues! Looks good to me now!

@omar-selo omar-selo merged commit 76c0150 into main May 10, 2024
2 of 3 checks passed
@omar-selo omar-selo deleted the rerun-filtered-environments-button branch May 10, 2024 12:44
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