Skip to content

Commit

Permalink
(CAT-1269) - CI Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramesh7 committed Aug 3, 2023
1 parent d1411e2 commit 8a41163
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 97 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:
workflow_dispatch:

jobs:
Spec:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
secrets: "inherit"
# Spec:
# uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
# secrets: "inherit"

Acceptance:
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
# needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@CAT-1269-debug"
secrets: "inherit"
62 changes: 1 addition & 61 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,10 @@
}
],
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8",
"9"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7",
"8"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"7"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"7"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"10",
"11"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
"15"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"18.04",
"20.04",
"22.04"
]
},
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"11"
]
},
{
"operatingsystem": "Rocky",
"operatingsystemrelease": [
"8"
]
},
{
"operatingsystem": "AlmaLinux",
"operatingsystemrelease": [
"8"
"10"
]
}
],
Expand Down
48 changes: 18 additions & 30 deletions spec/acceptance/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,13 @@
ensure => directory,
before => Accounts::User['hunner'],
}
if $facts['puppetversion'][0] == '6' {
$key_test = [
'ssh-rsa #{test_key} vagrant',
'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2'
]
}
else {
$key_test = [#{' '}
'ssh-rsa #{test_key} vagrant',
'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2',
'ecdsa-sha2-nistp256 #{ecdsa_test_key} vagrant3',
'[email protected] #{ecdsa_sk_test_key} vagrant4'
]
}
$key_test = [#{' '}
'ssh-rsa #{test_key} vagrant',
'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2',
'ecdsa-sha2-nistp256 #{ecdsa_test_key} vagrant3',
'[email protected] #{ecdsa_sk_test_key} vagrant4'
]
accounts::user { 'hunner':
groups => ['root'],
Expand Down Expand Up @@ -55,20 +48,13 @@
ensure => directory,
before => Accounts::User['hunner'],
}
if $facts['puppetversion'][0] == '6' {
$key_test = [
'ssh-rsa #{test_key} vagrant',
'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2'
]
}
else {
$key_test = [#{' '}
'ssh-rsa #{test_key} vagrant',
'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2',
'ecdsa-sha2-nistp256 #{ecdsa_test_key} vagrant3',
'[email protected] #{ecdsa_sk_test_key} vagrant4'
]
}
$key_test = [#{' '}
'ssh-rsa #{test_key} vagrant',
'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2',
'ecdsa-sha2-nistp256 #{ecdsa_test_key} vagrant3',
'[email protected] #{ecdsa_sk_test_key} vagrant4'
]
accounts::user { 'hunner':
groups => ['root'],
Expand Down Expand Up @@ -249,7 +235,8 @@

describe 'main tests' do
it 'creates groups of matching names, assigns non-matching group, manages homedir, manages other properties, gives key, makes dotfiles, managevim false' do
apply_manifest(pp_accounts_define, catch_failures: true)
output = apply_manifest(pp_accounts_define, catch_failures: true)
puts output.stdout

expect(user('hunner')).to exist
expect(user('hunner')).to belong_to_group 'hunner'
Expand Down Expand Up @@ -283,7 +270,8 @@

describe 'managevim set to true' do
it '.vim file will be created' do
apply_manifest(pp_with_managevim, catch_failures: true)
output = apply_manifest(pp_with_managevim, catch_failures: true)
puts output.stdout
expect(file('/test/hunner/.vim')).to be_directory
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def set_hieradata(hieradata)
def clear_temp_hieradata
if @temp_hieradata_dirs && !@temp_hieradata_dirs.empty?
@temp_hieradata_dirs.each do |data_dir|
if File.exists?(data_dir)
if File.exist?(data_dir)
FileUtils.rm_r(data_dir)
end
end
Expand Down

0 comments on commit 8a41163

Please sign in to comment.