diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 801ca06..bf49b28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,8 +51,8 @@ jobs: cache-version: ${{ inputs.cache-version }} working-directory: ${{ inputs.working-directory }} - name: Run beaker - # run: bundle exec beaker --provision --preserve-hosts always --hosts ${{ matrix.env.BEAKER_SETFILE }}{tag=${{ github.repository }}} --log-level debug - run: bundle exec rake beaker + run: bundle exec beaker --provision --preserve-hosts always --hosts ${{ matrix.env.BEAKER_SETFILE }}{tag=${{ github.repository }}} --log-level debug --helper spec/spec_helper_acceptance.rb + # run: bundle exec rake beaker env: ${{ matrix.env }} - name: List images run: docker images diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 87b5c2c..32fa48b 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,5 +1,19 @@ # frozen_string_literal: true -require 'voxpupuli/acceptance/spec_helper_acceptance' +#require 'voxpupuli/acceptance/spec_helper_acceptance' -configure_beaker(modules: :metadata) +#configure_beaker(modules: :metadata) + +require 'beaker_puppet_helpers' + +block_on hosts, run_in_parallel: true do |host| + unless %w[none preinstalled].include?(collection) + BeakerPuppetHelpers::InstallUtils.install_puppet_release_repo_on(host, collection) + end + package_name = ENV.fetch('BEAKER_PUPPET_PACKAGE_NAME', BeakerPuppetHelpers::InstallUtils.puppet_package_name(host, prefer_aio: collection != 'none')) + host.install_package(package_name) + + # by default, puppet-agent creates /etc/profile.d/puppet-agent.sh which adds /opt/puppetlabs/bin to PATH + # in our non-interactive ssh sessions we manipulate PATH in ~/.ssh/environment, we need to do this step here as well + host.add_env_var('PATH', '/opt/puppetlabs/bin') +end