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

unable to import results for test cases having a very long title #207

Closed bitcoder closed 4 months ago

bitcoder commented 4 months ago

TestRail CLI Version

1.9.0

CLI Environment

Mac + Python 3.10

TestRail Version

TestRail v8.0.3 Default (3067)

TestRail Instance Type

Enterprise Cloud

Current behavior

If we try to upload a JUnit XML report having tests with a very long name it will fail (even though we may have the custom field automation_id defined as text. The problem reported by the TR CLI is: Field :title is too long (250 characters at most)..

<testsuites id="" name="" tests="15" failures="0" skipped="0" errors="0" time="16.813736">
<testsuite name="frontend" timestamp="2023-10-11T03:58:09.528Z" hostname="chromium" tests="5" failures="0" skipped="0" time="12.734" errors="0">
<testcase name="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec." classname="e2e/dummy/testrail.spec.ts" time="2.858">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Add Surat Pesanan] User able to choose Jenis SP&quot;" classname="e2e/dummy/testrail.spec.ts" time="2.815">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Add Surat Pesanan] User able to choose SP Reguler" classname="e2e/dummy/testrail.spec.ts" time="2.367">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Add Surat Pesanan] User able to see field Apoteker Penanggung Jawab and this field disable to input" classname="e2e/dummy/testrail.spec.ts" time="1.946">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Tambah Surat Pesanan] [Detail Surat Pesanan] User can click button &quot;+&quot;" classname="e2e/dummy/testrail.spec.ts" time="2.748">
</testcase>
</testsuite>
<testsuite name="backend" timestamp="2023-10-11T03:58:09.528Z" hostname="firefox" tests="5" failures="0" skipped="0" time="19.474" errors="0">
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [List Surat Pesanan] User able to see button &quot;Tambah&quot;" classname="e2e/dummy/testrail.spec.ts" time="4.489">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Add Surat Pesanan] User able to choose Jenis SP&quot;" classname="e2e/dummy/testrail.spec.ts" time="4.54">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Add Surat Pesanan] User able to choose SP Reguler" classname="e2e/dummy/testrail.spec.ts" time="4.058">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Add Surat Pesanan] User able to see field Apoteker Penanggung Jawab and this field disable to input" classname="e2e/dummy/testrail.spec.ts" time="3.187">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Tambah Surat Pesanan] [Detail Surat Pesanan] User can click button &quot;+&quot;" classname="e2e/dummy/testrail.spec.ts" time="3.2">
</testcase>
</testsuite>
<testsuite name="middleend" timestamp="2023-10-11T03:58:09.528Z" hostname="webkit" tests="5" failures="0" skipped="0" time="12.824" errors="0">
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [List Surat Pesanan] User able to see button &quot;Tambah&quot;" classname="e2e/dummy/testrail.spec.ts" time="2.619">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Add Surat Pesanan] User able to choose Jenis SP&quot;" classname="e2e/dummy/testrail.spec.ts" time="3.479">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Add Surat Pesanan] User able to choose SP Reguler" classname="e2e/dummy/testrail.spec.ts" time="2.698">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Add Surat Pesanan] User able to see field Apoteker Penanggung Jawab and this field disable to input" classname="e2e/dummy/testrail.spec.ts" time="1.028">
</testcase>
<testcase name="Surat Pesanan, Positive Case @testrail @dummy › [Tambah Surat Pesanan] [Detail Surat Pesanan] User can click button &quot;+&quot;" classname="e2e/dummy/testrail.spec.ts" time="3">
</testcase>
</testsuite>
</testsuites>
TestRail CLI v1.9.0
Copyright 2024 Gurock Software GmbH - www.gurock.com
Parser Results Execution Parameters
> Report file: junit_long.xml
> Config file: None
> TestRail instance: https://testrailsademo.testrail.io
> Project: SFEXP
> Run title: results
> Update run: No
> Add to milestone: No
> Auto-create entities: True
Parsing JUnit report.
Processed 5 test cases in section frontend.
Processed 5 test cases in section backend.
Processed 5 test cases in section middleend.
Checking project. Done.
Found 1 test cases not matching any TestRail case.
Adding missing sections to the suite.
Adding missing test cases to the suite.
Adding test cases: 0/10
Error during add_case. Trying to cancel scheduled tasks.

Aborting: add_case. Trying to cancel scheduled tasks.
Adding test cases: 0/10
Field :title is too long (250 characters at most).
...

Desired behavior

I would expect that the report file, no matter its format, is upload with success.

More Details

No response

bitcoder commented 4 months ago

It's not expectable to have a very long title on test cases but we can think on a workaround. this is applicable to all current report formats (junit xml, robot framework xml, open api perhaps)

AlexTRGit commented 4 months ago

Hello, one question first. As I already read from the previous posts, should we still configure the automation_id to be Type:Text? TestRailGit

Please advise if this is OK or not.