Skip to content

Commit

Permalink
Add test for grafana_datasources in different organizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Lukowski committed Jul 11, 2024
1 parent 7f89da9 commit 052cd88
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions spec/acceptance/grafana_datasource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,38 @@ class { 'grafana':
end
end
end

describe 'postgres ds' do
context 'without basic auth' do
let(:manifest) do
<<-PUPPET
['Foo', 'Bar'].each |$organization| {
grafana_organization { $organization:
ensure => present,
grafana_url => 'http://localhost:3000',
grafana_user => 'admin',
grafana_password => 'admin',
} ->
grafana_datasource { $organization:
organization => $organization,
type => 'grafana-postgresql-datasource',
url => 'localhost',
grafana_url => 'http://localhost:3000',
grafana_user => 'admin',
grafana_password => 'admin',
}
}
PUPPET
end

it 'works with no errors' do
apply_manifest_on(default, manifest, catch_failures: true)
end

it 'is idempotent' do
apply_manifest_on(default, manifest, catch_changes: true)
end
end
end
end
end

0 comments on commit 052cd88

Please sign in to comment.