Skip to content

Cobertura timestamp should be UTC, but is not #750

@dnmh-psc

Description

@dnmh-psc

Describe the bug
Report Generator changes the Cobertura report timestamp from UTC to Local time. It should keep it as UTC.

To Reproduce

  1. Generate a dotnet test result from a unit test project:

dotnet test MyProject.UnitTests.csproj --logger trx --configuration Release --no-restore --collect:"XPlat Code Coverage" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura

  1. Check the resulting coverage.cobertura.xml file and see that the timestamp is on Unix Epoch Timestamp (which is always UTC).

  2. Run the report generator:

reportgenerator -reports:'MyProject.UnitTests\TestResults\*\coverage.cobertura.xml' -targetdir:'CoverageResults' -reporttypes:'Cobertura' -filefilters:'+*.cs' -verbosity:'Warning'

  1. The resulting report in the folder CoverageResults now has a timestamp which is in the local time zone. There is no time zone value in the timestamp, so there is no way of knowing in which time zone the report is generated. Therefore, it should always be in UTC.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions