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

enable acceptance tests #89

Merged
merged 8 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
16 changes: 13 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,29 @@ You can install all needed gems for spec tests into the modules directory by
running:

```sh
bundle install --path .vendor/ --without development system_tests release --jobs "$(nproc)"
bundle config set --local path '.vendor/'
bundle config set --local without 'development system_tests release'
bundle install --jobs "$(nproc)"
```

If you also want to run acceptance tests:

```sh
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"
bundle config set --local path '.vendor/'
bundle config set --local without 'development release'
bundle config set --local with 'system_tests'
bundle install --jobs "$(nproc)"
```

Our all in one solution if you don't know if you need to install or update gems:

```sh
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"; bundle update; bundle clean
bundle config set --local path '.vendor/'
bundle config set --local without 'development release'
bundle config set --local with 'system_tests'
bundle install --jobs "$(nproc)"
bundle update
bundle clean
```

As an alternative to the `--jobs "$(nproc)` parameter, you can set an
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ concurrency:
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v2
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
with:
pidfile_workaround: 'false'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
.*.sw?
/.yardoc/
/Guardfile
bolt-debug.log
.rerun.json
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '7.3.0'
modulesync_config_version: '7.5.0'
3 changes: 1 addition & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
inherit_from: .rubocop_todo.yml

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

inherit_from: .rubocop_todo.yml
inherit_gem:
voxpupuli-test: rubocop.yml
2 changes: 1 addition & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
spec/spec_helper.rb:
hiera_config: spec/fixtures/hiera.yaml
hiera_config: "'spec/fixtures/hiera.yaml'"
h-haaks marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 6 additions & 2 deletions spec/acceptance/ca_cert_ca_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@
trusted_ca_file_remote = '/etc/pki/ca-trust/source/anchors/Globalsign_Org_Intermediate.crt'
untrusted_ca_file_remote = '/etc/pki/ca-trust/source/blacklist/CACert.crt'
trusted_ca_file_text = '/etc/pki/ca-trust/source/anchors/InCommon.crt'
when 'Archlinux'
trusted_ca_file_remote = '/etc/ca-certificates/trust-source/anchors/Globalsign_Org_Intermediate.crt'
untrusted_ca_file_remote = '/etc/ca-certificates/trust-source/blacklist/CACert.crt'
trusted_ca_file_text = '/etc/ca-certificates/trust-source/anchors/InCommon.crt'
end

describe 'ca_cert::ca' do
context 'with some normal usage' do
let(:pp) do
let(:manifest) do
<<~EOS
include ::ca_cert

Expand Down Expand Up @@ -74,7 +78,7 @@
describe file(absent_ca_file_remote) do
it { is_expected.not_to be_file }
end
when 'RedHat'
else
describe file(untrusted_ca_file_remote) do
it { is_expected.to be_file }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe 'ca_cert class' do
context 'default parameters' do
let(:pp) do
let(:manifest) do
<<-EOS
include ::ca_cert
EOS
Expand Down
16 changes: 0 additions & 16 deletions spec/acceptance/nodesets/centos-7.yml

This file was deleted.

15 changes: 2 additions & 13 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# frozen_string_literal: true

require 'puppet_litmus'
PuppetLitmus.configure!
require 'voxpupuli/acceptance/spec_helper_acceptance'

require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb'))

shared_examples 'an idempotent resource' do
it 'applies with no errors' do
apply_manifest(pp, catch_failures: true)
end

it 'applies a second time without changes', :skip_pup_5016 do
apply_manifest(pp, catch_changes: true)
end
end
configure_beaker(modules: :metadata)