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

KeyError: 'custom_automation_id' on sending test report #132

Closed ssv-w32 closed 1 year ago

ssv-w32 commented 1 year ago

TestRail CLI Version

1.4.3

CLI Environment

Python 3.10.6

TestRail Version

TestRail v7.8.0 Default (1136)

TestRail Instance Type

Professional Cloud

Current behavior

Tried to setup integration of TestRai with Pytest using this manual: https://support.gurock.com/hc/en-us/articles/7983744604564-Integrating-with-Pytest#01G74YVK29QJ87T0N2PAHCSCW5

However, on send I'm getting error, that custom_automation_id field somewhere in test case is missing:

  File "/Users/test/.virtualenvs/automation/bin/trcli", line 8, in <module>
    sys.exit(cli())
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/trcli/commands/cmd_parse_junit.py", line 92, in cli
    result_uploader.upload_results()
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/trcli/api/results_uploader.py", line 71, in upload_results
    missing_test_cases, error_message = self.api_request_handler.check_missing_test_cases_ids(
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/trcli/api/api_request_handler.py", line 301, in check_missing_test_cases_ids
    aut_case_id = case["custom_automation_id"]
KeyError: 'custom_automation_id'

Report looks like this:

<?xml version="1.0" encoding="utf-8"?>
<testsuites>
    <testsuite name="pytest" errors="0" failures="0" skipped="0" tests="1" time="226.659"
               timestamp="2023-02-23T16:56:28.151984" hostname="test.local">
        <testcase classname="tests.login.test_login" name="test_redirect_to_register_user" time="11.253"/>
    </testsuite>
</testsuites>

I did not find any manual about custom_automation_id field and where it should be setup on this stage. Could someone please help to determine whether this is a bug or misconfigured TestRail?

Desired behavior

No response

More Details

No response

d-rede commented 1 year ago

Hello @ssv-w32

Have you configured the custom automation_id case field in your administration settings? You can check the instructions on the TestRail CLI code-first workflow documentation for guidance.

ssv-w32 commented 1 year ago

@d-rede, thanks, just messed with linking this variable to project. closed.