Skip to content

Commit 9156c62

Browse files
authored
Merge pull request #841 from voxpupuli/drop-puppet6
2 parents e233bc3 + 70a46a3 commit 9156c62

13 files changed

+27
-129
lines changed

.github/workflows/ci.yml

+6-80
Original file line numberDiff line numberDiff line change
@@ -7,86 +7,12 @@ name: CI
77
on: pull_request
88

99
concurrency:
10-
group: ${{ github.head_ref }}
10+
group: ${{ github.ref_name }}
1111
cancel-in-progress: true
1212

1313
jobs:
14-
setup_matrix:
15-
name: 'Setup Test Matrix'
16-
runs-on: ubuntu-latest
17-
timeout-minutes: 40
18-
outputs:
19-
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
20-
github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }}
21-
env:
22-
BUNDLE_WITHOUT: development:system_tests:release
23-
steps:
24-
- uses: actions/checkout@v2
25-
- name: Setup ruby
26-
uses: ruby/setup-ruby@v1
27-
with:
28-
ruby-version: '3.0'
29-
bundler-cache: true
30-
- name: Run static validations
31-
run: bundle exec rake validate lint check
32-
- name: Run rake rubocop
33-
run: bundle exec rake rubocop
34-
- name: Setup Test Matrix
35-
id: get-outputs
36-
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround CentOS,Ubuntu
37-
38-
unit:
39-
needs: setup_matrix
40-
runs-on: ubuntu-latest
41-
timeout-minutes: 40
42-
strategy:
43-
fail-fast: false
44-
matrix:
45-
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
46-
env:
47-
BUNDLE_WITHOUT: development:system_tests:release
48-
PUPPET_VERSION: "~> ${{ matrix.puppet }}.0"
49-
name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
50-
steps:
51-
- uses: actions/checkout@v2
52-
- name: Setup ruby
53-
uses: ruby/setup-ruby@v1
54-
with:
55-
ruby-version: ${{ matrix.ruby }}
56-
bundler-cache: true
57-
- name: Run tests
58-
run: bundle exec rake parallel_spec
59-
60-
acceptance:
61-
needs: setup_matrix
62-
runs-on: ubuntu-latest
63-
env:
64-
LANG: en_US
65-
LC_ALL: en_US.UTF-8
66-
BUNDLE_WITHOUT: development:test:release
67-
strategy:
68-
fail-fast: false
69-
matrix:
70-
include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}}
71-
name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
72-
steps:
73-
- uses: actions/checkout@v2
74-
- name: Setup ruby
75-
uses: ruby/setup-ruby@v1
76-
with:
77-
ruby-version: '3.0'
78-
bundler-cache: true
79-
- name: Run tests
80-
run: bundle exec rake beaker
81-
env:
82-
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
83-
BEAKER_setfile: ${{ matrix.setfile.value }}
84-
85-
tests:
86-
needs:
87-
- unit
88-
- acceptance
89-
runs-on: ubuntu-latest
90-
name: Test suite
91-
steps:
92-
- run: echo Test suite completed
14+
puppet:
15+
name: Puppet
16+
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
17+
with:
18+
pidfile_workaround: 'CentOS,Ubuntu'

.msync.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Managed by modulesync - DO NOT EDIT
33
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
44

5-
modulesync_config_version: '5.2.0'
5+
modulesync_config_version: '5.3.0'

.rubocop.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
2-
inherit_from: .rubocop_todo.yml
3-
42
# Managed by modulesync - DO NOT EDIT
53
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
64

5+
inherit_from: .rubocop_todo.yml
76
inherit_gem:
87
voxpupuli-test: rubocop.yml

.sync.yml

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ spec/spec_helper.rb:
99
spec_overrides:
1010
- "require 'support/acceptance/supported_versions'"
1111
- "require 'spec_helper_methods'"
12-
spec/spec_helper_acceptance.rb:
13-
unmanaged: false
1412
.github/workflows/ci.yml:
1513
pidfile_workaround: CentOS,Ubuntu
1614
.puppet-lint.rc:

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
55

66
group :test do
7-
gem 'voxpupuli-test', '~> 5.0', :require => false
7+
gem 'voxpupuli-test', '~> 5.4', :require => false
88
gem 'coveralls', :require => false
99
gem 'simplecov-console', :require => false
1010
gem 'puppet_metadata', '~> 1.0', :require => false

metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"requirements": [
5353
{
5454
"name": "puppet",
55-
"version_requirement": ">= 6.1.0 < 8.0.0"
55+
"version_requirement": ">= 7.0.0 < 8.0.0"
5656
}
5757
],
5858
"operatingsystem_support": [

spec/classes/agent_spec.rb

+2-10
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616

1717
on_supported_os(baseline_os_hash).each do |os, facts|
1818
context "on #{os}" do
19-
systemd_fact = case facts[:osfamily]
20-
when 'Archlinux', 'Fedora', 'Gentoo'
21-
{ systemd: true }
22-
else
23-
{ systemd: false }
24-
end
2519
config_path = case facts[:operatingsystem]
2620
when 'Fedora'
2721
'/etc/zabbix_agentd.conf'
@@ -45,9 +39,7 @@
4539
end
4640
zabbix_version = '5.0'
4741

48-
let :facts do
49-
facts.merge(systemd_fact)
50-
end
42+
let(:facts) { facts }
5143

5244
case facts[:osfamily]
5345
when 'Gentoo'
@@ -221,7 +213,7 @@
221213
context 'it creates a startup script' do
222214
if facts[:kernel] == 'Linux'
223215
case facts[:osfamily]
224-
when 'Archlinux', 'Fedora', 'Gentoo'
216+
when 'Archlinux', 'Debian', 'Gentoo', 'RedHat'
225217
it { is_expected.to contain_file("/etc/init.d/#{service_name}").with_ensure('absent') }
226218
it { is_expected.to contain_file("/etc/systemd/system/#{service_name}.service").with_ensure('file') }
227219
when 'windows'

spec/classes/server_spec.rb

+2-10
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@
1313
next if facts[:os]['name'] == 'windows'
1414

1515
context "on #{os}" do
16-
systemd_fact = case facts[:osfamily]
17-
when 'Archlinux', 'Fedora', 'Gentoo'
18-
{ systemd: true }
19-
else
20-
{ systemd: false }
21-
end
22-
let :facts do
23-
facts.merge(systemd_fact)
24-
end
16+
let(:facts) { facts }
2517

2618
zabbix_version = '5.0'
2719

@@ -155,7 +147,7 @@
155147

156148
context 'it creates a startup script' do
157149
case facts[:osfamily]
158-
when 'Archlinux', 'Fedora', 'Gentoo'
150+
when 'Archlinux', 'Debian', 'Gentoo', 'RedHat'
159151
it { is_expected.to contain_file('/etc/init.d/zabbix-server').with_ensure('absent') }
160152
it { is_expected.to contain_file('/etc/systemd/system/zabbix-server.service').with_ensure('file') }
161153
else

spec/defines/userparameters_spec.rb

+1-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,7 @@
77
next if facts[:os]['name'] == 'windows'
88

99
context "on #{os}" do
10-
let :facts do
11-
systemd_fact = case facts[:os]['family']
12-
when 'Archlinux', 'Fedora', 'Gentoo'
13-
{ systemd: true }
14-
else
15-
{ systemd: false }
16-
end
17-
facts.merge(systemd_fact)
18-
end
10+
let(:facts) { facts }
1911
let(:title) { 'mysqld' }
2012
let(:pre_condition) { 'class { "zabbix::agent": include_dir => "/etc/zabbix/zabbix_agentd.d" }' }
2113

spec/setup_acceptance_node.pp

-6
This file was deleted.

spec/spec_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
require 'voxpupuli/test/spec_helper'
1515

16+
add_mocked_facts!
17+
1618
if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
1719
facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml')))
1820
facts&.each do |name, value|

spec/spec_helper_acceptance.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# frozen_string_literal: true
22

3-
# Managed by modulesync - DO NOT EDIT
4-
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
5-
63
require 'voxpupuli/acceptance/spec_helper_acceptance'
74

8-
configure_beaker
5+
configure_beaker do |host|
6+
# In Puppet 7 the locale ends up being C.UTF-8 if it isn't passed.
7+
# This locale doesn't exist in EL7 and won't be supported either.
8+
# At least PostgreSQL runs into this.
9+
ENV['LANG'] = 'en_US.UTF-8' if host['hypervisor'] == 'docker' && host['platform'] == 'el-7-x86_64'
10+
end
911

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

spec/spec_helper_methods.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ def baseline_os_hash
1818
{
1919
'operatingsystem' => 'Archlinux',
2020
},
21-
{
22-
'operatingsystem' => 'Gentoo',
23-
},
21+
# TODO: Support and tests for Gentoo need to be fixed
22+
# {
23+
# 'operatingsystem' => 'Gentoo',
24+
# },
2425
{
2526
'operatingsystem' => 'windows',
2627
'operatingsystemrelease' => ['2012', '2012 R2', '2016']

0 commit comments

Comments
 (0)