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

Support BEAKER_FACTER matrix generation #42

Merged
merged 2 commits into from
Oct 11, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/beaker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ on:
default: docker
required: false
type: string
beaker_facter:
description: Expand the Beaker matrix based on a fact
default: 'false'
required: false
type: string
domain:
description: The domain that will be used for the beaker instances
default: "example.com"
Expand All @@ -55,6 +60,9 @@ on:
required: false
type: string

env:
BEAKER_HYPERVISOR: ${{ inputs.beaker_hypervisor }}

jobs:
setup_matrix:
defaults:
Expand All @@ -65,7 +73,7 @@ jobs:
timeout-minutes: ${{ inputs.timeout_minutes }}
outputs:
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }}
puppet_beaker_test_matrix: ${{ steps.get-outputs.outputs.puppet_beaker_test_matrix }}
env:
BUNDLE_WITHOUT: development:system_tests:release
PUPPET_GEM_VERSION: "~> 7.0"
Expand All @@ -88,7 +96,7 @@ jobs:
if: ${{ inputs.rubocop }}
- name: Setup Test Matrix
id: get-outputs
run: bundle exec metadata2gha --domain ${{ inputs.domain }} --pidfile-workaround ${{ inputs.pidfile_workaround }}
run: bundle exec metadata2gha --domain ${{ inputs.domain }} --pidfile-workaround ${{ inputs.pidfile_workaround }} --beaker-facter "${{ inputs.beaker_facter }}"

unit:
defaults:
Expand Down Expand Up @@ -131,8 +139,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}}
# TODO: beaker_fact_matrix input
include: ${{fromJson(needs.setup_matrix.outputs.puppet_beaker_test_matrix)}}
name: "${{ matrix.name }}"
steps:
- uses: actions/checkout@v4
Expand All @@ -148,10 +155,7 @@ jobs:
working-directory: ${{ inputs.working-directory }}
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_SETFILE: ${{ matrix.setfile.value }}
BEAKER_HYPERVISOR: ${{ inputs.beaker_hypervisor }}
env: ${{ matrix.env }}

tests:
needs:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ group :test do
# CI will typically set it to '~> 7.0' to get 7.x
gem 'puppet', ENV.fetch('PUPPET_GEM_VERSION', '>= 0'), require: false
# Needed to build the test matrix based on metadata
gem 'puppet_metadata', '~> 3.3', require: false
gem 'puppet_metadata', '~> 3.4', require: false
# Needed for the rake tasks
gem 'puppetlabs_spec_helper', '>= 2.16.0', '< 7', require: false
# Rubocop versions are also specific so it's recommended
Expand Down