gurock / trcli

TR CLI (trcli) is a command line tool for interacting with TestRail.
Mozilla Public License 2.0
48 stars 39 forks source link

Error during add_case. Trying to cancel scheduled tasks. #200

Closed vityazverev closed 5 months ago

vityazverev commented 5 months ago

TestRail CLI Version

1.8.0

CLI Environment

MacOS Soloma 14,2,1, Python 3.11.6

TestRail Version

v8.0.3 Default (3066)

TestRail Instance Type

Professional Cloud

Current behavior

I am trying to import JUnit test results to TestRail and create test cases. The field automation_id is present image

Sample command:

trcli -y \        
-h https://**********.testrail.net \
--project "BigData" \
--username ********@*****.com \
--password ******** \
parse_junit \
--title "Automated Tests Run" \
-f src/test/resources/cli/TEST-TestSuite.xml

Result:

TestRail CLI v1.8.0
Copyright 2023 Gurock Software GmbH - www.gurock.com
Parser Results Execution Parameters
> Report file: src/test/resources/cli/TEST-TestSuite.xml
> Config file: None
> TestRail instance: https://**********.testrail.net (user: ********@*****.com)
> Project: BigData
> Run title: Automated Tests Run
> Update run: No
> Add to milestone: No
> Auto-create entities: True
Parsing JUnit report.
Processing JUnit suite - test suites root
Processed 3 test cases in section tests.LoginTests.
Checking project. Done.
Found 3 test cases not matching any TestRail case.
Adding missing sections to the suite.
Adding missing test cases to the suite.
Adding test cases: 0/3
Error during add_case. Trying to cancel scheduled tasks.

Aborting: add_case. Trying to cancel scheduled tasks.
Adding test cases: 0/3
Field :custom_custom_tc_owner is a required field.
Deleted created section

Desired behavior

No response

More Details

No response

Testinator-X commented 5 months ago

custom_custom_tc_owner is a required field. -> either you don’t make this field required in your test rail project or specify the value to be set to the field using the --case-fields parameter.

See also:

vityazverev commented 5 months ago

custom_custom_tc_owner is a required field. -> either you don’t make this field required in your test rail project or specify the value to be set to the field.

See also: #73

Does the field custom_custom_tc_owner need to be added in the same as automation_id from doc https://support.testrail.com/hc/en-us/articles/12609674354068-Automation-workflows-Code-first? Is it possible to update the document?

Thanks for the reply

vityazverev commented 5 months ago

custom_custom_tc_owner is a required field. -> either you don’t make this field required in your test rail project or specify the value to be set to the field using the --case-fields parameter.

See also:

I checked what the fields we have and the custom_custom_tc_owner exists. image

Testinator-X commented 5 months ago

Yes this field is available in your TestRail project, and it’s assigned to your TR project as „required“ https://support.testrail.com/hc/en-us/articles/7373850291220-Configuring-custom-fields

Why do you think that your import knows what value to use for this field? You have to provide the --case-fields when using the trcli parse_junit and specify which custom_custom_tc_owner should be set. Idk why your field has double custom_custom_ but your trcli import configuration should look something like this:

case_fields: 
  custom_custom_tc_owner: [71]

OR

case_fields: 
  custom_custom_tc_owner:
    - 71

Don’t forget to specify the file path to your config file with trcli --c <pathToFile> parse_junit

OR use it wit the trcli parse_junit --case-fields custom_custom_tc_owner:71

be aware that user 71 will be set to the field custom_custom_tc_owner for every created testcase

—-

To sum it up: As already mentioned you either should make the field custom_custom_tc_owner not required in your project configuration within TestRail OR specify which value to be set for the required field custom_custom_tc_owner while importing.

vityazverev commented 5 months ago

Works, thank you!