nunit/nunit-framework — pull request #94 by rprouse (2014-02-11 02:16:05+00:00)
Title: Report start and end time of test execution

Fix for the following issues, https://github.com/nunit/nunit-framework/issues/31 and https://github.com/nunit/nunit-console/issues/13

After renaming time to duration, I decided to make the XML representation of the duration a double. I did this because XSLT transformations support number types allowing the string representation to be converted back into a double which can then be manipulated in the transform or displayed in a culturally correct way. There is no equivalent conversion for TimeSpan, so it would remain a string in an Invariant Culture.

As Charlie stated in the issue, changing time to duration is a breaking change, but the NUnit 3 XML format is radically different than version 2.

Since changing time to duration required making sure those changes worked, I fixed the nunit-console issue of the total time not being reported along with this issue.

For the start and end, I elected to just include start-time and end-time elements as a UTC representation in Universal sortable date/time pattern, for example, 2009-06-15 20:45:30Z. I decided to use UTC because teams often work remotely and build servers are often in different timezones than developers. I think the XML should remain UTC, but we might want to output a more friendly format in the console runner.

We have been talking about parallel test execution a lot lately, so that got me thinking. The way the framework has always tracked the duration of the run is to add up the duration of all children and pass it up. If test are running in parallel, the result will be that `end - start` will likely not equal `duration`. I don't know if this is a problem that we should fix in code or if it just warrants a mention in the documentation.

In addition to the existing unit tests, I have tested by running the framework test-harness, nunitlite and nunit-console and where it was an option for each producing nunit v3 and v2 xml results.