-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
incorrect time in nunit xml file #1879
Comments
Is UTC standard in NUnit-reports or Azure DevOps-specific? I'm wondering if a default change would break most CI.
https://docs.nunit.org/articles/nunit/technical-notes/usage/Test-Result-XML-Format.html Pester uses local time in both NUnit2.5-report and Passthru-object. Should UTC be a global option in PesterConfiguration-maybe? |
I think we should finally move to the latest nunit xml format. It's way better specified than 2.5. Adding to next milestone as it is a quite big task. |
nunit/nunit#3879 (comment) check this for the latest nunit docs. |
@fflaten do you want to work on this in this milestone (maybe two more weeks before "final" beta?) or should I move it to the next one. |
Might not make this one but it'll try. Worked on nunit3 a couple of days ago, but it's been a busy week. |
General summary of the issue
The time in Nunit XML file is the local time. Not the UTC time. Therefor all my tests are run in the future.
Describe your environment
Pester version : 5.1.1 C:\Program Files\WindowsPowerShell\Modules\Pester\5.1.1\Pester.psm1
PowerShell version : 5.1.14409.1018
OS version : Microsoft Windows NT 6.3.9600.0
Steps to reproduce
Run any test and create a nunit.xml file.
Look at the second line and in the end you will see the time. This time is my local time (CET) and not the UTC time
When uploading this file to azure devops, it assumes it is UTC and all my tests are now in the future.
Expected Behavior
test-results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="nunit_schema_2.5.xsd" name="Pester" total="62" errors="0" failures="0" not-run="92" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2021-03-19" time="18:25:01"
Current Behavior
test-results xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="nunit_schema_2.5.xsd" name="Pester" total="62" errors="0" failures="0" not-run="92" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2021-03-19" time="19:25:01"
Possible Solution? (optional)
Convert the time to UTC time. Powershell has some functions for it.
Something like
$TimeNow = Get-Date
get-date $TimeNow -f "MMddyy HH:mm:ss"
$TimeNow.ToUniversalTime().ToString("MMddyy HH:mm:ss")
The text was updated successfully, but these errors were encountered: