vagrant_spec 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -9
- data/README.md +3 -1
- data/lib/vagrant_spec/command/version.rb +30 -0
- data/lib/vagrant_spec/templates/init_help +6 -6
- data/lib/vagrant_spec/templates/test_help +4 -5
- data/lib/vagrant_spec/version.rb +1 -1
- data/scripts/poor_mans_smoke_test.sh +4 -2
- data/spec/unit/vagrant_spec_test/command_spec/version_spec.rb +25 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bd559c7081c147b71b1e3616f6f78532aa54a1c
|
4
|
+
data.tar.gz: a003a4044ca5cbe33f27772dfea6d9b57cfacfed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccea26d0ec98831823d8d0eb5e5c354550cf584cdc48be8a89cee634ba2f11654bd40864c2369c569df9dd5fff380decdc3861a9f39a6d0781a393309931a279
|
7
|
+
data.tar.gz: d0f95a9c8536df17d1c0dbf3fc9724073df97a2193802bfed1770900244154790d7584047cec63e043ad700c3fc20fac4107126633d951cd220e8c5b579183db
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [
|
4
|
-
|
3
|
+
## [Unreleased](https://github.com/miroswan/vagrant_spec/tree/HEAD)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/miroswan/vagrant_spec/compare/v0.0.3...HEAD)
|
5
6
|
|
6
|
-
**
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- add version sub command [\#9](https://github.com/miroswan/vagrant_spec/issues/9)
|
10
|
+
|
11
|
+
**Closed issues:**
|
7
12
|
|
8
|
-
-
|
9
|
-
|
13
|
+
- License info needs to be added to the gemspec [\#4](https://github.com/miroswan/vagrant_spec/issues/4)
|
14
|
+
|
15
|
+
## [v0.0.3](https://github.com/miroswan/vagrant_spec/tree/v0.0.3) (2016-08-09)
|
16
|
+
[Full Changelog](https://github.com/miroswan/vagrant_spec/compare/v0.0.2...v0.0.3)
|
10
17
|
|
11
18
|
## [v0.0.2](https://github.com/miroswan/vagrant_spec/tree/v0.0.2) (2016-08-06)
|
12
19
|
[Full Changelog](https://github.com/miroswan/vagrant_spec/compare/v0.0.1...v0.0.2)
|
@@ -16,10 +23,6 @@
|
|
16
23
|
- Help output for init needs to be updated [\#2](https://github.com/miroswan/vagrant_spec/issues/2)
|
17
24
|
- Needs tests [\#1](https://github.com/miroswan/vagrant_spec/issues/1)
|
18
25
|
|
19
|
-
**Merged pull requests:**
|
20
|
-
|
21
|
-
- Updates [\#3](https://github.com/miroswan/vagrant_spec/pull/3) ([miroswan](https://github.com/miroswan))
|
22
|
-
|
23
26
|
## [v0.0.1](https://github.com/miroswan/vagrant_spec/tree/v0.0.1) (2016-08-06)
|
24
27
|
|
25
28
|
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ distributed systems. vagrant-serverspec has similar pitfalls.
|
|
24
24
|
* vagrant_spec allows you to leverage your deployment tools just like you would
|
25
25
|
in staging and production. It generates an ansible inventory file after all
|
26
26
|
nodes are brought up. This allows you to run the same ansible_playbook commands
|
27
|
-
against the
|
27
|
+
against the Vagrant node set as you would elsewhere.
|
28
28
|
|
29
29
|
* routing tests to nodes is flexible and simple.
|
30
30
|
|
@@ -90,6 +90,8 @@ your cluster of nodes.
|
|
90
90
|
|
91
91
|
## Sub Commands
|
92
92
|
|
93
|
+
* version: Print the current version of vagrant_spec
|
94
|
+
|
93
95
|
* init: This will generate your spec_helper.rb for serverspec testing and your
|
94
96
|
ansible inventory file. You'll typically want to run this after a vagrant up,
|
95
97
|
and before your deployment and testing tasks.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'vagrant_spec/version'
|
4
|
+
|
5
|
+
module VagrantSpec
|
6
|
+
module Command
|
7
|
+
# Provide CLI interface to retrieving version information
|
8
|
+
class Version < Vagrant.plugin(2, :command)
|
9
|
+
def intiialize(argv, env)
|
10
|
+
@env = env
|
11
|
+
@argv = argv
|
12
|
+
end
|
13
|
+
|
14
|
+
def execute
|
15
|
+
return unless parse_opts
|
16
|
+
@env.ui.info("vagrant_spec: #{VagrantSpec::VERSION}")
|
17
|
+
end
|
18
|
+
|
19
|
+
def parse_opts
|
20
|
+
opts = OptionParser.new do |o|
|
21
|
+
o.banner = "\nVersion: Output the version of the plugin"
|
22
|
+
o.separator ''
|
23
|
+
o.separator 'Usage: vagrant spec version'
|
24
|
+
o.separator ''
|
25
|
+
end
|
26
|
+
parse_options(opts)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
The init subcommand initializes state-based configuration for vagrant_spec.
|
2
2
|
|
3
|
-
It creates a spec_helper.rb file under the configured
|
4
|
-
file is used to setup
|
3
|
+
It creates a spec_helper.rb file under the configured ServerSpec directory. This
|
4
|
+
file is used to setup ServerSpec backend configuration and ease ServerSpec
|
5
5
|
testing.
|
6
6
|
|
7
|
-
If config.spec.ansible_inventory configuration directive is used within the
|
7
|
+
If the config.spec.ansible_inventory configuration directive is used within the
|
8
8
|
Vagrantfile, then init will generate a test inventory file
|
9
9
|
vagrantspec_inventory. This file can be used for ansible orchestration against
|
10
|
-
the
|
10
|
+
the Vagrant instances.
|
11
11
|
|
12
12
|
By default, init will generate a json file containing machine data for each
|
13
|
-
|
14
|
-
orchestration tooling
|
13
|
+
Vagrant instance at .vagrantspec_machine_data. This file can be used by
|
14
|
+
orchestration tooling aside from ansible to map events to vagrant nodes. The
|
15
15
|
config.spec.generate_machine_data configuration parameter controls the
|
16
16
|
generation of this file.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
The test
|
1
|
+
The test sub-command will execute the ServerSpec tests configured in the
|
2
2
|
Vagrantfile under the config.spec.test_plan directive. This directive accepts
|
3
3
|
an array of hashes. For example:
|
4
4
|
|
@@ -13,9 +13,8 @@ config.spec.test_plan = [
|
|
13
13
|
}
|
14
14
|
]
|
15
15
|
|
16
|
-
Each hash
|
17
|
-
regular expression object matching the names of the
|
16
|
+
Each hash has two required keys: nodes and flags. The nodes key accepts a
|
17
|
+
regular expression object matching the names of the Vagrant machines defined in
|
18
18
|
the Vagrantfile. Alternatively, you can explicility pass an array of node names.
|
19
19
|
The flags key accepts a string of command line arguments to pass to rspec. Any
|
20
|
-
of the acceptable rspec options and parameters are
|
21
|
-
|
20
|
+
of the acceptable rspec options and parameters are legal.
|
data/lib/vagrant_spec/version.rb
CHANGED
@@ -7,13 +7,15 @@ set -e
|
|
7
7
|
|
8
8
|
export ANSIBLE_REMOTE_USER=vagrant
|
9
9
|
|
10
|
+
bundle exec vagrant spec version
|
11
|
+
bundle exec vagrant spec version -h
|
10
12
|
bundle exec vagrant spec
|
11
13
|
bundle exec vagrant spec -h
|
12
14
|
bundle exec vagrant spec init -h
|
13
15
|
bundle exec vagrant spec test -h
|
14
16
|
bundle exec vagrant spec no_command -h
|
15
|
-
rm -f serverspec/spec_helper.rb
|
16
|
-
rm -f .vagrantspec_machine_data
|
17
|
+
rm -f "serverspec/spec_helper.rb"
|
18
|
+
rm -f ".vagrantspec_machine_data"
|
17
19
|
bundle exec vagrant up
|
18
20
|
bundle exec vagrant spec init
|
19
21
|
ansible-playbook site.yml -i vagrantspec_inventory
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'vagrant_spec/command/version'
|
5
|
+
|
6
|
+
describe VagrantSpec::Command::Version do
|
7
|
+
include_context 'unit'
|
8
|
+
include_examples 'shared_mocks'
|
9
|
+
|
10
|
+
subject { VagrantSpec::Command::Version.new([], iso_env) }
|
11
|
+
|
12
|
+
context 'when parse_opts returns data' do
|
13
|
+
it '#execute calls env.ui.info' do
|
14
|
+
allow(subject).to receive(:parse_opts) { 'not_nil' }
|
15
|
+
expect(mock_ui).to receive(:info)
|
16
|
+
subject.execute
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
it '#parse_opts calls parse_options' do
|
21
|
+
allow(subject).to receive(:parse_options)
|
22
|
+
expect(subject).to receive(:parse_options)
|
23
|
+
subject.parse_opts
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant_spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Demitri
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-08-
|
12
|
+
date: 2016-08-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: serverspec
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/vagrant_spec/command/base.rb
|
123
123
|
- lib/vagrant_spec/command/init.rb
|
124
124
|
- lib/vagrant_spec/command/test.rb
|
125
|
+
- lib/vagrant_spec/command/version.rb
|
125
126
|
- lib/vagrant_spec/config.rb
|
126
127
|
- lib/vagrant_spec/config/base.rb
|
127
128
|
- lib/vagrant_spec/machine_data.rb
|
@@ -144,6 +145,7 @@ files:
|
|
144
145
|
- spec/unit/vagrant_spec_test/command_spec/base_spec.rb
|
145
146
|
- spec/unit/vagrant_spec_test/command_spec/init_spec.rb
|
146
147
|
- spec/unit/vagrant_spec_test/command_spec/test_spec.rb
|
148
|
+
- spec/unit/vagrant_spec_test/command_spec/version_spec.rb
|
147
149
|
- spec/unit/vagrant_spec_test/config_spec.rb
|
148
150
|
- spec/unit/vagrant_spec_test/config_spec/base_spec.rb
|
149
151
|
- spec/unit/vagrant_spec_test/machine_data_spec.rb
|
@@ -183,6 +185,7 @@ test_files:
|
|
183
185
|
- spec/unit/vagrant_spec_test/command_spec/base_spec.rb
|
184
186
|
- spec/unit/vagrant_spec_test/command_spec/init_spec.rb
|
185
187
|
- spec/unit/vagrant_spec_test/command_spec/test_spec.rb
|
188
|
+
- spec/unit/vagrant_spec_test/command_spec/version_spec.rb
|
186
189
|
- spec/unit/vagrant_spec_test/config_spec.rb
|
187
190
|
- spec/unit/vagrant_spec_test/config_spec/base_spec.rb
|
188
191
|
- spec/unit/vagrant_spec_test/machine_data_spec.rb
|