Control: tag -1 pending On Sat, Aug 27, 2016 at 03:15:53PM +0530, Pirate Praveen wrote: > package: gem2deb > version: 0.32 > severity: wishlist > > I'm trying to backport gem2deb 0.32 to jessie and one test fails. > > test: timestamps should use date from changelog if available. :F > ================================================================================ > Failure: test: timestamps should use date from changelog if available. > (MetaDataTest) > /home/pravi/gem2deb-0.32/test/unit/metadata_test.rb:235:in `block (2 > levels) in <class:MetaDataTest>' > <2015-11-20 00:00:00 UTC> expected but was > <2015-11-21 00:00:00 UTC> > > diff: > ? 2015-11-20 00:00:00 UTC > ? 1 > ================================================================================
Insteresting. It's an issue that only manifests depending on the hour of
the day, and on some timezones.
----------------8<----------------8<----------------8<-----------------
$ ruby test/unit/metadata_test.rb
Loaded suite test/unit/metadata_test
Started
...................................
Finished in 1.288412217 seconds.
35 tests, 42 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0
notifications
100% passed
27.17 tests/s, 32.60 assertions/s
$ TZ=Asia/Kolkata ruby test/unit/metadata_test.rb
Loaded suite test/unit/metadata_test
Started
.........F
===============================================================================
Failure:
test: timestamps should use date from changelog if available. (MetaDataTest)
test/unit/metadata_test.rb:235:in `block (2 levels) in <class:MetaDataTest>'
/usr/lib/ruby/vendor_ruby/shoulda/context/context.rb:413:in `instance_exec'
/usr/lib/ruby/vendor_ruby/shoulda/context/context.rb:413:in `block in
create_test_from_should_hash'
<2015-11-20 00:00:00 UTC> expected but was
<2015-11-21 00:00:00 UTC>
diff:
? 2015-11-20 00:00:00 UTC
? 1
===============================================================================
.........................
Finished in 1.269540744 seconds.
35 tests, 42 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0
notifications
97.1429% passed
27.57 tests/s, 33.08 assertions/s
----------------8<----------------8<----------------8<-----------------
Gem::Specification.date= in jessie seems to hot handle timezones correctly.
----------------8<----------------8<----------------8<-----------------
$ cat /tmp/testtime.rb
require 'time'
gemspec = Gem::Specification.new
gemspec.date = Time.parse('Fri, 20 Nov 2015 18:46:52 -0200')
puts gemspec.date
----------------8<----------------8<----------------8<-----------------
on sid:
----------------8<----------------8<----------------8<-----------------
$ cat /etc/debian_version
stretch/sid
$ ruby /tmp/testtime.rb
2015-11-20 00:00:00 UTC
$ TZ=Asia/Kolkata ruby /tmp/testtime.rb
2015-11-20 00:00:00 UTC
----------------8<----------------8<----------------8<-----------------
on jessie:
----------------8<----------------8<----------------8<-----------------
$ cat /etc/debian_version
8.5
$ ruby /tmp/testtime.rb
2015-11-20 00:00:00 UTC
$ TZ=Asia/Kolkata ruby /tmp/testtime.rb
2015-11-21 00:00:00 UTC
----------------8<----------------8<----------------8<-----------------
A fix is to use `Date` instead of `Time`. It's fixed in git, but I won't upload
just because of this.
signature.asc
Description: PGP signature

