Skip to content

TRCLI-246: Attachments are all uploaded to the last result when multiple results are added to case while parsing several reports via glob support#411

Merged
acuanico-tr-galt merged 2 commits intorelease/1.14.1from
fix/TRCLI-246
Apr 16, 2026

Conversation

@acuanico-tr-galt
Copy link
Copy Markdown
Collaborator

Solution description

Changed the mapping to use object identity (id()) instead of case_id, allowing each result object to be uniquely tracked even when multiple results share the same case_id.

Changes

Results Handler (api/result_handler.py):

  • Changed case_id_to_result_id to request_id_to_result_id mapping, updated add_results() method to map by object identity, updated upload_attachments() signature and implementation and removed unused results variable.

API Request Handler (api/api_request_handler.py):

  • Updated upload_attachments() wrapper method signature

Unit Test (tests/test_api_request_handler.py):

  • Updated 4 attachment test to use new approach and added new test: test_upload_attachments_duplicate_case_ids_different_results

Potential impacts

None

Steps to test

  1. Execute parse_junit command against several reports (via glob support) that:
  • have the same case in them and both have attachment to upload to result
  • have the same case in them and one of them (the first to be parsed) has attachment to uploaded to result
  1. Open created run in TestRail and verify how exactly attachments are uploaded

PR Tasks

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

…ich causes attachments to be uploaded to last test result
…ments to correct results when case_id appears multiple times
@acuanico-tr-galt acuanico-tr-galt merged commit 46321d2 into release/1.14.1 Apr 16, 2026
3 checks passed
@acuanico-tr-galt acuanico-tr-galt deleted the fix/TRCLI-246 branch April 16, 2026 06:48
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.

1 participant