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 detected while checking a project: <list of projects> #177

Closed gourianova91 closed 6 months ago

gourianova91 commented 8 months ago

Background: Python 3.12.0 TestRail CLI 1.6.2 TestNG, Java We have our company TestRail server (non-admin user)

Error description: ` trcli -y --project "My project name 1" --project-id 1 --insecure -c "trcli-config.yml" -v parse_junit -f "./sample_reports/TEST-TestSuite.xml" TestRail CLI v1.6.2 Copyright 2023 Gurock Software GmbH - www.gurock.com Parser Results Execution Parameters

Report file: ./sample_reports/TEST-TestSuite.xml Config file: trcli-config.yml TestRail instance: https://testrail.server.com/testrail/ (user: username) Project: My project name 1 Run title: TestNG Automated Test Run Update run: No Add to milestone: No Auto-create entities: True Parsing JUnit report. Processed 1 test cases in 1 sections. Checking project. **** API Call method: GET url: https://testrail.server.com/testrail/index.php?/api/v2/get_projects response status code: 200 response body: b'USER AUTHENTICATION SUCCESSFUL!\n[{"id":1,"name":"My project name 1","announcement":null,"show_announcement":false,"is_completed":false,"completed_on":null,"suite_mode":3,"url":"https:\/\/testrail.server.com\/testrail\/index.php?\/projects\/overview\/1"},{"id":2,"name":"My project name 2","announcement":null,"show_announcement":false,"is_completed":false,"completed_on":null,"suite_mode":3,"url":"https:\/\/te strail.server.com\/testrail\/index.php?\/projects\/overview\/2"}]'


Error detected while checking a project: b'USER AUTHENTICATION SUCCESSFUL!\n[{"id":1,"name":"My project name 1","announcement":null,"show_announcement":false,"is_completed":false,"completed_on":null,"suite_mode":3,"url":"https:\/\/testrail.server.com\/testrail\/index.php?\/projects\/overview\/1"},{"id":2,"name":"My project name 2","announcement":null,"show_announcement":false,"is_completed":false,"completed_on":null,"suite_mode":3,"url":"https:\/\/te strail.server.com\/testrail\/index.php?\/projects\/overview\/2"}]'' `

The response returns correct name for my "My project name 1" as well as I have checked in Postman. So I don't know what the issue is with my project?

bitcoder commented 7 months ago

Well, it's a bit strange.

  1. have you tried using just the --project argument or the --project-id argument (not both at the same time)?
  2. it seems the API is return "USER AUTHENTICATION SUCCESSFUL!" before the JSON content.. which if true, is strange. Do you see that response if you use Postman or even put the URL "https://testrail.server.com/testrail/index.php?/api/v2/get_projects" in your browser?
  3. I tried replicate your call, having similar names for the projects but without success
gourianova91 commented 7 months ago

Hi @bitcoder

have you tried using just the --project argument or the --project-id argument (not both at the same time)?

yes, -project argument - error is the same --project-id argument - error is the same and "Please specify the project name using the --project argument."

it seems the API is return "USER AUTHENTICATION SUCCESSFUL!" before the JSON content.. which if true, is strange. Do you see that response if you use Postman or even put the URL "https://testrail.server.com/testrail/index.php?/api/v2/get_projects" in your browser?

Yes the same in Postman image

I tried replicate your call, having similar names for the projects but without success

The names for projects I can not put here - but as you can see I have in API response more than one project assigned on me

bitcoder commented 7 months ago

What testrail version do you have?

gourianova91 commented 7 months ago

@bitcoder

My company has TestRail v7.0.1.1013 version

bitcoder commented 7 months ago

thanks @gourianova91 . As this is related to a problem on the TR side, on the API call related response, I kindly ask you to raise a support ticket on TestRail so the support team can assist you on this. On the CLI side, as soon you have a fix/update on the TR you should be good to go. I'll leave this issue open for some time even though the error is not CLI related.

gourianova91 commented 7 months ago

@bitcoder thanks

gourianova91 commented 7 months ago

@bitcoder but unfortunately I can not raise that request, because our company anyway will not update their Tetsrail version even there will be a bug fix.

bitcoder commented 7 months ago

@gourianova91 can you try using the version attached ahead?

python3 -m pip uninstall trcli -y 
python3 -m pip install trcli-1.6.3.tar.gz

trcli-1.6.3.tar.gz

gourianova91 commented 6 months ago

Hi @bitcoder

The error is the same with trcli-1.6.3

bitcoder commented 6 months ago

@gourianova91 just to clarify, have you tried with the patched .tar.gz file I provided or with the official 1.6.3 version?

gourianova91 commented 6 months ago

@bitcoder

sorry didn't notice your attahcment

gourianova91 commented 6 months ago

@bitcoder

Thank you the response is different now:

`**** API Call method: GET url: https://testrail.server.com/testrail/index.php?/api/v2/get_case_fields response status code: 200 {body}


The automation_id field is not properly configured. Please configure it in the TestRail Administration under Customizations > Case Fields. The field should have the following mandatory details:

bitcoder commented 6 months ago

Right, then the problem was overcome. The error message you're getting is totally unrelated with this issue; you need to configure an automation_id field as stated in the documentation: Let me know if you got it working after that.

gourianova91 commented 6 months ago

@bitcoder

Thank you a lot!

Our company Testrail support added that field by my request - so now I can see the created Test run in Testrail.

The issue was solved.