Closed EOssesFrazoni closed 1 year ago
Hello @EOssesFrazoni
Thank you for bringing this to our attention. The bug fix has just been released in v1.4.1
, which should be available in a few minutes via PyPI.
Hi @d-rede. It is fixed now, it is creating new test cases but I see two issues:
Field :results contains one or more invalid results (case C863106 unknown or not part of the test run)
I just want to update a TestRun with a new set of results for existing test cases.
Note: the Run Id I passed as an argument was created by the a previous TRCLI run.Hello again,
It always creates duplicated test cases, even when they have the same name (and have been created by the same TRCLI)
The --case-matcher name
actually doesn't match the cases by name. It expects you to have the ID of the TestRail case in the name of the test instead. You can read more about it in the TestRail CLI - Specification first documentation. We recommend that you don't use the automatic test case creation if you are using the name/property matcher.
When running with an existing Run Id (using --run-id), it tries to create the test cases again, then it deletes all and finishes with this error: Field :results contains one or more invalid results (case C863106 unknown or not part of the test run) I just want to update a TestRun with a new set of results for existing test cases. Note: the Run Id I passed as an argument was created by the a previous TRCLI run.
When using the --run-id
to update a run, it is expected that you will be submitting results for the same tests. If you use the name/property matcher and don't have your TestRail case IDs in your automation code, new tests will be created and won't match the existing tests in the given test run. Once again, we discourage using automatic test creation (-y
) if you use the name/property matcher.
I didn't specify it but In my attempts I tried with and without the case-matcher parameter. I've tried multiple combinations in the CLI but I'm still not able to do what I expect (adding test results for existing test cases in an existing test run). If I use the run-id without case-matcher and Auto-create entities: False, but I still can get it working. I'm expecting to use the first mechanism; "Using Automation ID"
command:
trcli -h "https://host/" -u "user@company.com" -p "key" --project "Project Name" --project-id 1 -n parse_junit --title "Pytest POC Suite" --run-description "Pytest POC Suite" -f "result.xml" --case-fields custom_automation_type:1 --run-id 11197
Test Run 11197 contains the a test case with the same name from my result.xml
This is the result: `TestRail CLI v1.4.1 Copyright 2021 Gurock Software GmbH - www.gurock.com Parse JUnit Execution Parameters
Report file: result.xml Config file: None TestRail instance: https://host.net/ (user: mail@company.com) Project: Existing Project Run title: Pytest POC Suite Update run: 11197 Add to milestone: No Auto-create entities: False Parsing JUnit report. Processing suite - None Processed 1 test cases in 1 sections. Checking project. Done. Found 1 test cases not matching any TestRail case. Updating run: https://host/index.php?/runs/view/11197 Adding results: 0/0, Done. No attachments found to upload.`
If you use the automation ID, you should see how matching happens in this article: TestRail CLI - Code first documentation. It matches a custom field named automation_id
, not the actual test name. When test cases are automatically created using the default --case-matcher auto
, the automation_id
is added to later be able to map the results to the correct test cases and not duplicate them.
TestRail CLI Version
1.4.0
CLI Environment
Windows 10 E 21H2 x64, Python 3.9.5
TestRail Version
TestRail v7.8.0 Default (1136)
TestRail Instance Type
Enterprise Cloud
Current behavior
TRCLI fails to generate or update TestCases with the error:
"AttributeError: 'TestRailCase' object has no attribute 'result_fields'" even when not using the optional parameter
This worked on previous version.
Command:
trcli -h "https://company.testrail.net/" -u "user@company.com" -p "api_key" --project "Project Name" --project-id 1 -y parse_junit --title "Pytest POC Suite" --run-description "Pytest POC Suite" -f "junit-report.xml" --case-fields custom_automation_type:3 --case-matcher "name"
CLI Output:
Desired behavior
Test Cases are updated or created in TestRail
More Details
No response