tmatilai / vagrant-proxyconf

Vagrant plugin that configures the virtual machine to use proxies
MIT License
531 stars 74 forks source link

Testing bug in upstream vagrant >= 2.2.5 #209

Closed codylane closed 4 years ago

codylane commented 5 years ago

Problem Statement:

Due to this vagrant testing issue we cannot reliably test vagrant versions >= 2.2.5 using the git specifier in our Gemfile. Until the upstream bug is merged, this issue will remain open.

Example of the bug:

$ bundle exec vagrant plugin list

Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:

  vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:

  vagrant plugin expunge --reinstall

Or you may want to try updating the installed plugins to their latest
versions:

  vagrant plugin update

Error message given during initialization: undefined method `runtime_dependencies' for nil:NilClas

$ bundle show

Gems included by the bundle:
  * bcrypt_pbkdf (1.0.1)
  * builder (3.2.3)
  * bundler (1.17.3)
  * childprocess (0.6.3)
  * coderay (1.1.2)
  * concurrent-ruby (1.1.5)
  * diff-lcs (1.3)
  * domain_name (0.5.20190701)
  * ed25519 (1.2.4)
  * erubis (2.7.0)
  * ffi (1.11.1)
  * formatador (0.2.5)
  * gssapi (1.3.0)
  * guard (2.15.1)
  * guard-compat (1.2.1)
  * guard-rspec (4.7.3)
  * gyoku (1.3.1)
  * hashicorp-checkpoint (0.1.5)
  * http-cookie (1.0.3)
  * httpclient (2.8.3)
  * i18n (1.1.1)
  * listen (3.1.5)
  * little-plugger (1.1.4)
  * log4r (1.1.10)
  * logging (2.2.2)
  * lumberjack (1.0.13)
  * method_source (0.9.2)
  * mime-types (3.3)
  * mime-types-data (3.2019.1009)
  * mini_portile2 (2.4.0)
  * multi_json (1.14.1)
  * nenv (0.3.0)
  * net-scp (1.2.1)
  * net-sftp (2.1.2)
  * net-ssh (5.1.0)
  * net-telnet (0.1.1)
  * netrc (0.11.0)
  * nori (2.6.0)
  * notiffany (0.1.3)
  * pry (0.12.2)
  * rake (13.0.0)
  * rb-fsevent (0.10.3)
  * rb-inotify (0.10.0)
  * rb-kqueue (0.2.5)
  * rb-readline (0.5.5)
  * redcarpet (3.5.0)
  * rest-client (2.0.2)
  * rspec (3.9.0)
  * rspec-core (3.9.0)
  * rspec-expectations (3.9.0)
  * rspec-its (1.3.0)
  * rspec-mocks (3.9.0)
  * rspec-support (3.9.0)
  * ruby_dep (1.3.1)
  * rubyntlm (0.6.2)
  * rubyzip (1.2.4)
  * serverspec (2.41.5)
  * sfl (2.3)
  * shellany (0.0.1)
  * specinfra (2.82.3)
  * thor (0.20.3)
  * unf (0.1.4)
  * unf_ext (0.0.7.6)
  * vagrant (2.2.6 f58b97b)
  * vagrant-proxyconf (2.0.7)
  * vagrant_cloud (2.0.3)
  * wdm (0.1.1)
  * winrm (2.3.2)
  * winrm-elevated (1.1.1)
  * winrm-fs (1.3.2)
  * yard (0.9.20)

$ cat Gemfile

source 'https://rubygems.org'

#### Added due to https://groups.google.com/forum/#!topic/vagrant-up/J8J6LmhzBqM/discussion
embedded_locations = %w(/Applications/Vagrant/embedded /opt/vagrant/embedded)

embedded_locations.each do |p|
    ENV['VAGRANT_INSTALLER_EMBEDDED_DIR'] = p if File.directory?(p)
end

unless ENV.key?('VAGRANT_INSTALLER_EMBEDDED_DIR')
    $stderr.puts "Couldn't find a packaged install of vagrant, and we need this"
    $stderr.puts 'in order to make use of the RubyEncoder libraries.'
    $stderr.puts 'I looked in:'
    embedded_locations.each do |p|
        $stderr.puts "  #{p}"
    end
end
#### End Added due to https://groups.google.com/forum/#!topic/vagrant-up/J8J6LmhzBqM/discussion

gem 'rake'
gem 'rspec', '~> 3.1'
gem 'rspec-its', '~> 1.0'

group :development do
  gem 'guard-rspec'
  gem 'mini_portile2'
  gem 'pry'
  gem 'rb-readline'
  gem 'redcarpet'
  gem 'serverspec'
  gem 'yard', '~> 0.9.11'

  gem 'vagrant',
    git: 'https://github.com/hashicorp/vagrant.git',
    tag: ENV.fetch('VAGRANT_VERSION', 'v2.2.6')

end

# when testing our plugin we need to make sure some vagrant plugins are installed
# however, the syntax `Vagrant.require_plugin 'vagrant-proxyconf' was deprecated
# and this is the future for using testing vagrant behind bundler.
# https://stackoverflow.com/questions/19492738/demand-a-vagrant-plugin-within-the-vagrantfile
group :plugins do
  gem 'vagrant-proxyconf', path: __dir__
end
codylane commented 4 years ago

Linked new issue https://github.com/vagrant-libvirt/vagrant-libvirt/issues/1018 still a problem as of 4-27-2020

codylane commented 4 years ago

This issue has finally been addressed as of vagrant 2.2.9.