gurock / trcli

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

There is no empty or null check as a result it is throwing error #123

Closed VenkataJagadeeswar closed 1 year ago

VenkataJagadeeswar commented 1 year ago

https://github.com/gurock/trcli/blob/40652c5d5ed985d146fbe4e0c3ed6083fdcb6758/trcli/api/api_request_handler.py#L58

Sample Error message: File "C:\Users\mahesh.koppana\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 760, in invoke     return __callback(*args, **kwargs)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "C:\Users\mahesh.koppana\AppData\Local\Programs\Python\Python311\Lib\site-packages\trcli\commands\cmd_parse_junit.py", line 46, in cli     result_uploader.upload_results()   File "C:\Users\mahesh.koppana\AppData\Local\Programs\Python\Python311\Lib\site-packages\trcli\api\results_uploader.py", line 71, in upload_results     automation_id_error = self.api_request_handler.check_automation_id_field(project_data.project_id)                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "C:\Users\mahesh.koppana\AppData\Local\Programs\Python\Python311\Lib\site-packages\trcli\api\api_request_handler.py", line 58, in check_automation_id_field     context = automation_id_field["configs"][0]["context"]               ~~~~~~^^^ IndexError: list index out of range

d-rede commented 1 year ago

Hello @VenkataJagadeeswar

Thanks for bringing this to our attention. Version 1.4.0 was just released and that issue might no longer exist. Do you mind verifying and letting me know if it works for you?

Thanks!

VenkataJagadeeswar commented 1 year ago

Hi @d-rede I verified with latest version, now it is giving error message instead of throwing error.

**Checking project. 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:

d-rede commented 1 year ago

Thanks again @VenkataJagadeeswar

Do you think you could run the command with the -v option and attach the logs from your terminal so I can see how your fields configuration is retrieved by the API? There might be an edge case that is not supported by the API.

VenkataJagadeeswar commented 1 year ago

Sure @d-rede. I added the output in the attached text file. trcli_output.txt

d-rede commented 1 year ago

@VenkataJagadeeswar this issue should be resolved in v1.4.2 which is now available.