Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid format: "00:00:18" is not NET duration #83

Closed
Shazwazza opened this issue Mar 23, 2021 · 0 comments
Closed

Invalid format: "00:00:18" is not NET duration #83

Shazwazza opened this issue Mar 23, 2021 · 0 comments

Comments

@Shazwazza
Copy link
Contributor

Hi, I've noticed that on some special occasions the dotnet trx file will output a duration that isn't parsed by this regex:

const durationRe = /^(\d\d):(\d\d):(\d\d\.\d+)$/

I'm unsure under what circumstances this duration ends up being different from the others but seems its possible to end up with a format other than the typical 00:00:00.0120000 style. Below is the xml fragment causing the issue:

<UnitTestResult executionId="a35d36d2-be5e-4df1-97bf-edcf5bb32fbe" testId="c09012a9-dca9-30d9-25de-f0be315359ca" testName="Index_Read_And_Write_Ensure_No_Errors_In_Async(2000,5000,20,50,100,50,True)" computerName="fv-az28-465" duration="00:00:18" startTime="2021-03-22T23:52:27.0000000+00:00" endTime="2021-03-22T23:52:45.0000000+00:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="a35d36d2-be5e-4df1-97bf-edcf5bb32fbe">

where duration="00:00:18" so seems like the milliseconds are optional.

dorny added a commit to Shazwazza/test-reporter that referenced this issue Mar 23, 2021
@dorny dorny mentioned this issue Mar 23, 2021
@dorny dorny closed this as completed in c0e7f7f Mar 23, 2021
dorny added a commit that referenced this issue Mar 23, 2021
Fixes #83 - parsing .NET duration without milliseconds throws error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant