Skip to content
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

Haproxy spec improvements #287

Merged
merged 1 commit into from
Jan 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions spec/classes/haproxy_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
it { is_expected.to contain_prometheus__daemon('haproxy_exporter') }
end

context 'with unix socket as scraping url' do
context 'with custom scraping uri' do
let(:params) do
{
cnf_scrape_uri: 'unix:/var/haproxy/listen.sock',
Expand All @@ -38,11 +38,21 @@
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('prometheus') }
it { is_expected.to contain_user('haproxy-user') }
it { is_expected.to contain_group('haproxy-exporter') }
it { is_expected.to contain_prometheus__daemon('haproxy_exporter') }
context 'unix socket' do
let(:params) do
super().merge(cnf_scrape_uri: 'unix:/var/haproxy/listen.sock')
end

it { is_expected.to compile.with_all_deps }
end

context 'bad format' do
let(:params) do
super().merge(cnf_scrape_uri: 'nosocket:/not/a/socket.format')
end

it { is_expected.to raise_error(Puppet::Error) }
end
end
end
end
Expand Down