Skip to content

Commit

Permalink
Merge pull request voxpupuli#346 from bastelfreak/pushgateway
Browse files Browse the repository at this point in the history
pushgateway: use correct CPU architecture & add acceptance tests
  • Loading branch information
bastelfreak committed Jul 15, 2019
2 parents 29ad10b + e497611 commit 2f9ad35
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/pushgateway.pp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
String $os = $prometheus::os,
String $extra_options = '',
Optional[String] $download_url = undef,
String $arch = $prometheus::arch,
String[1] $arch = $prometheus::real_arch,
String $bin_dir = $prometheus::bin_dir,
) inherits prometheus {

Expand Down
52 changes: 52 additions & 0 deletions spec/acceptance/pushgateway_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
require 'spec_helper_acceptance'

describe 'prometheus pushgateway' do
it 'pushgateway works idempotently with no errors' do
pp = 'include prometheus::pushgateway'
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe service('pushgateway') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe port(9091) do
it { is_expected.to be_listening.with('tcp6') }
end

describe 'pushgateway update from 0.4.0 to 0.8.0' do
it 'is idempotent' do
pp = "class{'prometheus::pushgateway': version => '0.4.0'}"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe service('pushgateway') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe port(9091) do
it { is_expected.to be_listening.with('tcp6') }
end
it 'is idempotent' do
pp = "class{'prometheus::pushgateway': version => '0.8.0'}"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe service('pushgateway') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe port(9091) do
it { is_expected.to be_listening.with('tcp6') }
end
end
end

0 comments on commit 2f9ad35

Please sign in to comment.