busser-serverspec_datadog 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.cane +1 -0
- data/.github/dependabot.yml +7 -0
- data/.gitignore +18 -0
- data/.tailor +6 -0
- data/.travis.yml +9 -0
- data/CHANGELOG.md +116 -0
- data/CONTRIBUTING.md +6 -0
- data/Gemfile +3 -0
- data/LICENSE +15 -0
- data/README.md +83 -0
- data/Rakefile +34 -0
- data/busser-serverspec.gemspec +37 -0
- data/features/plugin_install_command.feature +13 -0
- data/features/plugin_list_command.feature +8 -0
- data/features/support/env.rb +16 -0
- data/features/test_command.feature +45 -0
- data/lib/busser/runner_plugin/serverspec_datadog.rb +67 -0
- data/lib/busser/serverspec_datadog/runner.rb +57 -0
- data/lib/busser/serverspec_datadog/version.rb +26 -0
- metadata +220 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9a7f40f3f840642d80114b754f738c298518077edd0514d3037ba9b3380e96c4
|
4
|
+
data.tar.gz: a285e23e3023b943a96fb04c0ef7216bc3cb4e1b3e8933f9776c4baeec8a19ef
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: edd1627d608e282b736b540c99bf9993a46d07cdd434b72adbca868800f0f86fe92a2a16801ed3d9121bfa5df5fc6bfcd42b79e4cf2b396623a2b544f273d30a
|
7
|
+
data.tar.gz: ea11be5260fb02aba34bc34d429a92eba4d313c60870f33e002c37a6b1ad5a0b43e0d082592862618070a82a5474bc2dfb2ae137b6e74f8dbf9a086d1760cefc
|
data/.cane
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--style-measure 100
|
data/.gitignore
ADDED
data/.tailor
ADDED
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
# You should use Kitchen::Verifier::Shell + Serverspec
|
2
|
+
|
3
|
+
|
4
|
+
## 0.6.0 2023-01-26
|
5
|
+
|
6
|
+
* Pin bundler version installed in postinstall to 2.3.26
|
7
|
+
* Rename gem to busser-serverspec_datadog
|
8
|
+
|
9
|
+
## 0.5.10 2016-08-12
|
10
|
+
|
11
|
+
* use container-based test at travis-ci.
|
12
|
+
* Make rake and rspec/core runtime deps
|
13
|
+
merge pull-req by John Keiser <john@johnkeiser.com>, thanks.
|
14
|
+
* Pin versions of aruba and cucumber
|
15
|
+
inspired by test-kitchen/busser-cucumber@cd3e6b3 by Peter Gallagher, thanks.
|
16
|
+
|
17
|
+
## 0.5.9 2016-01-22
|
18
|
+
|
19
|
+
* Fix frozen string issue when checking Ruby version
|
20
|
+
merge pull-req by Joe Friedl <jfriedl@digitalocean.com>, thanks.
|
21
|
+
|
22
|
+
## 0.5.8 / 2016-01-22, 0.6.0 / 2016-01-18 (yanked 2016-02-22)
|
23
|
+
|
24
|
+
* Install net-ssh < 2.10 for ruby < 2.0.
|
25
|
+
merge pull-req by Bill Ruddock <bill.ruddock@gmail.com>, thanks.
|
26
|
+
|
27
|
+
## 0.5.7 / 2015-06-01
|
28
|
+
|
29
|
+
* use RbConfig instead of obsolete and deprecated Config, closes #29
|
30
|
+
suggested by Jörg Herzinger <joerg.herzinger@oiml.at>, thanks.
|
31
|
+
|
32
|
+
## 0.5.6 / 2015-04-27
|
33
|
+
|
34
|
+
* Run bundle with explicit path to ruby bin, closes #27
|
35
|
+
merge pull-req by Simon Detheridge <simon@widgit.com>, thanks.
|
36
|
+
|
37
|
+
## 0.5.5 / 2015-04-02
|
38
|
+
|
39
|
+
* use File::PATH_SEPARATOR to join ENV PATH. closes #24
|
40
|
+
suggested by Jacob McCann <jmccann.git@gmail.com>, thanks.
|
41
|
+
|
42
|
+
## 0.5.4 / 2015-03-30
|
43
|
+
|
44
|
+
* add the config bindir as well.
|
45
|
+
merge pull-req by Noah Kantrowitz <noah@coderanger.net>. thanks.
|
46
|
+
|
47
|
+
## 0.5.3 / 2014-10-17
|
48
|
+
|
49
|
+
* make private working methods, closes #18
|
50
|
+
|
51
|
+
## 0.5.2 / 2014-10-16
|
52
|
+
|
53
|
+
* reset gems db
|
54
|
+
|
55
|
+
## 0.5.1 / 2014-10-16
|
56
|
+
|
57
|
+
* move Gemfile process from postinstall to test.
|
58
|
+
|
59
|
+
## 0.5.0 / 2014-10-16
|
60
|
+
|
61
|
+
* enable to specify serverspec version in Gemfile, closes #16
|
62
|
+
* add 'log_switch', '~> 0.3.0', ref: turboladen/tailor#160
|
63
|
+
* drop ruby 1.9.2 test, because mime-types 2.4.2 does not support ruby 1.9.2.
|
64
|
+
|
65
|
+
## 0.4.0 / 2014-10-06
|
66
|
+
|
67
|
+
* add --default-path for RSpec 3, closes #15
|
68
|
+
* bump up version number (0.3: load Gemfile, 0.4: serverspec v2).
|
69
|
+
|
70
|
+
## 0.2.8 / 2014-10-05
|
71
|
+
|
72
|
+
* update for serverspec v2, closes #13
|
73
|
+
|
74
|
+
## 0.2.7 / 2014-09-24
|
75
|
+
|
76
|
+
* support loading Gemfile. closes #12
|
77
|
+
|
78
|
+
## 0.2.6 / 2014-01-25
|
79
|
+
|
80
|
+
* add globbing pattern note for frequency asked test failure.
|
81
|
+
* update links for moving to test-kitchen organization.
|
82
|
+
* update copyright.
|
83
|
+
|
84
|
+
## 0.2.5 / 2013-11-14
|
85
|
+
|
86
|
+
* issue #5: Added --color and --format documentation rspec options
|
87
|
+
merge pull-req by Kannan Manickam <kannan@rightscale.com>. thanks.
|
88
|
+
|
89
|
+
## 0.2.4 / 2013-11-01
|
90
|
+
|
91
|
+
* issue #4: Search all GEM_PATH values for `rspec` bin.
|
92
|
+
merge pull-req by Seth Chisamore <schisamo@opscode.com>. thanks.
|
93
|
+
|
94
|
+
## 0.2.3 / 2013-07-10
|
95
|
+
|
96
|
+
* issue #2: remove tight dependency of serverspec. thanks to rteabeault.
|
97
|
+
|
98
|
+
## 0.2.2 / 2013-07-09
|
99
|
+
|
100
|
+
* issue #2: remove dependency rspec.
|
101
|
+
|
102
|
+
## 0.2.1 / 2013-06-18
|
103
|
+
|
104
|
+
* fix silly exit value.
|
105
|
+
|
106
|
+
## 0.2.0 / 2013-06-18
|
107
|
+
|
108
|
+
* issue #1: do not print full backtrace if serverspec test failure.
|
109
|
+
|
110
|
+
## 0.1.1 / 2013-06-06
|
111
|
+
|
112
|
+
* add cucumber test and fix related things
|
113
|
+
|
114
|
+
## 0.1.0 / 2013-05-22
|
115
|
+
|
116
|
+
* Initial release
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
# <a name="notice"></a> Notice
|
2
|
+
|
3
|
+
You should use [Kitchen::Verifier::Shell](https://github.com/higanworks/kitchen-verifier-shell) + [Serverspec](http://serverspec.org/) instead of Busser::RunnerPlugin::Serverspec.
|
4
|
+
|
5
|
+
* [Official Document](https://github.com/test-kitchen/test-kitchen/pull/741) (This PR has been merged. You can use this with Test Kitchen 1.5.0)
|
6
|
+
* [Cookbook testing by Serverspec with Shell Verifier of Test Kitchen](http://www.creationline.com/en/lab/12161) ([Japanese](http://www.creationline.com/lab/12161))
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Author:: HIGUCHI Daisuke (<d-higuchi@creationline.com>)
|
2
|
+
|
3
|
+
Copyright (C) 2013-2014, HIGUCHI Daisuke
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
You may obtain a copy of the License at
|
8
|
+
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
See the License for the specific language governing permissions and
|
15
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# <a name="title"></a> Busser::RunnerPlugin::Serverspec
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/busser-serverspec.svg)](http://rubygems.org/gems/busser-serverspec) [![Build Status](https://secure.travis-ci.org/test-kitchen/busser-serverspec.svg?branch=master)](https://travis-ci.org/test-kitchen/busser-serverspec) [![Code Climate](https://codeclimate.com/github/cl-lab-k/busser-serverspec.svg)](https://codeclimate.com/github/cl-lab-k/busser-serverspec)
|
4
|
+
|
5
|
+
A Busser runner plugin for Serverspec
|
6
|
+
|
7
|
+
## Status
|
8
|
+
|
9
|
+
This software project is no longer under active development as it has no active maintainers. The software may continue to work for some or all use cases, but issues filed in GitHub will most likely not be triaged. If a new maintainer is interested in working on this project please come chat with us in #test-kitchen on Chef Community Slack.
|
10
|
+
|
11
|
+
## <a name="installation"></a> Installation and Setup
|
12
|
+
|
13
|
+
Please read the Busser [plugin usage][plugin_usage] page for more details.
|
14
|
+
|
15
|
+
## <a name="usage"></a> Usage
|
16
|
+
|
17
|
+
Please put test files into [COOKBOOK]/test/integration/[SUITES]/serverspec/
|
18
|
+
|
19
|
+
```cookbook
|
20
|
+
`-- test
|
21
|
+
`-- integration
|
22
|
+
`-- default
|
23
|
+
`-- serverspec
|
24
|
+
|-- Gemfile
|
25
|
+
|-- localhost
|
26
|
+
| `-- httpd_spec.rb
|
27
|
+
`-- spec_helper.rb
|
28
|
+
```
|
29
|
+
|
30
|
+
`Gemfile` is optional. You can specify installing Serverspec version and install gems you need.
|
31
|
+
|
32
|
+
## <a name="note"></a> Note
|
33
|
+
|
34
|
+
### <a name="spec"></a> File Matching
|
35
|
+
|
36
|
+
Globbing pattern to match files is `"serverspec/*/*_spec.rb"`.
|
37
|
+
You need to use `"_spec.rb"` (underscore), not `"-spec.rb"` (minus).
|
38
|
+
|
39
|
+
### <a name="serverspec1"></a> Specify Serverspec version
|
40
|
+
|
41
|
+
If you have to specify Serverspec version, you can use Gemfile. Example Gemfile:
|
42
|
+
|
43
|
+
```Gemfile
|
44
|
+
source 'https://rubygems.org'
|
45
|
+
gem 'serverspec', '< 2.0'
|
46
|
+
```
|
47
|
+
|
48
|
+
### <a name="backend"></a> Serverspec backend
|
49
|
+
|
50
|
+
It runs on a target server for testing after ssh log in it.
|
51
|
+
So you need to specify `set :backend, :exec` not `set :backend, :ssh` (Serverspec v2).
|
52
|
+
If you use Serverspec v1, you need to specify `include SpecInfra::Helper::Exec` not `include SpecInfra::Helper::Ssh`.
|
53
|
+
|
54
|
+
|
55
|
+
## <a name="development"></a> Development
|
56
|
+
|
57
|
+
* Source hosted at [GitHub][repo]
|
58
|
+
* Report issues/questions/feature requests on [GitHub Issues][issues]
|
59
|
+
|
60
|
+
Pull requests are very welcome! Make sure your patches are well tested.
|
61
|
+
Ideally create a topic branch for every separate change you make. For
|
62
|
+
example:
|
63
|
+
|
64
|
+
1. Fork the repo
|
65
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
66
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
67
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
68
|
+
5. Create new Pull Request
|
69
|
+
|
70
|
+
## <a name="authors"></a> Authors
|
71
|
+
|
72
|
+
Created and maintained by [HIGUCHI Daisuke][author] (<d-higuchi@creationline.com>)
|
73
|
+
|
74
|
+
## <a name="license"></a> License
|
75
|
+
|
76
|
+
Apache 2.0 (see [LICENSE][license])
|
77
|
+
|
78
|
+
|
79
|
+
[author]: https://github.com/cl-lab-k
|
80
|
+
[issues]: https://github.com/test-kitchen/busser-serverspec/issues
|
81
|
+
[license]: https://github.com/test-kitchen/busser-serverspec/blob/master/LICENSE
|
82
|
+
[repo]: https://github.com/test-kitchen/busser-serverspec
|
83
|
+
[plugin_usage]: http://docs.kitchen-ci.org/busser/plugin-usage
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'coveralls/rake/task'
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
require 'cucumber/rake/task'
|
4
|
+
require 'cane/rake_task'
|
5
|
+
require 'tailor/rake_task'
|
6
|
+
|
7
|
+
Coveralls::RakeTask.new
|
8
|
+
|
9
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
10
|
+
t.cucumber_opts = ['features', '-x', '--format progress']
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Run all test suites"
|
14
|
+
task :test => [:features]
|
15
|
+
|
16
|
+
desc "Run cane to check quality metrics"
|
17
|
+
Cane::RakeTask.new do |cane|
|
18
|
+
cane.canefile = './.cane'
|
19
|
+
end
|
20
|
+
|
21
|
+
Tailor::RakeTask.new
|
22
|
+
|
23
|
+
desc "Display LOC stats"
|
24
|
+
task :stats do
|
25
|
+
puts "\n## Production Code Stats"
|
26
|
+
sh "countloc -r lib"
|
27
|
+
puts "\n## Test Code Stats"
|
28
|
+
sh "countloc -r features"
|
29
|
+
end
|
30
|
+
|
31
|
+
desc "Run all quality tasks"
|
32
|
+
task :quality => [:cane, :tailor, :stats]
|
33
|
+
|
34
|
+
task :default => [:test, :quality, 'coveralls:push']
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'busser/serverspec_datadog/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'busser-serverspec_datadog'
|
8
|
+
spec.version = Busser::ServerspecDatadog::VERSION
|
9
|
+
spec.authors = ['HIGUCHI Daisuke']
|
10
|
+
spec.email = ['d-higuchi@creationline.com']
|
11
|
+
spec.description = %q{A Busser runner plugin for Serverspec}
|
12
|
+
spec.summary = spec.description
|
13
|
+
spec.homepage = 'https://github.com/test-kitchen/busser-serverspec'
|
14
|
+
spec.license = 'Apache 2.0'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = []
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
spec.required_ruby_version = '>= 2.3.0'
|
21
|
+
|
22
|
+
spec.add_dependency 'busser'
|
23
|
+
spec.add_dependency 'rake'
|
24
|
+
spec.add_dependency 'rspec-core'
|
25
|
+
|
26
|
+
spec.add_development_dependency 'serverspec'
|
27
|
+
|
28
|
+
spec.add_development_dependency 'aruba', '0.6.1'
|
29
|
+
spec.add_development_dependency 'cucumber', '1.3.18'
|
30
|
+
|
31
|
+
spec.add_development_dependency 'cane'
|
32
|
+
spec.add_development_dependency 'log_switch', '~> 0.3.0'
|
33
|
+
spec.add_development_dependency 'tailor'
|
34
|
+
spec.add_development_dependency 'countloc'
|
35
|
+
|
36
|
+
spec.add_development_dependency 'coveralls'
|
37
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Feature: Plugin install command
|
2
|
+
In order to use this plugin
|
3
|
+
As a user of Busser
|
4
|
+
I want to run the postinstall for this plugin
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given a test BUSSER_ROOT directory named "busser-serverspec-install"
|
8
|
+
And a sandboxed GEM_HOME directory named "busser-serverspec-gem-home"
|
9
|
+
|
10
|
+
Scenario: Running the postinstall generator
|
11
|
+
When I run `busser plugin install busser-serverspec --force-postinstall`
|
12
|
+
Then a gem named "serverspec" is installed
|
13
|
+
And the exit status should be 0
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Feature: Plugin list command
|
2
|
+
In order to use this plugin
|
3
|
+
As a user of Busser
|
4
|
+
I want to see this plugin in the 'busser plugin list' command
|
5
|
+
|
6
|
+
Scenario: Plugin appears in plugin list command
|
7
|
+
When I successfully run `busser plugin list`
|
8
|
+
Then the output should match /^serverspec\b/
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
SimpleCov.start
|
3
|
+
|
4
|
+
require 'aruba/cucumber'
|
5
|
+
require 'busser/cucumber'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
@aruba_timeout_seconds = 60
|
9
|
+
end
|
10
|
+
|
11
|
+
After do |s|
|
12
|
+
# Tell Cucumber to quit after this scenario is done - if it failed.
|
13
|
+
# This is useful to inspect the 'tmp/aruba' directory before any other
|
14
|
+
# steps are executed and clear it out.
|
15
|
+
Cucumber.wants_to_quit = true if s.failed?
|
16
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
Feature: Test command
|
2
|
+
In order to run tests written with serverspec
|
3
|
+
As a user of Busser
|
4
|
+
I want my tests to run when the serverspec runner plugin is installed
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given a test BUSSER_ROOT directory named "busser-serverspec-test"
|
8
|
+
And a sandboxed GEM_HOME directory named "busser-serverspec-gem-home"
|
9
|
+
When I successfully run `busser plugin install busser-serverspec --force-postinstall`
|
10
|
+
Given a suite directory named "serverspec"
|
11
|
+
|
12
|
+
Scenario: A passing test suite
|
13
|
+
Given a file in suite "serverspec" named "localhost/default_spec.rb" with:
|
14
|
+
"""
|
15
|
+
require 'serverspec'
|
16
|
+
set :backend, :exec
|
17
|
+
|
18
|
+
describe command( "echo 'hello'" ) do
|
19
|
+
its(:exit_status) { should eq 0 }
|
20
|
+
its(:stdout) { should eq "hello\n" }
|
21
|
+
end
|
22
|
+
"""
|
23
|
+
When I run `busser test serverspec`
|
24
|
+
Then the output should contain:
|
25
|
+
"""
|
26
|
+
2 examples, 0 failures
|
27
|
+
"""
|
28
|
+
And the exit status should be 0
|
29
|
+
|
30
|
+
Scenario: A failing test suite
|
31
|
+
Given a file in suite "serverspec" named "localhost/default_spec.rb" with:
|
32
|
+
"""
|
33
|
+
require 'serverspec'
|
34
|
+
set :backend, :exec
|
35
|
+
|
36
|
+
describe command( 'which uhoh-whatzit-called' ) do
|
37
|
+
its(:exit_status) { should eq 0 }
|
38
|
+
end
|
39
|
+
"""
|
40
|
+
When I run `busser test serverspec`
|
41
|
+
Then the output should contain:
|
42
|
+
"""
|
43
|
+
1 example, 1 failure
|
44
|
+
"""
|
45
|
+
And the exit status should not be 0
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: HIGUCHI Daisuke (<d-higuchi@creationline.com>)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2013-2014, HIGUCHI Daisuke
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
|
19
|
+
require 'busser/runner_plugin'
|
20
|
+
require 'rubygems/dependency_installer'
|
21
|
+
|
22
|
+
# A Busser runner plugin for Serverspec.
|
23
|
+
#
|
24
|
+
# @author HIGUCHI Daisuke <d-higuchi@creationline.com>
|
25
|
+
#
|
26
|
+
class Busser::RunnerPlugin::ServerspecDatadog < Busser::RunnerPlugin::Base
|
27
|
+
postinstall do
|
28
|
+
install_gem('bundler', '2.3.26')
|
29
|
+
end
|
30
|
+
|
31
|
+
def test
|
32
|
+
run_bundle_install
|
33
|
+
install_serverspec
|
34
|
+
|
35
|
+
runner = File.join(File.dirname(__FILE__), %w{.. serverspec_datadog runner.rb})
|
36
|
+
run_ruby_script!("#{runner} #{suite_path('serverspec_datadog').to_s}")
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def run_bundle_install
|
42
|
+
# Referred from busser-shindo
|
43
|
+
gemfile_path = File.join(suite_path, 'serverspec_datadog', 'Gemfile')
|
44
|
+
if File.exists?(gemfile_path)
|
45
|
+
# Bundle install local completes quickly if the gems are already found
|
46
|
+
# locally it fails if it needs to talk to the internet. The || below is
|
47
|
+
# the fallback to the internet-enabled version. It's a speed optimization.
|
48
|
+
banner('Bundle Installing..')
|
49
|
+
ENV['PATH'] = [ENV['PATH'], Gem.bindir, RbConfig::CONFIG['bindir']].join(File::PATH_SEPARATOR)
|
50
|
+
bundle_exec = "#{File.join(RbConfig::CONFIG['bindir'], 'ruby')} " +
|
51
|
+
"#{File.join(Gem.bindir, 'bundle')} install --gemfile #{gemfile_path}"
|
52
|
+
run("#{bundle_exec} --local || #{bundle_exec}")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def install_serverspec
|
57
|
+
Gem::Specification.reset
|
58
|
+
if Array(Gem::Specification.find_all_by_name('serverspec')).size == 0
|
59
|
+
if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.3')
|
60
|
+
raise "Ruby < 2.3 is EOLed and no longer supported"
|
61
|
+
end
|
62
|
+
banner('Installing Serverspec..')
|
63
|
+
spec = install_gem('serverspec')
|
64
|
+
banner "serverspec installed (version #{spec.version})"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- encoding: utf-8 -*-
|
3
|
+
#
|
4
|
+
# Author:: HIGUCHI Daisuke (<d-higuchi@creationline.com>)
|
5
|
+
#
|
6
|
+
# Copyright (C) 2013-2014, HIGUCHI Daisuke
|
7
|
+
#
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
# you may not use this file except in compliance with the License.
|
10
|
+
# You may obtain a copy of the License at
|
11
|
+
#
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
#
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
|
20
|
+
require 'rake'
|
21
|
+
require 'rspec/core/rake_task'
|
22
|
+
require 'rbconfig'
|
23
|
+
|
24
|
+
base_path = File.expand_path(ARGV.shift)
|
25
|
+
|
26
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
27
|
+
candidate_bindirs = []
|
28
|
+
# Current Ruby's default bindir
|
29
|
+
candidate_bindirs << RbConfig::CONFIG['bindir']
|
30
|
+
# Search all Gem paths bindirs
|
31
|
+
candidate_bindirs << Gem.paths.path.map do |gem_path|
|
32
|
+
File.join(gem_path, 'bin')
|
33
|
+
end
|
34
|
+
|
35
|
+
candidate_rspec_bins = candidate_bindirs.flatten.map do |bin_dir|
|
36
|
+
File.join(bin_dir, 'rspec')
|
37
|
+
end
|
38
|
+
|
39
|
+
rspec_bin = candidate_rspec_bins.find do |candidate_rspec_bin|
|
40
|
+
FileTest.exist?(candidate_rspec_bin) &&
|
41
|
+
FileTest.executable?(candidate_rspec_bin)
|
42
|
+
end
|
43
|
+
|
44
|
+
t.rspec_path = rspec_bin if rspec_bin
|
45
|
+
t.rspec_opts = [
|
46
|
+
'--color',
|
47
|
+
'--format documentation',
|
48
|
+
"--default-path #{base_path}",
|
49
|
+
]
|
50
|
+
t.ruby_opts = "-I#{base_path}"
|
51
|
+
t.pattern = "#{base_path}/**/*_spec.rb"
|
52
|
+
end
|
53
|
+
begin
|
54
|
+
Rake::Task['spec'].invoke
|
55
|
+
rescue RuntimeError
|
56
|
+
exit 1
|
57
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: HIGUCHI Daisuke (<d-higuchi@creationline.com>)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2013-2014, HIGUCHI Daisuke
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
|
19
|
+
module Busser
|
20
|
+
|
21
|
+
module ServerspecDatadog
|
22
|
+
|
23
|
+
# Version string for the Serverspec Busser runner plugin
|
24
|
+
VERSION = '0.6.0'
|
25
|
+
end
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,220 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: busser-serverspec_datadog
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- HIGUCHI Daisuke
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-01-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: busser
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-core
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: serverspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: aruba
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.6.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.6.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: cucumber
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.3.18
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.3.18
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: cane
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: log_switch
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.3.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.3.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: tailor
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: countloc
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: coveralls
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
description: A Busser runner plugin for Serverspec
|
168
|
+
email:
|
169
|
+
- d-higuchi@creationline.com
|
170
|
+
executables: []
|
171
|
+
extensions: []
|
172
|
+
extra_rdoc_files: []
|
173
|
+
files:
|
174
|
+
- ".cane"
|
175
|
+
- ".github/dependabot.yml"
|
176
|
+
- ".gitignore"
|
177
|
+
- ".tailor"
|
178
|
+
- ".travis.yml"
|
179
|
+
- CHANGELOG.md
|
180
|
+
- CONTRIBUTING.md
|
181
|
+
- Gemfile
|
182
|
+
- LICENSE
|
183
|
+
- README.md
|
184
|
+
- Rakefile
|
185
|
+
- busser-serverspec.gemspec
|
186
|
+
- features/plugin_install_command.feature
|
187
|
+
- features/plugin_list_command.feature
|
188
|
+
- features/support/env.rb
|
189
|
+
- features/test_command.feature
|
190
|
+
- lib/busser/runner_plugin/serverspec_datadog.rb
|
191
|
+
- lib/busser/serverspec_datadog/runner.rb
|
192
|
+
- lib/busser/serverspec_datadog/version.rb
|
193
|
+
homepage: https://github.com/test-kitchen/busser-serverspec
|
194
|
+
licenses:
|
195
|
+
- Apache 2.0
|
196
|
+
metadata: {}
|
197
|
+
post_install_message:
|
198
|
+
rdoc_options: []
|
199
|
+
require_paths:
|
200
|
+
- lib
|
201
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
202
|
+
requirements:
|
203
|
+
- - ">="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: 2.3.0
|
206
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
|
+
requirements:
|
208
|
+
- - ">="
|
209
|
+
- !ruby/object:Gem::Version
|
210
|
+
version: '0'
|
211
|
+
requirements: []
|
212
|
+
rubygems_version: 3.3.26
|
213
|
+
signing_key:
|
214
|
+
specification_version: 4
|
215
|
+
summary: A Busser runner plugin for Serverspec
|
216
|
+
test_files:
|
217
|
+
- features/plugin_install_command.feature
|
218
|
+
- features/plugin_list_command.feature
|
219
|
+
- features/support/env.rb
|
220
|
+
- features/test_command.feature
|