Skip to content

Commit

Permalink
Add Unit testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed May 23, 2024
1 parent 87adab4 commit 22f99b0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixtures:
repositories:
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git
sudo: https://github.com/saz/puppet-sudo.git
systemd: https://github.com/voxpupuli/puppet-systemd.git
29 changes: 29 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'bolt' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end

context 'with all defaults' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('puppet-bolt') }
it { is_expected.to contain_package('puppet-tools-release') }
it { is_expected.not_to contain_yumrepo('puppet-tools') }
end

context 'with use_release_package=false' do
let :params do
{ use_release_package: false }
end

it { is_expected.not_to contain_package('puppet-tools-release') }

Check failure on line 24 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bolt on almalinux-8-x86_64 with use_release_package=false is expected not to contain Package[puppet-tools-release] Failure/Error: it { is_expected.not_to contain_package('puppet-tools-release') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az664-357.ubaeeetsagyeff0w5uscwrtwlg.ex.internal.cloudapp.net

Check failure on line 24 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bolt on almalinux-9-x86_64 with use_release_package=false is expected not to contain Package[puppet-tools-release] Failure/Error: it { is_expected.not_to contain_package('puppet-tools-release') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az664-357.ubaeeetsagyeff0w5uscwrtwlg.ex.internal.cloudapp.net

Check failure on line 24 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bolt on centos-7-x86_64 with use_release_package=false is expected not to contain Package[puppet-tools-release] Failure/Error: it { is_expected.not_to contain_package('puppet-tools-release') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az664-357.ubaeeetsagyeff0w5uscwrtwlg.ex.internal.cloudapp.net

Check failure on line 24 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bolt on centos-8-x86_64 with use_release_package=false is expected not to contain Package[puppet-tools-release] Failure/Error: it { is_expected.not_to contain_package('puppet-tools-release') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az664-357.ubaeeetsagyeff0w5uscwrtwlg.ex.internal.cloudapp.net

Check failure on line 24 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bolt on centos-9-x86_64 with use_release_package=false is expected not to contain Package[puppet-tools-release] Failure/Error: it { is_expected.not_to contain_package('puppet-tools-release') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az664-357.ubaeeetsagyeff0w5uscwrtwlg.ex.internal.cloudapp.net

Check failure on line 24 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bolt on almalinux-8-x86_64 with use_release_package=false is expected not to contain Package[puppet-tools-release] Failure/Error: it { is_expected.not_to contain_package('puppet-tools-release') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az1476-337.j1rl24vzoizernbgep2epjdo2f.gx.internal.cloudapp.net

Check failure on line 24 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bolt on redhat-9-x86_64 with use_release_package=false is expected not to contain Package[puppet-tools-release] Failure/Error: it { is_expected.not_to contain_package('puppet-tools-release') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az1476-337.j1rl24vzoizernbgep2epjdo2f.gx.internal.cloudapp.net

Check failure on line 24 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bolt on redhat-7-x86_64 with use_release_package=false is expected not to contain Package[puppet-tools-release] Failure/Error: it { is_expected.not_to contain_package('puppet-tools-release') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az1476-337.j1rl24vzoizernbgep2epjdo2f.gx.internal.cloudapp.net

Check failure on line 24 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bolt on oraclelinux-9-x86_64 with use_release_package=false is expected not to contain Package[puppet-tools-release] Failure/Error: it { is_expected.not_to contain_package('puppet-tools-release') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az1476-337.j1rl24vzoizernbgep2epjdo2f.gx.internal.cloudapp.net

Check failure on line 24 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bolt on centos-7-x86_64 with use_release_package=false is expected not to contain Package[puppet-tools-release] Failure/Error: it { is_expected.not_to contain_package('puppet-tools-release') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az1476-337.j1rl24vzoizernbgep2epjdo2f.gx.internal.cloudapp.net
it { is_expected.to contain_yumrepo('puppet-tools') }

Check failure on line 25 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bolt on almalinux-8-x86_64 with use_release_package=false is expected to contain Yumrepo[puppet-tools] Failure/Error: it { is_expected.to contain_yumrepo('puppet-tools') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az664-357.ubaeeetsagyeff0w5uscwrtwlg.ex.internal.cloudapp.net

Check failure on line 25 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bolt on almalinux-9-x86_64 with use_release_package=false is expected to contain Yumrepo[puppet-tools] Failure/Error: it { is_expected.to contain_yumrepo('puppet-tools') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az664-357.ubaeeetsagyeff0w5uscwrtwlg.ex.internal.cloudapp.net

Check failure on line 25 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bolt on centos-7-x86_64 with use_release_package=false is expected to contain Yumrepo[puppet-tools] Failure/Error: it { is_expected.to contain_yumrepo('puppet-tools') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az664-357.ubaeeetsagyeff0w5uscwrtwlg.ex.internal.cloudapp.net

Check failure on line 25 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bolt on centos-8-x86_64 with use_release_package=false is expected to contain Yumrepo[puppet-tools] Failure/Error: it { is_expected.to contain_yumrepo('puppet-tools') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az664-357.ubaeeetsagyeff0w5uscwrtwlg.ex.internal.cloudapp.net

Check failure on line 25 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bolt on centos-9-x86_64 with use_release_package=false is expected to contain Yumrepo[puppet-tools] Failure/Error: it { is_expected.to contain_yumrepo('puppet-tools') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az664-357.ubaeeetsagyeff0w5uscwrtwlg.ex.internal.cloudapp.net

Check failure on line 25 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bolt on almalinux-8-x86_64 with use_release_package=false is expected to contain Yumrepo[puppet-tools] Failure/Error: it { is_expected.to contain_yumrepo('puppet-tools') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az1476-337.j1rl24vzoizernbgep2epjdo2f.gx.internal.cloudapp.net

Check failure on line 25 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bolt on redhat-9-x86_64 with use_release_package=false is expected to contain Yumrepo[puppet-tools] Failure/Error: it { is_expected.to contain_yumrepo('puppet-tools') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az1476-337.j1rl24vzoizernbgep2epjdo2f.gx.internal.cloudapp.net

Check failure on line 25 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bolt on redhat-7-x86_64 with use_release_package=false is expected to contain Yumrepo[puppet-tools] Failure/Error: it { is_expected.to contain_yumrepo('puppet-tools') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az1476-337.j1rl24vzoizernbgep2epjdo2f.gx.internal.cloudapp.net

Check failure on line 25 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bolt on oraclelinux-9-x86_64 with use_release_package=false is expected to contain Yumrepo[puppet-tools] Failure/Error: it { is_expected.to contain_yumrepo('puppet-tools') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az1476-337.j1rl24vzoizernbgep2epjdo2f.gx.internal.cloudapp.net

Check failure on line 25 in spec/classes/init_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bolt on centos-7-x86_64 with use_release_package=false is expected to contain Yumrepo[puppet-tools] Failure/Error: it { is_expected.to contain_yumrepo('puppet-tools') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'yumrepo' (file: /home/runner/work/puppet-bolt/puppet-bolt/spec/fixtures/modules/bolt/manifests/init.pp, line: 29, column: 5) on node fv-az1476-337.j1rl24vzoizernbgep2epjdo2f.gx.internal.cloudapp.net
end
end
end
end

0 comments on commit 22f99b0

Please sign in to comment.