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 the included Vagrantfile for running rspec tests #12295

Merged
merged 1 commit into from
Jun 17, 2021

Conversation

timvisher
Copy link
Contributor

In attempting to get a development environment set up to run the rspec
tests for a forthcoming PR I noticed that the Vagrantfile doesn't appear
to actually set up a functioning environment. I'm not sure when this
changed or how it's been missed but I figured I'd contribute a patch to
fix it up for my benefit and others.

In summary:

  1. RVM no longer appears to be installed and configured the way the
    current provisioning script expects it be. Namely it requires users to
    be added to the rvm group rather than the sudo group and also
    requires a log out and then back in to finish setting up. In light of
    that I broke apart the provisioning into two separate shell scripts to
    get that 'log out and back in' behavior.
  2. While I was there I tried to 'clean up' the script's logic, making it
    idempotent, using sudo -u vagrant -i rather than the su
    incantation, removing apparentyl unnecessary dependencies like
    build-essential and the GPG key, etc. I suspect there's some
    significant unnecessary complexity in the ruby version extraction but
    that could be tacked on later. This change is already big enough.

What do you think? I'm happy to cleanup the commits if there's interest in
the patch.


$ vagrant -v; VBoxManage -v
Vagrant 2.2.14
6.1.18r142142

Pre Change:

$ time {
    vagrant destroy -f &&
    vagrant up &&
    vagrant ssh-config |
      tee default.conf &&
    ssh -F default.conf default $'
      bash -lc \'
        hostname;
        date;
        cd /vagrant &&
          bundle exec rake; hostname
      \'
    '
  }
…
(Reading database ... 45709 files and directories currently installed.)
    default: Preparing to unpack .../git_1%3a2.17.1-1ubuntu0.8_amd64.deb ...
    default: Unpacking git (1:2.17.1-1ubuntu0.8) over (1:2.17.1-1ubuntu0.4) ...
    default: Setting up git (1:2.17.1-1ubuntu0.8) ...
    default: Ruby ruby-2.6.6 is not installed.
    default: -su: bundle: command not found
…

vagrant
Mon Apr 12 15:42:40 UTC 2021
bash: line 4: bundle: command not found
vagrant

real    3m7.343s
user    0m13.897s
sys     0m4.263s

Post Change:

$ time {
    vagrant destroy -f &&
    vagrant up &&
    vagrant ssh-config |
      tee default.conf &&
    ssh -F default.conf default $'
      bash -lc \'
        hostname;
        date;
        cd /vagrant &&
          bundle exec rake; hostname
      \'
    '
  }
…
Finished in 19 minutes 2 seconds (files took 3.09 seconds to load)
4674 examples, 0 failures, 3 pending

vagrant

real    26m21.810s
user    0m13.517s
sys     0m4.281s

@timvisher
Copy link
Contributor Author

Ping on this. :)

1 similar comment
@timvisher
Copy link
Contributor Author

Ping on this. :)

@timvisher
Copy link
Contributor Author

Last ping on this then I'll guess I'll close it assuming we're not interested.

chrisroberts
chrisroberts previously approved these changes Jun 14, 2021
Copy link
Member

@chrisroberts chrisroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, for the delay on getting to this. Thank you!

@chrisroberts
Copy link
Member

@timvisher if you would squash down the wip commits before we merge, that would be super 🙂

@timvisher
Copy link
Contributor Author

Should be good to go. :)

@soapy1 soapy1 merged commit 2177976 into hashicorp:main Jun 17, 2021
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 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

Successfully merging this pull request may close these issues.

3 participants