Skip to content

Conversation

@acuanico-tr-galt
Copy link
Collaborator

@acuanico-tr-galt acuanico-tr-galt commented Nov 27, 2025

Issue being resolved: #372

Solution description

Fixed a critical bug where uploading JUnit XML results to existing test runs (with configs in a test plan) was failing with error: "case unknown or not part of the test run". The root cause was that trcli wasn't sending the include_all parameter when calling update_run_in_plan_entry, causing TestRail to deselect all test cases from the run.

Changes

Updated: trcli/api/api_request_handler.py (lines 471-486) changed the update_run() method to:

  • Read and preserve the existing include_all setting from the run
  • Only manage case_ids when include_all=False
  • Remove case_ids from payload when include_all=True (cleaner API
    contract)
  • Add error handling for __get_all_tests_in_run() API failures

Potential impacts

None

Steps to test

Upload JUnit results to an existing run with configs in a test plan (the original bug scenario) -> verify case existing cases are
preserved -> Test with --run-include-all runs to ensure they still work in add_run command

PR Tasks

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

@acuanico-tr-galt acuanico-tr-galt changed the title TRCLI-207 Fix test run cases deletion issue: update_run_in_plan_entry TRCLI-207: Fix test run cases deletion issue in update_run_in_plan_entry Nov 27, 2025
@acuanico-tr-galt acuanico-tr-galt changed the title TRCLI-207: Fix test run cases deletion issue in update_run_in_plan_entry TRCLI-207 Fix test run cases deletion issue in update_run_in_plan_entry Dec 9, 2025
@acuanico-tr-galt acuanico-tr-galt merged commit 0f3670f into release/1.12.5 Dec 9, 2025
2 of 3 checks passed
@acuanico-tr-galt acuanico-tr-galt deleted the fix/TRCLI-207 branch December 9, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant