-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
Update mongodb_exporter to version 0.11.0 #455
Changes from all commits
4fd5da1
5976c7e
7d17047
11f7fac
7d2b77e
6631523
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'prometheus mongodb_exporter' do | ||
it 'mongodb_exporter works idempotently with no errors' do | ||
pp = 'include prometheus::mongodb_exporter' | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, expect_changes: true) | ||
shell('sleep 30') | ||
end | ||
|
||
describe 'prometheus mongodb_exporter version 0.3.1' do | ||
it ' mongodb_exporter installs with version 0.3.1' do | ||
pp = "class { 'prometheus::mongodb_exporter': version => '0.3.1' }" | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
shell('sleep 30') | ||
end | ||
|
||
describe process('mongodb_exporter') do | ||
its(:args) { is_expected.to match %r{\ -mongodb.uri} } | ||
end | ||
dhoppe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
describe service('mongodb_exporter') do | ||
it { is_expected.to be_running } | ||
it { is_expected.to be_enabled } | ||
end | ||
|
||
describe port(9216) do | ||
it { is_expected.to be_listening.with('tcp6') } | ||
end | ||
end | ||
|
||
describe 'prometheus mongodb_exporter version 0.11.0' do | ||
it ' mongodb_exporter installs with version 0.11.0' do | ||
pp = "class { 'prometheus::mongodb_exporter': version => '0.11.0', use_kingpin => true }" | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
shell('sleep 30') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could it be this sleep is not working correctly? With systemd I'd suggest some proper ready check. Ideally using the notify type but the exporter probably doesn't support that. An alternative is theforeman/puppet-qpid@7534cd9 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is an interesting thought. In the case of In this case, however, you should only make sure that the service has been started before checking if the port is open. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With systemd, a properly written service will not return until it has properly started. Since they often run in the foreground, there is no forking and initialization in the background. The idea of that alternative is that systemd checks the port is open and only then does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ekohl that's clever hack! |
||
end | ||
|
||
describe process('mongodb_exporter') do | ||
its(:args) { is_expected.to match %r{\ --mongodb.uri} } | ||
end | ||
|
||
describe service('mongodb_exporter') do | ||
it { is_expected.to be_running } | ||
it { is_expected.to be_enabled } | ||
end | ||
|
||
describe port(9216) do | ||
it { is_expected.to be_listening.with('tcp6') } | ||
end | ||
end | ||
end |
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.
We should not be using the arrow syntax between resources like this and should instead use before/require and notify/subscribe metaparameters.
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.
Looks like this was no problem two years ago:
Good luck with checking the remaining ~130 modules.