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

junit: Add timestamp for suite start time #201

Merged
merged 2 commits into from Jun 16, 2021

Conversation

cpuguy83
Copy link
Contributor

The junit schema defines this attribute on the testsuite.
In my case I need to import test results totally separate from the
testing pipeline since these are in two different systems. This
timestamp ensures the result processor puts the results into the right
time frame instead of assuming it just ran.

Fixes #200

The junit schema defines this attribute on the testsuite.
In my case I need to import test results totally separate from the
testing pipeline since these are in two different systems. This
timestamp ensures the result processor puts the results into the right
time frame instead of assuming it just ran.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@cpuguy83
Copy link
Contributor Author

Example data where this is used:

image

Generated from:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
	<testsuite tests="28" failures="0" time="1.520000" name="github.com/docker/docker/volume/service" timestamp="2021-06-15T21:29:47.087690318Z">
		<properties>
			<property name="go.version" value="go1.16.2 linux/amd64"></property>
		</properties>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFilterFunc/test_nil_list" time="0.000000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFilterFunc/test_nothing_to_fitler_non-empty_list" time="0.000000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFilterFunc/test_filter_non-empty_to_empty" time="0.000000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFilterFunc/test_empty_list" time="0.000000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFilterFunc/test_filter_middle_and_last" time="0.000000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFilterFunc/test_filter_first_and_last" time="0.000000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFilterFunc/test_filter_middle" time="0.000000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFilterFunc/test_filter_some" time="0.000000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFilterFunc" time="0.000000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestSetGetMeta" time="0.060000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestDefererencePluginOnCreateError" time="0.070000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestServiceRemove" time="0.080000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestList" time="0.110000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestServiceList" time="0.090000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestServiceCreate" time="0.090000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestLocalVolumeSize" time="0.080000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestRestore" time="0.090000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestGet" time="0.080000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestRefDerefRemove" time="0.080000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestDerefMultipleOfSameRef" time="0.050000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestGetWithReference" time="0.100000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestCreateKeepOptsLabelsWhenExistsRemotely" time="0.060000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestCreate" time="0.050000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFindByReferenced" time="0.080000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestFindByDriver" time="0.080000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestServiceGet" time="0.060000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestRemove" time="0.090000"></testcase>
		<testcase classname="github.com/docker/docker/volume/service" name="TestServicePrune" time="0.120000"></testcase>
	</testsuite>
</testsuites>

Now the question is, is Azure doing the times right for the test by looking at elapsed time. Those tests are all fast enough where it doesn't matter... but at least the data is there now 😄

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you!

@dnephin dnephin merged commit 012a85e into gotestyourself:main Jun 16, 2021
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

Successfully merging this pull request may close these issues.

Missing timestamps
2 participants