-
Notifications
You must be signed in to change notification settings - Fork 229
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
wip ci #382
Closed
Closed
wip ci #382
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
dc3a0ad
update pdk template 3.0.1
h0tw1r3 ecd2259
disable out-of-scope puppet-lint checks
smortex 0f8b4f0
address pdk validation warnings
h0tw1r3 2ddc476
Modernize/Fix CI
smortex f20697f
mark test pending platform support removal
h0tw1r3 ef5b846
puppetlabs github ci workflows
h0tw1r3 ef32a82
fix basic acceptance tests with github actions
h0tw1r3 fe0ff1d
100% unit test coverage
h0tw1r3 12e4aae
temporarily disable ci dependency checker
h0tw1r3 5372cdc
remove non-existant lint check
h0tw1r3 59f149d
testing forcing postgres_version to redhat > 7
h0tw1r3 eded49d
disable ubuntu-18.04 acceptance test
h0tw1r3 f2991ee
more acceptance tests and work-around for el7 test
h0tw1r3 279caea
fix more acceptance testing
h0tw1r3 6cf3f5a
testing docker memory reduction and non-parallel jobs
h0tw1r3 1219da3
filter out el7 dockers, they just hang in GHA
h0tw1r3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
describe 'puppetdb::database::default_read_grant' do | ||
valid = { | ||
'standard': { | ||
database_name: 'puppetdb', | ||
schema: 'public', | ||
database_username: 'puppetdb', | ||
database_read_only_username: 'puppetdb-read', | ||
} | ||
} | ||
|
||
invalid = { | ||
'no params': {}, | ||
'without database_name': { | ||
schema: 'public', | ||
database_username: 'puppetdb', | ||
database_read_only_username: 'puppetdb-read', | ||
} | ||
} | ||
|
||
let(:facts) { on_supported_os.take(1).first[1] } | ||
let(:pre_condition) { 'include postgresql::server' } | ||
let(:name) { title } | ||
let(:args) { params } | ||
|
||
context 'with valid parameters' do | ||
valid.each do |name, params| | ||
context name do | ||
include_examples 'puppetdb::database::default_read_grant' do | ||
let(:title) { name.to_s } | ||
let(:params) { params } | ||
end | ||
end | ||
end | ||
end | ||
|
||
context 'with invalid parameters' do | ||
invalid.each do |name, params| | ||
context name do | ||
include_examples 'puppetdb::database::default_read_grant', Puppet::Error do | ||
let(:title) { name.to_s } | ||
let(:params) { params } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
valid = { | ||
'puppetdb-read': { | ||
database_name: 'puppetdb', | ||
database_username: 'monitor', | ||
puppetdb_server: 'localhost', | ||
}, | ||
'monitor': { | ||
database_name: 'opensesame', | ||
database_username: 'grover', | ||
puppetdb_server: 'rainbow', | ||
}, | ||
} | ||
|
||
invalid = { | ||
'no params': {}, | ||
} | ||
|
||
describe 'puppetdb::database::postgresql_ssl_rules' do | ||
let(:facts) { on_supported_os.take(1).first[1] } | ||
let(:pre_condition) { 'include postgresql::server' } | ||
let(:name) { title } | ||
let(:args) { params } | ||
|
||
valid.each do |name, params| | ||
context "for valid #{name}" do | ||
include_examples 'puppetdb::database::postgresql_ssl_rules' do | ||
let(:title) { name.to_s } | ||
let(:params) { params } | ||
end | ||
end | ||
end | ||
|
||
invalid.each do |name, params| | ||
context "for invalid #{name}" do | ||
include_examples 'puppetdb::database::postgresql_ssl_rules', Puppet::Error do | ||
let(:title) { name.to_s } | ||
let(:params) { params } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
valid = { | ||
'grant read on new objects from blah to blah': { | ||
database_read_only_username: 'puppetdb-read', | ||
database_name: 'puppetdb', | ||
schema: 'public', | ||
}, | ||
} | ||
|
||
invalid = { | ||
'no params': {}, | ||
} | ||
|
||
describe 'puppetdb::database::read_grant' do | ||
let(:facts) { on_supported_os.take(1).first[1] } | ||
let(:pre_condition) { 'include postgresql::server' } | ||
let(:name) { title } | ||
let(:args) { params } | ||
|
||
valid.each do |name, params| | ||
context "for valid #{name}" do | ||
include_examples 'puppetdb::database::read_grant' do | ||
let(:title) { name.to_s } | ||
let(:params) { params } | ||
end | ||
end | ||
end | ||
|
||
invalid.each do |name, params| | ||
context "for invalid #{name}" do | ||
include_examples 'puppetdb::database::read_grant', Puppet::Error do | ||
let(:title) { name.to_s } | ||
let(:params) { params } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
valid = { | ||
'puppetdb-read': { | ||
read_database_username: 'puppetdb-read', | ||
database_name: 'puppetdb', | ||
password_hash: 'blah', | ||
database_owner: 'puppetdb', | ||
}, | ||
'spectest': { | ||
read_database_username: 'spectest-read', | ||
database_name: 'spectest', | ||
database_owner: 'spectest', | ||
}, | ||
} | ||
|
||
invalid = { | ||
'no params': {}, | ||
} | ||
|
||
describe 'puppetdb::database::read_only_user', type: :define do | ||
let(:facts) { on_supported_os.take(1).first[1] } | ||
let(:pre_condition) { 'include postgresql::server' } | ||
let(:name) { title } | ||
let(:args) { params } | ||
|
||
valid.each do |name, params| | ||
context "for valid #{name}" do | ||
include_examples 'puppetdb::database::read_only_user' do | ||
let(:title) { name.to_s } | ||
let(:params) { params } | ||
end | ||
end | ||
end | ||
|
||
invalid.each do |name, params| | ||
context "for invalid #{name}" do | ||
include_examples 'puppetdb::database::read_only_user', Puppet::Error do | ||
let(:title) { name.to_s } | ||
let(:params) { params } | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
Dir['./spec/support/unit/**/*.rb'].sort.each { |f| require f } | ||
|
||
RSpec.configure do |c| | ||
if ENV['GITHUB_ACTIONS'] | ||
c.formatter = 'RSpec::Github::Formatter' | ||
c.color_mode = :on | ||
end | ||
|
||
c.fail_if_no_examples = true | ||
c.silence_filter_announcements = true | ||
|
||
c.expect_with :rspec do |expectations| | ||
expectations.include_chain_clauses_in_custom_matcher_descriptions = true | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you limit the tests to one OS instead of all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because that's the way it was :) The change was a simple refactor to remove the
let(:facts)
blocks all over the spec tests.Many of the classes, which in some cases are just resource wrappers, there is no purpose to testing all platforms.