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

Fix MODULES-10876 - use new client platform #315

Merged
merged 2 commits into from
Dec 15, 2020
Merged

Conversation

duritong
Copy link
Contributor

No description provided.

@duritong duritong requested a review from a team as a code owner November 21, 2020 22:12
@duritong
Copy link
Contributor Author

I am not able to get tests updated, since I cannot test against Puppet7, as:

Bundler could not find compatible versions for gem "puppet":
  In Gemfile:
    puppet (= 7.0.0)

    puppet-module-posix-dev-r2.5 (~> 0.4) was resolved to 0.5.3, which depends on
      puppet_litmus (< 1.0.0, >= 0.4.0) was resolved to 0.10.0, which depends on
        bolt (< 1.29.1, >= 1.13.1) was resolved to 1.14.0, which depends on
          puppet (< 7, >= 6.0.1)

@joshcooper
Copy link
Contributor

joshcooper commented Dec 1, 2020

bolt 2.36.0 (released today) relaxed the gem constraint on puppet, see puppetlabs/bolt@bdc1bdc#diff-f12cdf9ef6bf2ba67278582ca7a3dbc4a95586430ae7c9862bf7f37c23eebf91. So things should work given dependencies puppet-module-posix-dev-r2.5 (0.5.3) -> puppet_litmus (0.20.0) -> bolt 2.36.0

@duritong
Copy link
Contributor Author

duritong commented Dec 1, 2020

yes, I was able to get Puppet 7 gem installed. But now I get about 314 failures. Imho not really a lot of them are related to my changes, so not sure I find time to dig into the overall porting of the specs to Puppet 7

@joshcooper
Copy link
Contributor

joshcooper commented Dec 2, 2020

ah so this module uses the scanf puppet function, which relies on the ruby method of the same name. For some insane reason, ruby 2.7 moved that code into a separate gem 🤦 so this module will need to conditionally depend on scanf. Puppet does the following https://github.com/puppetlabs/puppet/blob/8bf64bb72eb48cca24d7e6e4c99e6b21e497fa86/Gemfile#L21 though it looks like this module uses Gem::Version comparison. I'll submit a PR for that (PR #317)

@joshcooper
Copy link
Contributor

The puppet7/bolt/litmus issues are resolved now, but this PR is now blocked on the puppet7/scanf issue, which will be fixed as soon as the new version is released.

There also seems to be some valid test issues:

$ PUPPET_GEM_VERSION=https://github.com/puppetlabs/puppet#main bundle update
$ PUPPET_GEM_VERSION=https://github.com/puppetlabs/puppet#main bundle exec rake parallel_spec
...
     Mocha::ExpectationError:
       unexpected invocation: Puppet.notice('Unable to connect to puppetdb server (https://mypuppetdb.com:8080/pdb/meta/v1/version): Request to https://mypuppetdb.com:8080/pdb/meta/v1/version failed after 0.002 seconds: Failed to open TCP connection to mypuppetdb.com:8080 (getaddrinfo: nodename nor servname provided, or not known)')
       unsatisfied expectations:
       - expected exactly once, not yet invoked: Puppet.notice('Unable to connect to puppetdb server (https://mypuppetdb.com:8080): Connection refused')
       satisfied expectations:
       - allowed any number of times, not yet invoked: #<Puppet::Util::Feature:0x7f9c480bebb8>.root?(any_parameters)
       - allowed any number of times, not yet invoked: #<Mock:0x7f9ca895b680>.is_a?(Net::HTTPSuccess)
       - allowed any number of times, not yet invoked: #<Mock:0x7f9ca895a578>.msg(any_parameters)
       - allowed any number of times, not yet invoked: #<Mock:0x7f9ca895a578>.code(any_parameters)
       - allowed any number of times, not yet invoked: #<Mock:0x7f9ca895a578>.is_a?(Net::HTTPSuccess)
       - allowed any number of times, not yet invoked: #<Mock:0x7f9ca8953638>.open_timeout=(2)
       - allowed any number of times, not yet invoked: #<Mock:0x7f9ca8953638>.read_timeout=(2)
       - allowed any number of times, not yet invoked: #<Mock:0x7f9ca8953638>.get('/pdb/meta/v1/version', {'Accept' => 'application/json'})
       - allowed any number of times, not yet invoked: #<Mock:0x7f9ca8950a00>.get('/pdb/meta/v1/version', {'Accept' => 'application/json'})
       - allowed any number of times, not yet invoked: Puppet::Network::HttpPool.http_instance('wrongserver.com', 8081, true)
       - allowed any number of times, not yet invoked: Puppet::Network::HttpPool.http_instance('mypuppetdb.com', 8081, true)
       - allowed any number of times, not yet invoked: Puppet::Network::HttpPool.http_instance('mypuppetdb.com', 8080, false)
       - allowed any number of times, not yet invoked: Puppet::Network::HttpPool.http_instance('mypuppetdb.com', 8080, true)
       - allowed any number of times, not yet invoked: Puppet::Network::HttpPool.http_instance(any_parameters)

Looks like the allow/expect statements need updating.

@duritong
Copy link
Contributor Author

duritong commented Dec 14, 2020

Thank you @joshcooper for the update on what is missing. I am fully aware that some tests need to be adjusted. I am just not able to really commit any time in the next few weeks to fix that.

So if somebody wants to take it from here (which is what fixes things for me aka. I run that patch): Please go ahead.

@austb austb merged commit e1a92dd into puppetlabs:master Dec 15, 2020
@smortex smortex added the bugfix label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants