125 Commits

Author SHA1 Message Date
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
sophia
3e641fbe6b
Stub machine index proto mapper for environment test 2022-04-25 12:26:51 -05:00
Chris Roberts
d08c68ecf3 Adjust how trigger actions are inserted into the stack
This adjusts how triggers are implemented during a normal run. Any
defined triggers which are applicable are located and injected into
the run stack as the stack is built, including hook type triggers.

Support is included for dynamic hook lookup.

The data type used when defining triggers has also been relaxed to
support symbols, strings, or constants.
2020-03-17 15:07:36 -07:00
Chris Roberts
7fbe8bcabc Fix plugin discovery loading when no data directory is available
If the local data directory is unavailable, there will be no local
file to use within the plugin manager. Check for local file before
returning result, otherwise just return an empty hash.
2019-06-21 11:15:39 -07:00
Zhongcheng Lao
caae214bf7 Fix provider name not work when specified
Provider name should be symbol in guess_provider.
2019-06-17 08:22:50 +08:00
Chris Roberts
50c4464d44 Support loading plugin information from nested Vagrantfiles
Since plugin installation happens when the environment is first
initialized, attempt to determine the provider in use and load
any box provided Vagrantfiles to include any plugin configuration
they may include.
2019-06-04 10:07:02 -07:00
Chris Roberts
1c480880f1 Add test coverage of local rgloader creation 2018-10-10 10:30:30 -07:00
Chris Roberts
798fb81926 Force command to be re-run after installing local plugins
Reloading the Vagrantfile causes issue with multiple evaluations
where users expect single evaluation. Instead of allowing local
plugin installation to happen prior to command execution, force
halt after installation and the command to be re-run. This will
prevent multiple loads of the Vagrantfile within a single run.
2018-09-10 09:59:58 -07:00
Chris Roberts
e24728cb5a
Merge pull request #10155 from chrisroberts/f-plugin-load-config
Reset internal environment after plugin load
2018-08-30 11:30:14 -07:00
Chris Roberts
9b67655e45 Reset internal environment after plugin load
Force the vagrantfile and configuration loader to be rebuilt after
plugins have been loaded to properly allow newly introduced plugin
configurations to be properly supported within the Vagrantfile.
2018-08-30 10:44:09 -07:00
Chris Roberts
92109752a3 Fix local plugin prompt and add coverage 2018-08-30 10:35:16 -07:00
Brian Cain
8b1043c199 Remove stub methods and replace with allows for rpsec 3 2017-08-04 15:02:59 -07:00
Chris Roberts
1a62743bc5 Update rspec to recent version and fix deprecations 2017-08-03 17:54:07 -07:00
Aron Griffis
3ec1f4e045
Add new tests for VAGRANT_PREFERRED_PROVIDERS 2017-05-03 08:19:29 -04:00
Chris Roberts
74438cc495 Merge pull request #8196 from chrisroberts/fix/expand-vagrantfile-path
Allow VAGRANT_DOTFILE_PATH to be expanded as expected.
2017-02-23 13:33:07 -08:00
Chris Roberts
959bdada82 Fix environment gems_path location 2017-02-01 12:43:16 -08:00
Chris Roberts
832c62f2aa Allow VAGRANT_DOTFILE_PATH to be expanded as expected.
This allows custom paths that include special characters like `~`
to be properly expanded instead of resulting in joined root path
with special characters included.
2017-01-12 14:01:25 -08:00
Alejandro Ojeda
0be221fbea Add test for provider priority fix
This commit adds tests for possible future regressions for the bug fixed
in the commit: "Fix Vagrant not prioritizing configured providers
correctly".

Two very similar tests were added because whether the bug manifests
or not depends on the order in which the provider dictionary keys
are iterated, which is specific to the dictionary implementation.
2016-09-18 04:04:32 +02:00
Carlos Rodrigues
22a22e8bb6 Missed a spot 2016-07-28 01:18:48 +01:00
Carlos Rodrigues
1b0a28bd4a One extra smoke test 2016-07-28 01:09:14 +01:00
Carlos Rodrigues
211523d052 Added tests for VAGRANT_DOTFILE_PATH 2016-07-28 01:01:29 +01:00
Seth Vargo
b993699af6
Cleanup more files in tests 2016-05-29 00:34:00 -04:00
Seth Vargo
ca337122dc
Fix test issues 2016-05-28 23:44:11 -04:00
Seth Vargo
fb60d34236
Add unique names to all tmpdir and tempfile calls in tests + cleanup
This commit attempts to uniquely identify the temporary files and
directories that are created during test runs. Where it was a quick
fix, this commit also removes the temporary files and directories.

