dashingrocket / simplecov-cobertura

Ruby SimpleCov Cobertura Formatter
Apache License 2.0
52 stars 38 forks source link

timestamp generated in the report header is old #12

Closed bheemreddy181-zz closed 4 years ago

bheemreddy181-zz commented 4 years ago

The timestamp generated in report header seems wrong

<?xml version='1.0'?> 
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<!-- Generated by simplecov-cobertura version 1.3.1 (https://github.com/dashingrocket/simplecov-cobertura) -->
<coverage line-rate="1.0" branch-rate="0" lines-covered="226" lines-valid="226" branches-covered="0" branches-valid="0" complexity="0" version="0" timestamp="1476766800">
Screen Shot 2020-07-14 at 09 57 38
jessebs commented 4 years ago

I am unable to recreate the problem. Can you create a sample project that reproduces the problem and share it?

The timestamp is generated by a call to Time.now.to_i.to_s. Are you using timecop or mocking Time.now in your tests? Is the time correct on the machine you using to generate the coverage report?

bheemreddy181-zz commented 4 years ago

Thanks @jessebs it is because of the Timecop.freeze. It's working fine now.