Skip to content

Commit

Permalink
Fix acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Feb 2, 2024
1 parent 4336181 commit fdef345
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/puppet/provider/grafana_team/grafana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def format_dashboard(dashboard)

{
id: dashboard.first['id'],
uid: dashboard.first['uid'],
name: dashboard.first['title'],
folder_uid: dashboard.first['folderUid'],
folder_name: dashboard.first['folderTitle'],
Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/grafana_folder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class { 'grafana':
grafana_password => 'admin',
permissions => [
{'permission' => 1, 'role' => 'Editor'},
{'permission' => 1, 'role' => 'Admin'},
],
}
EOS
Expand Down Expand Up @@ -103,7 +102,6 @@ class { 'grafana':
grafana_password => 'admin',
permissions => [
{'permission' => 1, 'role' => 'Viewer'},
{'permission' => 1, 'role' => 'Admin'},
],
}
EOS
Expand Down
7 changes: 6 additions & 1 deletion spec/acceptance/grafana_team_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ class { 'grafana':
it 'has set default home dashboard' do
shell('curl --user admin:admin http://localhost:3000/api/teams/1/preferences') do |f|
data = JSON.parse(f.stdout)
expect(data).to include('homeDashboardId' => 0)
# preferences are empty by default in Grafana 10
if grafana_version =~ %r{^(8|9)}
expect(data).to include('homeDashboardId' => 0)
else
expect(data).to be_empty
end
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/grafana_user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ class { 'grafana':
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
grafana_user { 'admin1':
grafana_user { 'user1':
ensure => absent,
grafana_url => 'http://localhost:3000',
grafana_user => 'user1',
grafana_password => 'newpassword',
grafana_user => 'admin1',
grafana_password => 'Admin5ecret',
}
PUPPET
end
Expand Down

0 comments on commit fdef345

Please sign in to comment.