From 57d42d8884a9815192f1deb4e7587fb3c18c9c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 16 Feb 2022 14:04:31 -1000 Subject: [PATCH] Add basic acceptance tests --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ .sync.yml | 3 +++ spec/acceptance/class_spec.rb | 14 ++++++++++++++ spec/spec_helper_acceptance.rb | 6 +++--- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 .sync.yml create mode 100644 spec/acceptance/class_spec.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a94a7e4..d6f22b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,9 +57,33 @@ jobs: - name: Run tests run: bundle exec rake parallel_spec + acceptance: + needs: setup_matrix + runs-on: ubuntu-latest + env: + BUNDLE_WITHOUT: development:test:release + strategy: + fail-fast: false + matrix: + include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}} + name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} + steps: + - uses: actions/checkout@v2 + - name: Setup ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + bundler-cache: true + - name: Run tests + run: bundle exec rake beaker + env: + BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }} + BEAKER_setfile: ${{ matrix.setfile.value }} + tests: needs: - unit + - acceptance runs-on: ubuntu-latest name: Test suite steps: diff --git a/.sync.yml b/.sync.yml new file mode 100644 index 0000000..5d21319 --- /dev/null +++ b/.sync.yml @@ -0,0 +1,3 @@ +--- +spec/spec_helper_acceptance.rb: + unmanaged: false diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb new file mode 100644 index 0000000..7541ebc --- /dev/null +++ b/spec/acceptance/class_spec.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +require 'spec_helper_acceptance' + +describe 'syslog_ng class' do + it_behaves_like 'an idempotent resource' do + let(:manifest) do + <<-PUPPET + class { 'syslog_ng': + } + PUPPET + end + end +end diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index c556c51..d3a6e23 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,8 +1,8 @@ -# DO NOT EDIT THIS FILE! -# This file is managed by ModuleSync. -# # 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