Skip to content

Commit 793950c

Browse files
Daktakevpl
authored andcommitted
(BKR-1500) Dependency Cleanup (#55)
* (BKR-1500) Move Leftover EZBake stuff from beaker * (BKR-1500) Move Windows install_utils from beaker * (BKR-1500) Move facter_helpers and puppet/facter wrappers from beaker * (BKR-1500) Move clone_git_repo_on_test.rb from beaker Since this functionality is in beaker-puppet, its tests belong here too. Also removes a redundant install_utils from beaker-puppet acceptance and updates the install_package_on method in foss_utils to support platform SLES (which was updated in the redunadnt acceptance install_utils). * (BKR-1500) `require 'beaker-puppet'` in test cases Since beaker no longer automatically includes beaker-puppet, we must explicitly include it in all test cases. * (BKR-1500) Restructure DSL extension module to conform to template standards Note that this doesn't follow beaker-template format exactly, due to unanticipated namespace conflicts in test_case. * (BKR-496) Cleanup of #tmpdir_on * (BKR-1500) Add beaker-vmpooler dependency for local acceptance testing * (BKR-1500) Pin Beaker requirement to ~>4.0 And document this in README.
1 parent d1202d9 commit 793950c

25 files changed

+1089
-281
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ end
1616

1717

1818
group :test do
19-
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.24')
19+
gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4.0')
2020
gem "beaker-abs", *location_for(ENV['ABS_VERSION'] || '~> 0.4.0')
2121
end
2222

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,27 @@ of beaker, please do, we would love any help that you'd like to provide.
99

1010
# How Do I Use This?
1111

12+
## With Beaker 3.x
13+
14+
This library is included as a dependency of Beaker 3.x versions and is automatically included, so there's nothing to do.
15+
16+
## With Beaker 4.x
17+
18+
As of Version 1.0 of `beaker-puppet`, the minimum supported version of beaker is Version 4.0. If you use `ENV['BEAKER_VERSION']`, you will have to ensure that this is compatible, and that if you are using a local Git repository it is up to date.
19+
20+
As of beaker 4.0, all hypervisor and DSL extension libraries have been removed and are no longer dependencies. In order to use a specific hypervisor or DSL extension library in your project, you will need to include them alongside Beaker in your Gemfile or project.gemspec. E.g.
21+
22+
~~~ruby
23+
# Gemfile
24+
gem 'beaker', '~>4.0'
25+
gem 'beaker-puppet', '~>1.0'
26+
# project.gemspec
27+
s.add_runtime_dependency 'beaker', '~>4.0'
28+
s.add_runtime_dependency 'beaker-puppet', '~>1.0'
29+
~~~
30+
31+
For DSL Extension Libraries, you must also ensure that you `require` the library in your test files. You can do this manually in individual test files or in a test helper (if you have one). You can [use `Bundler.require()`](https://bundler.io/v1.16/guides/groups.html) to require the library automatically.
32+
1233
### Right Now? (beaker 3.x)
1334

1435
At this point, beaker-puppet is included in beaker, so you don't have to _do_

acceptance/lib/beaker/acceptance/install_utils.rb

Lines changed: 0 additions & 58 deletions
This file was deleted.

acceptance/pre_suite/gem/install.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'beaker-puppet'
2+
13
hosts.each do |host|
24
install_puppet_from_gem(host, {:version => '3.8.7'})
35
unless host['platform'] =~ /windows/

acceptance/pre_suite/git/install.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
begin
2-
require 'beaker/acceptance/install_utils'
3-
extend Beaker::Acceptance::InstallUtils
4-
end
1+
require 'beaker-puppet'
2+
53
test_name 'Puppet git pre-suite'
64

75
install = [
@@ -10,8 +8,6 @@
108
'puppet#3.8.7'
119
]
1210

13-
SourcePath = Beaker::DSL::InstallUtils::SourcePath
14-
1511
PACKAGES = {
1612
:redhat => [
1713
'git',

acceptance/pre_suite/pkg/install.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'beaker-puppet'
2+
13
# the version is required on windows
24
# all versions are required for osx
35
install_puppet({

acceptance/tests/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Beaker Acceptance Tests: puppet
22

33
Tests that depend upon Puppet being installed on the SUTs.
4+
5+
As of Beaker 4.0, you must `require 'beaker-puppet'` in each of these test files in order to access beaker-puppet DSL extensions.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
require 'beaker-puppet'
2+
3+
confine :except, :platform => /^solaris-10/
4+
5+
test_name 'Clone from git' do
6+
7+
PACKAGES = {
8+
:redhat => [
9+
'git',
10+
],
11+
:debian => [
12+
['git', 'git-core'],
13+
],
14+
:solaris_11 => [
15+
['git', 'developer/versioning/git'],
16+
],
17+
:solaris_10 => [
18+
'coreutils',
19+
'curl', # update curl to fix "CURLOPT_SSL_VERIFYHOST no longer supports 1 as value!" issue
20+
'git',
21+
],
22+
:windows => [
23+
'git',
24+
],
25+
:sles => [
26+
'git-core',
27+
]
28+
}
29+
30+
31+
install_packages_on(hosts, PACKAGES, :check_if_exists => true)
32+
33+
# implicitly tests build_giturl() and lookup_in_env()
34+
hosts.each do |host|
35+
on host, "echo #{GitHubSig} >> $HOME/.ssh/known_hosts"
36+
testdir = host.tmpdir(File.basename(__FILE__))
37+
38+
step 'should be able to successfully clone a git repo' do
39+
results = clone_git_repo_on(host, "#{testdir}", extract_repo_info_from(build_git_url('hiera')))
40+
assert_match( %r{From.*github\.com[:/]puppetlabs/hiera}, result.output, 'Did not find clone')
41+
end
42+
end
43+
end

acceptance/tests/install_smoke_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'beaker-puppet'
2+
13
test_name "puppet install smoketest"
24

35
step 'puppet install smoketest: verify \'facter --help\' can be successfully called on all hosts'

acceptance/tests/stub_host.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'beaker-puppet'
2+
13
test_name "validate host stubbing behavior"
24

35
def get_hosts_file(host)

0 commit comments

Comments
 (0)