gurock / trcli

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

Errors parsing "elapsed" (time) for valid JUnit XML #266

Closed testlabauto closed 2 months ago

testlabauto commented 2 months ago

TestRail CLI Version

1.9.6

CLI Environment

Ubuntu latest

TestRail Version

8.0.4 Default (7036)

TestRail Instance Type

Professional Cloud

Current behavior

As soon as the new version was released, sending our results into testrail started failing:

TestRail CLI v1.9.6
Copyright 2024 Gurock Software GmbH - www.gurock.com
Parser Results Execution Parameters
> Report file: .build/logs/smoke-tests-electron/test-results/results.xml
> Config file: None
> TestRail instance: https://posit.testrail.io/ (user: testrailautomation@posit.co)
> Project: Positron
> Run title: 2024-08-30 Smoke Tests on branch 4535/merge
> Update run: No
> Add to milestone: No
> Auto-create entities: None
Parsing JUnit report.
Processing JUnit suite - Desktop Smoke Tests linux
Traceback (most recent call last):
  File "/home/runner/.local/bin/trcli", line 8, in <module>
    sys.exit(cli())
  File "/home/runner/.local/lib/python3.[10](https://github.com/posit-dev/positron/actions/runs/10633990725/job/29480316211?pr=4535#step:17:11)/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/trcli/cli.py", line 242, in main
    return super().main(windows_expand_args=False, *args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/runner/.local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/runner/.local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/runner/.local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/trcli/commands/results_parser_helpers.py", line 101, in wrapper_common_options
    return f(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/trcli/commands/cmd_parse_junit.py", line 34, in cli
    parsed_suites = JunitParser(environment).parse_file()
  File "/home/runner/.local/lib/python3.10/site-packages/trcli/readers/junit_xml.py", line 155, in parse_file
    result = TestRailResult(
  File "<@beartype(trcli.data_classes.dataclass_testrail.TestRailResult.__init__) at 0x7fb4eb9a3d00>", line [11](https://github.com/posit-dev/positron/actions/runs/10633990725/job/29480316211?pr=4535#step:17:12)1, in __init__
serde.compat.SerdeError: Method trcli.data_classes.dataclass_testrail.TestRailResult.__init__() parameter elapsed=2.241 violates type hint <class 'str'>, as float 2.241 not instance of str.

Desired behavior

I would expect that the new version would not affect results publishing.

More Details

Content of XML

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Desktop Smoke Tests linux" time="539.494" tests="44" failures="5">
  <testsuite name="Root Suite" timestamp="2024-08-30T14:15:54" tests="0" time="0.000" failures="0">
  </testsuite>
  <testsuite name="VSCode Smoke Tests (Electron)" timestamp="2024-08-30T14:15:55" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="Variables Pane" timestamp="2024-08-30T14:15:55" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="Python Variables Pane" timestamp="2024-08-30T14:16:02" tests="1" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="16.894" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Variables Pane Python Variables Pane Verifies Variables pane basic function with python interpreter [C628634] #pr" time="2.241" classname="Verifies Variables pane basic function with python interpreter [C628634] #pr">
    </testcase>
  </testsuite>
  <testsuite name="R Variables Pane" timestamp="2024-08-30T14:16:19" tests="1" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="3.089" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Variables Pane R Variables Pane Verifies Variables pane basic function with R interpreter [C628635] #pr" time="2.223" classname="Verifies Variables pane basic function with R interpreter [C628635] #pr">
    </testcase>
  </testsuite>
  <testsuite name="Data Explorer" timestamp="2024-08-30T14:16:22" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="Python Pandas Data Explorer" timestamp="2024-08-30T14:16:29" tests="3" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="25.779" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer Python Pandas Data Explorer Python Pandas - Verifies basic data explorer functionality [C557556] #pr" time="2.356" classname="Python Pandas - Verifies basic data explorer functionality [C557556] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer Python Pandas Data Explorer Python Pandas - Verifies data explorer functionality with empty fields [C718262] #pr" time="2.277" classname="Python Pandas - Verifies data explorer functionality with empty fields [C718262] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer Python Pandas Data Explorer Python Pandas - Verifies data explorer column info functionality [C734263] #pr" time="2.199" classname="Python Pandas - Verifies data explorer column info functionality [C734263] #pr">
    </testcase>
  </testsuite>
  <testsuite name="Python Polars Data Explorer" timestamp="2024-08-30T14:16:55" tests="4" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="10.872" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer Python Polars Data Explorer Python Polars - Verifies basic data explorer functionality [C644538] #pr" time="3.567" classname="Python Polars - Verifies basic data explorer functionality [C644538] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer Python Polars Data Explorer Python Polars - Verifies basic data explorer column info functionality [C734264] #pr" time="2.057" classname="Python Polars - Verifies basic data explorer column info functionality [C734264] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer Python Polars Data Explorer Python Polars - Add Simple Column filter [C557557] #pr" time="1.633" classname="Python Polars - Add Simple Column filter [C557557] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer Python Polars Data Explorer Python Polars - Add Simple Column Sort [C557561] #pr" time="2.770" classname="Python Polars - Add Simple Column Sort [C557561] #pr">
    </testcase>
  </testsuite>
  <testsuite name="R Data Explorer" timestamp="2024-08-30T14:17:06" tests="3" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="5.083" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer R Data Explorer R - Verifies basic data explorer functionality [C609620] #pr" time="2.161" classname="R - Verifies basic data explorer functionality [C609620] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer R Data Explorer R - Verifies basic data explorer column info functionality [C734265] #pr" time="2.048" classname="R - Verifies basic data explorer column info functionality [C734265] #pr">
    </testcase>
  </testsuite>
  <testsuite name="Plots" timestamp="2024-08-30T14:17:11" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="Python Plots" timestamp="2024-08-30T14:17:18" tests="10" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="38.757" failures="1">
    <testcase name="VSCode Smoke Tests (Electron) Plots Python Plots Python - Verifies basic plot functionality - Dynamic Plot [C608114] #pr" time="2.618" classname="Python - Verifies basic plot functionality - Dynamic Plot [C608114] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Plots Python Plots Python - Verifies basic plot functionality - Static Plot [C654401] #pr" time="21.706" classname="Python - Verifies basic plot functionality - Static Plot [C654401] #pr">
      <failure message="Timeout: get element &apos;.plot-instance.static-plot-instance img&apos; after 20 seconds." type="Error"><![CDATA[Error: Timeout: get element '.plot-instance.static-plot-instance img' after 20 seconds.
    at Code.poll (/home/runner/work/positron/positron/test/automation/out/code.js:204:23)
    at async Code.waitForElement (/home/runner/work/positron/positron/test/automation/out/code.js:163:16)
    at async PositronPlots.waitForCurrentStaticPlot (/home/runner/work/positron/positron/test/automation/out/positron/positronPlots.js:39:9)
    at async Context.<anonymous> (out/areas/positron/plots/plots.test.js:117:17)]]></failure>
    </testcase>
  </testsuite>
  <testsuite name="R Plots" timestamp="2024-08-30T14:17:57" tests="6" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="3.279" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Plots R Plots R - Verifies basic plot functionality [C628633] #pr" time="2.368" classname="R - Verifies basic plot functionality [C628633] #pr">
    </testcase>
  </testsuite>
  <testsuite name="Data Explorer - Large Data Frame" timestamp="2024-08-30T14:18:00" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="Python Data Explorer (Large Data Frame)" timestamp="2024-08-30T14:18:07" tests="1" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="47.935" failures="2">
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer - Large Data Frame Python Data Explorer (Large Data Frame) &quot;before all&quot; hook for &quot;Python - Verifies data explorer functionality with large data frame [C557555] #pr&quot;" time="27.137" classname="&quot;before all&quot; hook for &quot;Python - Verifies data explorer functionality with large data frame [C557555] #pr&quot;">
      <failure message="Timeout: get elements &apos;.console-instance[style*=&quot;z-index: auto&quot;] div span&apos; after 20 seconds." type="Error"><![CDATA[Error: Timeout: get elements '.console-instance[style*="z-index: auto"] div span' after 20 seconds.
    at Code.poll (/home/runner/work/positron/positron/test/automation/out/code.js:204:23)
    at async Code.waitForElements (/home/runner/work/positron/positron/test/automation/out/code.js:160:16)
    at async PositronConsole.waitForConsoleContents (/home/runner/work/positron/positron/test/automation/out/positron/positronConsole.js:163:26)
    at async PositronConsole.waitForReady (/home/runner/work/positron/positron/test/automation/out/positron/positronConsole.js:112:9)
    at async PositronPythonFixtures.startPythonInterpreter (/home/runner/work/positron/positron/test/automation/out/positron/fixtures/positronPythonFixtures.js:29:13)
    at async PositronPythonFixtures.SetupFixtures (/home/runner/work/positron/positron/test/automation/out/positron/fixtures/positronPythonFixtures.js:19:9)
    at async Context.<anonymous> (out/areas/positron/dataexplorer/largeDataFrame.test.js:24:17)]]></failure>
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer - Large Data Frame Python Data Explorer (Large Data Frame) &quot;after all&quot; hook for &quot;Python - Verifies data explorer functionality with large data frame [C557555] #pr&quot;" time="20.796" classname="&quot;after all&quot; hook for &quot;Python - Verifies data explorer functionality with large data frame [C557555] #pr&quot;">
      <failure message="Timeout: click &apos;.tab .codicon-close&apos; after 20 seconds." type="Error"><![CDATA[Error: Timeout: click '.tab .codicon-close' after 20 seconds.
    at Code.poll (/home/runner/work/positron/positron/test/automation/out/code.js:204:23)
    at async Code.waitAndClick (/home/runner/work/positron/positron/test/automation/out/code.js:154:9)
    at async PositronDataExplorer.closeDataExplorer (/home/runner/work/positron/positron/test/automation/out/positron/positronDataExplorer.js:74:9)
    at async Context.<anonymous> (out/areas/positron/dataexplorer/largeDataFrame.test.js:28:17)]]></failure>
    </testcase>
  </testsuite>
  <testsuite name="R Data Explorer (Large Data Frame)" timestamp="2024-08-30T14:18:55" tests="1" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="141.501" failures="2">
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer - Large Data Frame R Data Explorer (Large Data Frame) &quot;before all&quot; hook for &quot;R - Verifies data explorer functionality with large data frame [C557554] #pr&quot;" time="120.001" classname="&quot;before all&quot; hook for &quot;R - Verifies data explorer functionality with large data frame [C557554] #pr&quot;">
      <failure message="Timeout of 120000ms exceeded. For async tests and hooks, ensure &quot;done()&quot; is called; if returning a Promise, ensure it resolves. (/home/runner/work/positron/positron/test/smoke/out/main.js)" type="Error"><![CDATA[Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/positron/positron/test/smoke/out/main.js)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)]]></failure>
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Data Explorer - Large Data Frame R Data Explorer (Large Data Frame) &quot;after all&quot; hook for &quot;R - Verifies data explorer functionality with large data frame [C557554] #pr&quot;" time="20.996" classname="&quot;after all&quot; hook for &quot;R - Verifies data explorer functionality with large data frame [C557554] #pr&quot;">
      <failure message="Timeout: click &apos;.tab .codicon-close&apos; after 20 seconds." type="Error"><![CDATA[Error: Timeout: click '.tab .codicon-close' after 20 seconds.
    at Code.poll (/home/runner/work/positron/positron/test/automation/out/code.js:204:23)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7)
    at async Code.waitAndClick (/home/runner/work/positron/positron/test/automation/out/code.js:154:9)
    at async PositronDataExplorer.closeDataExplorer (/home/runner/work/positron/positron/test/automation/out/positron/positronDataExplorer.js:74:9)
    at async Context.<anonymous> (out/areas/positron/dataexplorer/largeDataFrame.test.js:64:17)]]></failure>
    </testcase>
  </testsuite>
  <testsuite name="Notebooks" timestamp="2024-08-30T14:21:17" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="Python Notebooks" timestamp="2024-08-30T14:21:24" tests="2" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="22.037" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Notebooks Python Notebooks Python - Basic notebook creation and execution (code) [C628631] #pr" time="4.843" classname="Python - Basic notebook creation and execution (code) [C628631] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Notebooks Python Notebooks Python - Basic notebook creation and execution (markdown) [C628632] #pr" time="1.548" classname="Python - Basic notebook creation and execution (markdown) [C628632] #pr">
    </testcase>
  </testsuite>
  <testsuite name="Notebooks" timestamp="2024-08-30T14:21:47" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="R Notebooks" timestamp="2024-08-30T14:21:54" tests="2" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="12.547" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Notebooks R Notebooks R - Basic notebook creation and execution (code) [C628629] #pr" time="3.616" classname="R - Basic notebook creation and execution (code) [C628629] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Notebooks R Notebooks R - Basic notebook creation and execution (markdown) [C628630] #pr" time="2.218" classname="R - Basic notebook creation and execution (markdown) [C628630] #pr">
    </testcase>
  </testsuite>
  <testsuite name="New Project Wizard" timestamp="2024-08-30T14:22:07" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="Python - New Project Wizard" timestamp="2024-08-30T14:22:07" tests="1" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) New Project Wizard Python - New Project Wizard Default Python Project with git init [C674522] #pr" time="31.157" classname="Default Python Project with git init [C674522] #pr">
    </testcase>
  </testsuite>
  <testsuite name="Python Project with new environment" timestamp="2024-08-30T14:22:45" tests="2" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="24.580" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) New Project Wizard Python - New Project Wizard Python Project with new environment Create a new Venv environment [C627912] #pr" time="24.076" classname="Create a new Venv environment [C627912] #pr">
    </testcase>
  </testsuite>
  <testsuite name="R - New Project Wizard" timestamp="2024-08-30T14:23:10" tests="1" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="17.349" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) New Project Wizard R - New Project Wizard R Project Defaults [C627913] #pr" time="9.066" classname="R Project Defaults [C627913] #pr">
    </testcase>
  </testsuite>
  <testsuite name="Jupyter - New Project Wizard" timestamp="2024-08-30T14:23:27" tests="1" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="17.625" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) New Project Wizard Jupyter - New Project Wizard Jupyter Project Defaults [C629352] #pr" time="9.047" classname="Jupyter Project Defaults [C629352] #pr">
    </testcase>
  </testsuite>
  <testsuite name="Variables Pane - Notebook" timestamp="2024-08-30T14:23:45" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="Python Notebook Variables Pane" timestamp="2024-08-30T14:23:52" tests="1" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="20.510" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Variables Pane - Notebook Python Notebook Variables Pane Verifies Variables pane basic function for notebook with python interpreter [C669188] #pr" time="4.559" classname="Verifies Variables pane basic function for notebook with python interpreter [C669188] #pr">
    </testcase>
  </testsuite>
  <testsuite name="Variables Pane - Notebook" timestamp="2024-08-30T14:24:13" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="R Notebook Variables Pane" timestamp="2024-08-30T14:24:20" tests="1" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="11.894" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Variables Pane - Notebook R Notebook Variables Pane Verifies Variables pane basic function for notebook with R interpreter [C669189] #pr" time="4.759" classname="Verifies Variables pane basic function for notebook with R interpreter [C669189] #pr">
    </testcase>
  </testsuite>
  <testsuite name="Console ANSI styling" timestamp="2024-08-30T14:24:32" tests="0" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="0.000" failures="0">
  </testsuite>
  <testsuite name="R - Console ANSI styling" timestamp="2024-08-30T14:24:40" tests="3" file="/home/runner/work/positron/positron/test/smoke/out/main.js" time="13.315" failures="0">
    <testcase name="VSCode Smoke Tests (Electron) Console ANSI styling R - Console ANSI styling R - Can produce clickable file links [C683069] #pr" time="0.723" classname="R - Can produce clickable file links [C683069] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Console ANSI styling R - Console ANSI styling R - Can produce clickable help links [C683070] #pr" time="3.752" classname="R - Can produce clickable help links [C683070] #pr">
    </testcase>
    <testcase name="VSCode Smoke Tests (Electron) Console ANSI styling R - Console ANSI styling R - Can produce colored output [C683071] #pr" time="0.214" classname="R - Can produce colored output [C683071] #pr">
    </testcase>
  </testsuite>
