Skip to content

Commit 10359ab

Browse files
committed
WIP: Figure out how to test task in acceptance tests
1 parent 442424c commit 10359ab

File tree

6 files changed

+29
-1
lines changed

6 files changed

+29
-1
lines changed

.fixtures.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ fixtures:
1212
git: 'https://github.com/theforeman/puppet-git.git'
1313
inifile: 'https://github.com/puppetlabs/puppetlabs-inifile.git'
1414
puppetdb: 'https://github.com/puppetlabs/puppetlabs-puppetdb.git'
15+
ruby_task_helper: 'https://github.com/puppetlabs/puppetlabs-ruby_task_helper.git'
1516
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
1617
systemd: 'https://github.com/camptocamp/puppet-systemd.git'
1718
yumrepo_core:

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ matrix:
2727
env:
2828
- BEAKER_PUPPET_COLLECTION=puppet6
2929
- BEAKER_setfile=centos7-64{hostname=centos7-64.example.com}
30-
script: bundle exec rake beaker
30+
script: bundle exec rake spec_prep beaker
3131
services: docker
3232
bundler_args: --without development
3333
before_install:

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@ gem 'beaker-puppet_install_helper', {"groups"=>["system_tests"]}
3737
gem 'metadata-json-lint'
3838
gem 'kafo_module_lint'
3939
gem 'parallel_tests'
40+
gem 'bolt', '~> 1.15'
41+
gem 'beaker-task_helper', '~> 1.5.2'
4042

4143
# vim:ft=ruby

spec/acceptance/nodesets/centos-7-x64.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ HOSTS:
33
centos-7-x64:
44
roles:
55
- master
6+
- target
67
platform: centos-7-x86_64
78
box: centos/7
89
hypervisor: vagrant
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require 'spec_helper_acceptance'
2+
require 'beaker-task_helper/inventory'
3+
require 'bolt_spec/run'
4+
5+
describe 'run_agent task' do
6+
include Beaker::TaskHelper::Inventory
7+
include BoltSpec::Run
8+
9+
def bolt_config
10+
{ 'modulepath' => File.join(File.dirname(File.expand_path(__FILE__)),'../','fixtures', 'modules') }
11+
end
12+
13+
def bolt_inventory
14+
hosts_to_inventory
15+
end
16+
17+
it 'works - HA! I wish!' do
18+
results = run_task('puppet::run_agent', 'target', {})
19+
pp results
20+
end
21+
end

spec/spec_helper_acceptance.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
ENV['BEAKER_setfile'] ||= 'centos7-64{hostname=centos7-64.example.com}'
66
ENV['BEAKER_HYPERVISOR'] ||= 'docker'
77

8+
require 'bolt/pal'
9+
Bolt::PAL.load_puppet
10+
811
require 'beaker-puppet'
912
require 'beaker-rspec'
1013
require 'beaker/puppet_install_helper'

0 commit comments

Comments
 (0)