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

Missing timestamps #200

Closed
cpuguy83 opened this issue Jun 15, 2021 · 4 comments · Fixed by #201
Closed

Missing timestamps #200

cpuguy83 opened this issue Jun 15, 2021 · 4 comments · Fixed by #201
Labels
enhancement New feature or request

Comments

@cpuguy83
Copy link
Contributor

I was looking at importing test results into an Azure DevOps pipline and noticed that the test results don't have timestamps for the testsuites even though test2json includes this in even stream.

What ends up happening is the importer makes the assumption the test run is for time.Now() instead of when the test was actually run.
Would you be opposed a change to add this?

@cpuguy83
Copy link
Contributor Author

I think even adding a timestamp with time.Now() here would be better than omitting it:

junitpkg := JUnitTestSuite{
Name: cfg.FormatTestSuiteName(pkgname),
Tests: pkg.Total,
Time: formatDurationAsSeconds(pkg.Elapsed()),
Properties: packageProperties(version),
TestCases: packageTestCases(pkg, cfg.FormatTestCaseClassname),
Failures: len(pkg.Failed),
}

@dnephin dnephin added the enhancement New feature or request label Jun 15, 2021
@dnephin
Copy link
Member

dnephin commented Jun 15, 2021

I think this would be a good addition, thanks for opening the issue! The TestEvent struct has a timestamp field, but it never gets copied over to the TestCase struct. That would let us use the real timestamp from the TestEvent.

Do you know where this data is supposed to show up in the Junit XML? Do we need to add a new tag or is it an attribute on TestSuite ?

The current time attribute is being set to the elapsed time not wall clock time, so hopefully it's not that same attribute.

@cpuguy83
Copy link
Contributor Author

According to this schema, there is a timestamp attribute on testsuite

@cpuguy83
Copy link
Contributor Author

#201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants