Skip to content
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

Is test_possibly_better() in test/test_hoe.rb really accurate? #106

Closed
dleidert opened this issue Mar 30, 2020 · 2 comments
Closed

Is test_possibly_better() in test/test_hoe.rb really accurate? #106

dleidert opened this issue Mar 30, 2020 · 2 comments

Comments

@dleidert
Copy link

We observe a test failure when running the testsuite on Debian with Ruby 2.7:

[..]
> TestHoe#test_possibly_better = 0.00 s = F
> TestHoe#test_nosudo = 0.00 s = .
> TestHoe#test_setting_licenses = 0.00 s = .
> TestHoePublish#test_make_rdoc_cmd = 0.00 s = .
> 
> Finished in 0.084995s, 376.4912 runs/s, 1153.0043 assertions/s.
> 
>   1) Failure:
> TestHoe#test_possibly_better [/<<PKGBUILDDIR>>/test/test_hoe.rb:274]:
> Expected: 2020-02-23 00:00:00 UTC
>   Actual: 2020-02-06 00:00:00 UTC

The date expected is the result of Gem::Specification::TODAY whereas the actual date always is determined by the date of the actual file hoe.gemspec (not the date value inside). Can you please explain what you actually expect to happen here?

Here is the bug report against the Debian package:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=952041

@dleidert dleidert changed the title Is test_possibly_better in test/test_hoe.rb really accurate? Is test_possibly_better() in test/test_hoe.rb really accurate? Mar 30, 2020
@utkarsh2102
Copy link

Heh, I get:

Failure:
TestHoe#test_possibly_better [/home/utkarsh/debian/ruby-team/hoe/ruby-hoe/test/test_hoe.rb:274]:
Expected: 2020-04-02 00:00:00 UTC
  Actual: 2020-03-02 00:00:00 UTC

@dleidert
Copy link
Author

dleidert commented Apr 2, 2020

We've found the cause. The issue is only visible when packaging hoe for downstream, installing the gem into a directory and then run the tests with Ruby 2.7 and this directory in RUBYLIB/GEM_PATH. The relevant change in Ruby 2.7, which caused this, is (to our research) in rubygems/specification.rb (changing :date from TODAY to nil). dd845b9#diff-715213bedd26ddebc71af81759d8fd75L3 actually fixes the problem. I'm therefor closing this report myself.

@dleidert dleidert closed this as completed Apr 2, 2020
@seattlerb seattlerb locked and limited conversation to collaborators Jan 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants