Skip to content

Commit

Permalink
Set test on PR only
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-robertson committed May 20, 2024
1 parent b863d49 commit 30f6c7e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 46 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: "integration"

on:
push:
pull_request:
branches:
- feature_*
- "main"

jobs:

Expand All @@ -30,11 +30,9 @@ jobs:
bundle env
echo ::endgroup::
# - name: modify sudo settings
# run: |
# sudo sed -i 's/Defaults env_reset//' /etc/sudoers
# sudo cat /etc/sudoers
# sudo find /etc/sudoers.d/ -exec cat {} \;
- name: modify sudo settings
run: |
sudo sed -i 's/Defaults env_reset//' /etc/sudoers
- name: Create the fixtures directory
run: |
Expand All @@ -60,19 +58,19 @@ jobs:
curl -k https://localhost:8140/packages/current/install.bash -I
sudo -E /opt/hostedtoolcache/Ruby/2.7.8/x64/bin/bundle exec bolt --modulepath spec/fixtures/modules task run bootstrap --targets localhost master=localhost certname=testing123.com
Integration_windows:
runs-on: windows-latest
env:
PUPPET_GEM_VERSION: '~> 7.24'
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?
# Integration_windows: Currently no way to test Windows agent installation.
# runs-on: windows-latest
# env:
# PUPPET_GEM_VERSION: '~> 7.24'
# FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?


steps:
- name: enable long file path
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
- name: checkout source
uses: actions/checkout@v4
# steps:
# - name: enable long file path
# run: |
# New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
# - name: checkout source
# uses: actions/checkout@v4

# - name: Activate Ruby 3.2
# uses: ruby/setup-ruby@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pwsh_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
name: "pwsh_lint"

on:
push:
pull_request:
branches:
- feature_*
- "main"

jobs:
pwsh_lint:
Expand Down
32 changes: 6 additions & 26 deletions spec/acceptance/linux_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,11 @@ def return_hostname
end

describe 'bootstrap task' do
include BoltSpec::Run
let(:bolt_config) { { 'modulepath' => RSpec.configuration.module_path } }
let(:bootstrap_dir) { File.join(RSpec.configuration.module_path, '../docker_provision') }
# let(:expected_default_output) { { 'clivar' => 'override', 'tfstatevar' => 'foo' } }
# let(:expected_modified_output) { { 'clivar' => 'foo', 'tfstatevar' => 'bar' } }
# let(:var_file) { 'tfvar_alternate.tfvars' }
# describe 'install' do
# it 'installs the agent', pending: 'Test needs re-written and nodesets fixed' do
# on(master, "puppet cert list #{return_hostname}").stdout.match(%r{[0-9A-F:]{95}})[0] if pe_install?
# result = run_task(task_name: 'bootstrap::linux', params: "master=#{return_hostname} cacert_content=\"$(cat /etc/puppetlabs/puppet/ssl/certs/ca.pem)\"")
# expect_multiple_regexes(result: result, regexes: [%r{Installed}, %r{Job completed. 1/1 nodes succeeded|Ran on 1 node}])
# end
# end

before(:all) do
bolt_config = { 'modulepath' => RSpec.configuration.module_path }
bootstrap_dir = File.join(RSpec.configuration.module_path, '../docker_provision')
puts bolt_config
puts bootstrap_dir
result = run_plan('deploy_pe::provision_master', 'targets' => 'localhost', 'version' => '2021.7.8')
expect(result['status']).to eq('success')
end

it 'installs Puppet agent' do
result = run_task('bootstrap', 'localhost', { 'master' => 'localhost', 'certname' => 'testing123.com' })
expect(result['status']).to eq('success')
describe 'install' do
it 'installs the agent', pending: 'Test needs re-written and nodesets fixed' do
on(master, "puppet cert list #{return_hostname}").stdout.match(%r{[0-9A-F:]{95}})[0] if pe_install?
result = run_task(task_name: 'bootstrap::linux', params: "master=#{return_hostname} cacert_content=\"$(cat /etc/puppetlabs/puppet/ssl/certs/ca.pem)\"")
expect_multiple_regexes(result: result, regexes: [%r{Installed}, %r{Job completed. 1/1 nodes succeeded|Ran on 1 node}])
end
end
end

0 comments on commit 30f6c7e

Please sign in to comment.