</testsuites>
Testinator-X commented 2 months ago

@acuanico-tr-galt

I am getting a similar error when I try to run the tests. I find that somehow strange. Shouldn't the tests run when a new version is built? How can this happen? Or what am I doing wrong when running the tests?

ERROR tests/test_api_data_provider.py - serde.compat.SerdeError: Method trcli.data_classes.dataclass_testrail.TestRailResult.__init__() parameter version="None" violates type hint <class 'str'>, as <class "builtins.NoneType"> "None" not instanc...
ERROR tests/test_junit_parser.py
ERROR tests/test_robot_parser.py

Error

SnarkyWraith commented 2 months ago

Getting a similar error to testlabauto that started today except it seems to be int related. We've confirmed that using the 1.9.5 version does not result in the error.

Parsing JUnit report. Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/trcli", line 8, in sys.exit(cli()) ^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/click/core.py", line 1157, in call return self.main(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/trcli/cli.py", line 242, in main return super().main(windows_expand_args=False, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/trcli/commands/results_parser_helpers.py", line 101, in wrapper_common_options return f(*args, kwargs) ^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/click/decorators.py", line 92, in new_func return ctx.invoke(f, obj, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/click/core.py", line 783, in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/trcli/commands/cmd_parse_junit.py", line 34, in cli parsed_suites = JunitParser(environment).parse_file() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/trcli/readers/junit_xml.py", line 155, in parse_file result = TestRailResult( ^^^^^^^^^^^^^^^ File "<@beartype(trcli.data_classes.dataclass_testrail.TestRailResult.init) at 0x7f49a8806980>", line 35, in init serde.compat.SerdeError: Method trcli.data_classes.dataclass_testrail.TestRailResult.init__() parameter case_id="None" violates type hint <class 'int'>, as <class "builtins.NoneType"> "None" not instance of int.

JBelisle commented 2 months ago

I am getting a similar int parsing error with importing a junit file, and reverting to 1.9.5 resolves it.

marloncabracaGL commented 2 months ago

I'm having similar error, File "<@beartype(trcli.data_classes.dataclass_testrail.create_fn.init) at 0x7f71b2d9a280>", line 35, in init serde.compat.SerdeError: Method trcli.data_classes.dataclass_testrail.create_fn.init() parameter case_id="None" violates type hint <class 'int'>, as <class "builtins.NoneType"> "None" not instance of int.

victor-chan-groundswell commented 2 months ago

@marloncabracaGL seeing the exact error as well.... pinning the package back to 1.9.5 resolves it.

dorlandode commented 2 months ago

Also seeing this error. Pinning to 1.9.5 to resolve.

acuanico-tr-galt commented 2 months ago

Thanks for raising this issue. We are now looking at it.

mjeruzal427 commented 2 months ago

I have the very same error when using trcli version 1.9.6, however it appears only when I am trying to publish the results from the bitbucket pipeline. When I am trying to publish results from my computer it works fine (I have 1.9.6 installed too).

Forcing the pipeline to download version 1.9.5 solves the issue for now.

TestRail CLI v1.9.6
Copyright 2024 Gurock Software GmbH - www.gurock.com
Parser Results Execution Parameters
> Report file: test-results/junit-report.xml
> Config file: trcli-config.yml
> TestRail instance: {{host}} (user: {{user_mail_address}})
> Project: {{project_name}}
> Run title: Playwright Automated Test Run - qa - 2024-09-02
> Update run: No
> Add to milestone: No
> Auto-create entities: False
Parsing JUnit report.
Traceback (most recent call last):
  File "/usr/local/bin/trcli", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/trcli/cli.py", line 242, in main
    return super().main(windows_expand_args=False, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/trcli/commands/results_parser_helpers.py", line 101, in wrapper_common_options
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/trcli/commands/cmd_parse_junit.py", line 34, in cli
    parsed_suites = JunitParser(environment).parse_file()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/trcli/readers/junit_xml.py", line 155, in parse_file
    result = TestRailResult(
             ^^^^^^^^^^^^^^^
  File "<@beartype(trcli.data_classes.dataclass_testrail.TestRailResult.__init__) at 0x7f6170327a60>", line 111, in __init__
serde.compat.SerdeError: Method trcli.data_classes.dataclass_testrail.TestRailResult.__init__() parameter elapsed=4.588 violates type hint <class 'str'>, as float 4.588 not instance of str.
acuanico-tr-galt commented 2 months ago

Hi! We have published a fix for the issue above. This relates to the pyserde dependency strict type enforcement. Kindly check the latest release v1.9.7. We appreciate your support and understanding.