diff --git a/.github/actions/presuite.rb b/.github/actions/presuite.rb index 6b24b59486..58cfee89ea 100644 --- a/.github/actions/presuite.rb +++ b/.github/actions/presuite.rb @@ -32,7 +32,7 @@ def initialize_beaker def beaker_platform { 'ubuntu-20.04' => 'ubuntu2004-64a', - 'macos-latest' => 'osx11-64a', + 'macos-11' => 'osx11-64a', 'windows-2016' => 'windows2016-64a', 'windows-2019' => 'windows2019-64a' }[HOST_PLATFORM] @@ -48,9 +48,19 @@ def install_puppet_agent message('INSTALL PUPPET AGENT') beaker_puppet_root = run('bundle info beaker-puppet --path') - presuite_file_path = File.join(beaker_puppet_root.chomp, 'setup', 'aio', '010_Install_Puppet_Agent.rb') - run("beaker exec pre-suite --pre-suite #{presuite_file_path} --preserve-state", './', env_path_var) + # Bundler/Rubygems can sometimes give output other than the filepath (deprecation warnings, etc.) + begin + if File.exist?(beaker_puppet_root.chomp) + presuite_file_path = File.join(beaker_puppet_root.chomp, 'setup', 'aio', '010_Install_Puppet_Agent.rb') + + run("beaker exec pre-suite --pre-suite #{presuite_file_path} --preserve-state", './', env_path_var) + else + exit + end + rescue SystemExit + puts "`bundle info beaker-puppet --path` produced unexpected output, please address this." + end end def puppet_puppet_bin_dir diff --git a/.github/workflows/acceptance_tests.yml b/.github/workflows/acceptance_tests.yml index 7a26942346..3386e4f243 100644 --- a/.github/workflows/acceptance_tests.yml +++ b/.github/workflows/acceptance_tests.yml @@ -14,7 +14,7 @@ jobs: name: Platform strategy: matrix: - os: [ windows-2019, ubuntu-20.04, macos-latest ] + os: [ windows-2019, ubuntu-20.04, macos-11 ] runs-on: ${{ matrix.os }} env: BEAKER_debug: true @@ -24,14 +24,15 @@ jobs: steps: - name: Checkout current PR - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: facter - - name: Install Ruby 2.6 + - name: Install Ruby 2.7 uses: ruby/setup-ruby@v1 with: - ruby-version: '2.6' + ruby-version: '2.7' + rubygems: '3.3.26' - name: Fix common Linux and macOS permissions if: runner.os != 'Windows' diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index dfbae1bbef..3d848a7ad0 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -15,12 +15,12 @@ jobs: name: RuboCop steps: - name: Checkout current PR - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Rubocop checks uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6 + ruby-version: '2.7' - run: bundle install --jobs 3 --retry 3 - run: bundle exec rubocop --parallel @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-20.04 name: RuboCop TODO steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - uses: gimmyxd/rtc-action@0.3.1 env: RTC_TOKEN: ${{ secrets.RTC_TOKEN }} @@ -42,13 +42,13 @@ jobs: name: commit message steps: - name: Checkout current PR - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 - name: Commit message checks uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6 + ruby-version: '2.7' - run: bundle install --jobs 3 --retry 3 - run: bundle exec rake commits diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 8be2727e6f..d42f7705dc 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -12,7 +12,7 @@ jobs: name: coverage steps: - name: Checkout current PR - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Code Climate test-reporter run: | @@ -23,7 +23,7 @@ jobs: - name: Generate coverage uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6 + ruby-version: '2.7' - run: bundle install --jobs 3 --retry 3 - run: bundle exec rake spec diff --git a/.github/workflows/snyk_monitor.yaml b/.github/workflows/snyk_monitor.yaml index aca93b0ee3..d2165a5486 100644 --- a/.github/workflows/snyk_monitor.yaml +++ b/.github/workflows/snyk_monitor.yaml @@ -11,11 +11,11 @@ jobs: name: Snyk Monitor steps: - name: Checkout current PR - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: '2.7' - name: Install dependencies run: bundle install --jobs 3 --retry 3 - name: Run Snyk to check for vulnerabilities diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 19630fd988..a891b72571 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout current PR - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Rspec checks uses: ruby/setup-ruby@v1 @@ -47,7 +47,7 @@ jobs: runs-on: windows-2019 steps: - name: Checkout current PR - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Rspec checks uses: ruby/setup-ruby@v1 diff --git a/spec/mocks/win32.rb b/spec/mocks/win32.rb index 06ae7c924f..57b1c8f8b8 100644 --- a/spec/mocks/win32.rb +++ b/spec/mocks/win32.rb @@ -6,6 +6,9 @@ def keys; end def close; end + module API + end + class HKEY_LOCAL_MACHINE def self.open(*); end