Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add acceptance tests for docker setups #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ concurrency:
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v1
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
3 changes: 3 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
spec/spec_helper_acceptance.rb:
unmanaged: false
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ end

group :system_tests do
gem 'voxpupuli-acceptance', '~> 1.0', :require => false
gem 'beaker-hcloud', require: false, git: 'https://github.com/oneiros/beaker-hcloud', branch: 'issue-10'
end

group :release do
Expand Down
21 changes: 21 additions & 0 deletions spec/acceptance/docker_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require 'spec_helper_acceptance'

describe 'hdm' do
context 'with docker' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'hdm':
method => 'docker',
}
PUPPET
end
end
describe service('docker-hdm') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
end
end
6 changes: 6 additions & 0 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Needed for os.distro.codebase fact
if $facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['full'] == '18.04' and versioncmp($facts['puppetversion'], '7') <= 0 {
package{'lsb-release':
ensure => present,
}
}
10 changes: 10 additions & 0 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

require 'voxpupuli/acceptance/spec_helper_acceptance'

configure_beaker

Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }