Closed domcleal closed 7 years ago
https://github.com/mizzy/specinfra/pull/558 & https://github.com/puppetlabs/beaker-answers/pull/22 have some more info, as it seems master/1.x doesn't trigger the bug with specinfra.
I think it still exists though, and the change in 3783f3053481f46f9113528aab19b4c060490184 (present in 1.x) has masked it by only lazily loading the code. It might be best to fix it still.
@domcleal at a glance, I agree with your assessment; we shouldn't be shadowing methods on the ruby Class/Method objects. Will need to audit the hocon code to look for places where our version of the name
method is being called and fix them to call the new one.
To get this addressed more quickly we should probably file a Jira ticket in the HC
project on the Puppet Jira system. I'll try to do that later today if no one else beats me to it.
Filed https://tickets.puppetlabs.com/browse/HC-80 to track this in Jira.
@kevpl @lamawithonel @domcleal if any of you were able to validate the fix in #77 that would be great.
Released 1.1.0 today, which should fix this. Feel free to open another ticket if it doesn't.
The hocon gem appears to be causing problems when used in Puppet beaker tests as the Hocon::Impl::TokenType.name method overrides the regular Class#name (well, Module#name) method.
The new method in https://github.com/puppetlabs/ruby-hocon/blob/0.9.5/lib/hocon/impl/token_type.rb#L24 requires an argument and doesn't return the class name.
This causes failures such as:
(https://travis-ci.org/puppetlabs/puppetlabs-postgresql/jobs/138923171)
as the specinfra gem tries to iterate over every class and calls .name: https://github.com/mizzy/specinfra/commit/8d686d505dc9df6338e70b98ebadf4bec2bacd6d.
It's probably best if the class method on TokenType is renamed to prevent overriding the regular .name method.