There are still a ton of temporary files due to calls to
.isolated_environment in the tests without an easy API an easy way
to provide a closer to that function.
2016-05-28 23:22:34 -04:00
Mitchell Hashimoto
fafd8b8986 more passing tests on Windows 2015-11-20 15:09:17 -08:00
Mitchell Hashimoto
646414b347 core: don't make dotfile path if no Vagrantfile 2015-11-18 17:48:24 -08:00
Mitchell Hashimoto
69d9bc0fe8 Environment can_install_provider and install_provider 2015-11-05 11:50:10 -08:00
Seth Vargo
39233e802f Validate pushes in the global config 2015-01-07 15:51:20 -05:00
Seth Vargo
c4eb0261bb Add tests for validating push configuration 2015-01-07 13:20:53 -05:00
Seth Vargo
111a43552e Add tests for Environment#pushes and #Enviroment#push 2014-12-08 11:35:11 -08:00
Mitchell Hashimoto
f8a2322459 core: only delete state if not created on initialize only
/cc @sethvargo
2014-11-10 16:29:19 -08:00
Mitchell Hashimoto
13dc1832b6 test: fix test for default provider 2014-10-23 16:41:24 -07:00
Mitchell Hashimoto
b7478e09f3 core: clean up default logic 2014-10-23 15:59:27 -07:00
Mitchell Hashimoto
768d453739 core: Environment#default_provider can look into machines 2014-10-23 15:52:42 -07:00
Mitchell Hashimoto
ad758bf69a core: prefer providers in the Vagrantfile [GH-3812] 2014-10-23 15:32:54 -07:00
Kalman Hazins
bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Mitchell Hashimoto
ca6e2393bd core: providers can choose to not be defaultable [GH-3742] 2014-05-09 16:02:09 -07:00
Mitchell Hashimoto
ca428388d8 providers/docker: can set default provider to docker [GH-3662] 2014-05-06 21:49:49 -07:00
Mitchell Hashimoto
d4087db7c5 core: no active machines if there is no vagrant env 2014-05-06 13:36:42 -07:00
Mitchell Hashimoto
cca9bffa90 core: Can exclude providers 2014-05-01 09:50:35 -07:00
Mitchell Hashimoto
ab9f91568e core: more intuitive logic around default providers 2014-05-01 09:46:40 -07:00
Mitchell Hashimoto
ba6272cc48 Update tests 2014-05-01 09:41:59 -07:00
Mitchell Hashimoto
a9dfb6b3bd core: default provider chosen by usability and prority 2014-05-01 09:40:52 -07:00
Mitchell Hashimoto
4fb9832589 core: clean up the lock cleanup code, tests 2014-04-25 01:33:25 -07:00
Mitchell Hashimoto
1c29c39f1b core: generalize the autostart stuff so we don't have a bunch of specials 2014-04-21 13:53:35 -07:00
Mitchell Hashimoto
8a6bdbf710 core: Environment#machine_index 2014-04-21 13:51:17 -07:00
Ramon de la Fuente
f6a5e20688 Add autostart as an option for vagrant boxes
Added specs for the environment and vagrantfile. Added a methd to retrieve
autostart_machine_names. Changed the plugin up/command to use autostart_machine_names
when no argument was given to the command.
2014-04-21 13:50:57 -07:00
Mitchell Hashimoto
794ca7a4df Tests passing again 2014-04-09 10:57:00 -07:00
Fabio Rehm
54656151cf Convert specs to RSpec 2.14.8 syntax with Transpec
This conversion is done by Transpec 1.10.2 with the following command:
    transpec test/unit/

* 507 conversions
    from: obj.should
      to: expect(obj).to

* 394 conversions
    from: == expected
      to: eq(expected)

* 260 conversions
    from: obj.should_receive(:message)
      to: expect(obj).to receive(:message)

* 85 conversions
    from: obj.stub(:message)
      to: allow(obj).to receive(:message)

* 25 conversions
    from: its(:attr) { }
      to: describe '#attr' do subject { super().attr }; it { } end

* 19 conversions
    from: obj.should_not
      to: expect(obj).not_to

* 7 conversions
    from: obj.should_not_receive(:message)
      to: expect(obj).not_to receive(:message)

* 3 conversions
    from: Klass.any_instance.should_receive(:message)
      to: expect_any_instance_of(Klass).to receive(:message)
2014-03-14 12:02:07 -03:00
Mitchell Hashimoto
8624e2cbf2 Fix failing tests on Windows 2014-03-11 11:09:37 -07:00