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

Use Puppet Litmus for acceptance testing #79

Merged
merged 9 commits into from
Aug 10, 2023
Merged
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
5 changes: 4 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
fixtures:
repositories:
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
remote_file: "https://github.com/lwf/puppet-remote_file.git"
puppet_archive: "https://github.com/voxpupuli/puppet-archive.git"
# needed for Litmus acceptance testing:
facts: https://github.com/puppetlabs/puppetlabs-facts.git
provision: https://github.com/puppetlabs/provision.git
puppet_agent: https://github.com/puppetlabs/puppetlabs-puppet_agent.git
symlinks:
ca_cert: "#{source_dir}"
42 changes: 42 additions & 0 deletions .github/workflows/acceptance-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: CI

on: pull_request

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
acceptance:
name: Litmus Acceptance
runs-on: ubuntu-20.04
env:
BOLT_GEM: true
CI: true
steps:
- uses: actions/checkout@v3
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.3'
bundler-cache: true

- name: Provision Testing Environments
run: |
bundle exec rake 'litmus:provision_list[default]'
bundle exec rake 'litmus:install_agent'
bundle exec rake 'litmus:install_module'
- name: Run Tests
run: bundle exec rake 'litmus:acceptance:parallel'

- name: Tear Down
run: bundle exec rake 'litmus:tear_down'

tests:
needs:
- acceptance
runs-on: ubuntu-20.04
name: Test suite
steps:
- run: echo Test suite completed
34 changes: 34 additions & 0 deletions .github/workflows/run-pdk-tests-on-puppet-7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Run PDK tests on Puppet 7.x

on:
- push
- pull_request

jobs:
validate-7:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Run pdk validate
uses: puppets-epic-show-theatre/action-pdk-validate@v1
with:
puppet-version: "7"
# [optional] A string indicating the Puppet version to validate against, such as "5.4.2" or "5.5".
# pe-version: ""
# [optional] A string indicating the PE version to validate against, such as "2017.3.5" or "2018.1".

test-7:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Run unit tests
uses: puppets-epic-show-theatre/action-pdk-test-unit@v1
with:
puppet-version: "7"
# [optional] A string indicating the Puppet version to validate against, such as "5.4.2" or "5.5".
# pe-version: ""
# [optional] A string indicating the PE version to validate against, such as "2017.3.5" or "2018.1".
34 changes: 34 additions & 0 deletions .github/workflows/run-pdk-tests-on-puppet-8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Run PDK tests on Puppet 8.x

on:
- push
- pull_request

jobs:
validate-8:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Run pdk validate
uses: puppets-epic-show-theatre/action-pdk-validate@v1
with:
puppet-version: "8"
# [optional] A string indicating the Puppet version to validate against, such as "5.4.2" or "5.5".
# pe-version: ""
# [optional] A string indicating the PE version to validate against, such as "2017.3.5" or "2018.1".

test-8:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Run unit tests
uses: puppets-epic-show-theatre/action-pdk-test-unit@v1
with:
puppet-version: "8"
# [optional] A string indicating the Puppet version to validate against, such as "5.4.2" or "5.5".
# pe-version: ""
# [optional] A string indicating the PE version to validate against, such as "2017.3.5" or "2018.1".
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/spec/fixtures/modules/*
/tmp/
/vendor/
/convert_report.txt
Expand All @@ -25,3 +25,4 @@
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
11 changes: 6 additions & 5 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/spec/fixtures/modules/*
/tmp/
/vendor/
/convert_report.txt
Expand All @@ -25,18 +25,19 @@
.project
.envrc
/inventory.yaml
/appveyor.yml
/spec/fixtures/litmus_inventory.yaml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/..yml
/.yardopts
/spec/
/.vscode/
/.sync.yml
/.devcontainer/
Loading