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

Add add_run command #240

Merged
merged 6 commits into from
Aug 30, 2024
Merged

Conversation

jakec-routable
Copy link
Contributor

Issue being resolved: #236

Solution description

How are we solving the problem?
Adding the add_run command exposes the API's add_run route to trcli users. This command can be used to create the target test run prior to uploading results - a required step when uploading results that are generated in CI/CD environments that use parallel execution nodes, such as circleCi.

The command follows the same usage pattern as trcli's other commands. The output of the command is the test run id, which is sent to STDOUT and optionally to a yaml file that can be used as a config for parse_*** command that may be executed next.

Changes

What changes where made?

  • The README was updated to include the usage of the add_run command.
  • API request handler was updated to support all inputs for add_run route.
  • A ProjectBasedClient class was added to encapsulate shared API request methods that function based on the presence of a project id.
  • Existing class TestResultsUploader was refactored to extend the shared logic in the ProjectBasedClient.
  • CLI class was updated to accept the new add_run command.
  • Add_run command was added.
  • Tests were updated to exercise the refactored classes: ProjectBasedClient, TestResultsUploader
  • Tests were added for the add_run command.

Potential impacts

What could potentially be affected by the implemented changes?

The implemented changes should have no impact on existing usage. These changes do not alter the current behavior of the application.

Steps to test

Happy path to test implemented scenario:

  • having installed the trcli
  1. Use the add_run command to create a new test run:
trcli -h "<host>" -p "project" -u "<un>" -p "<pw>" add_run --title "Run Title" -f run_config.yml
  1. Observe the run id in the standard output of the command.
  2. Observe the newly created run_config.yml file contains the test run title and run id.
  3. Observe the newly created run in TestRail.
  4. Use the newly created run_config.yml to upload results to the test run:
trcli -h "<host>" -p "project" -u "<un>" -p "<pw>" -c run_config.yml parse_junit -f results.xml
  1. Observe the test results uploaded to the test run.

PR Tasks

  • PR reference added to issue
  • README updated
  • Unit tests added/updated

@jakec-routable
Copy link
Contributor Author

Hello @bitcoder, could this PR get a review, please 🙏🏼 ?

@bitcoder
Copy link
Collaborator

bitcoder commented Jul 8, 2024

I'm not actively involved in this project anymore but I'll notify the team about it

@acuanico-tr-galt acuanico-tr-galt self-requested a review July 17, 2024 14:18
Copy link
Collaborator

@acuanico-tr-galt acuanico-tr-galt left a comment

Choose a reason for hiding this comment

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

I’m sorry for the delay in reviewing this PR. I appreciate your patience, and I’m happy to say that the changes look solid. Ready to merge!

@acuanico-tr-galt acuanico-tr-galt merged commit a61bfb4 into gurock:main Aug 30, 2024
10 checks passed
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.

Add commands to create a new test run
3 participants