Skip to content

Commit

Permalink
datasource: fix asserts in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rrey committed Mar 27, 2020
1 parent 1c9e373 commit 6c8bb78
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 54 deletions.
48 changes: 32 additions & 16 deletions tests/integration/targets/grafana_datasource/tasks/cloudwatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@
that:
- result.changed
- "result.msg == 'Datasource datasource-cloudwatch created'"
- result.datasource.access == 'proxy'
- result.datasource.basicAuth == false
- result.datasource.database == ''
- result.datasource.isDefault == false
- result.datasource.jsonData.authType == 'keys'
- result.datasource.jsonData.customMetricsNamespaces == 'n1,n2'
- result.datasource.jsonData.defaultRegion == 'us-west-1'
- result.datasource.jsonData.tlsAuth == false
- result.datasource.jsonData.tlsAuthWithCACert == false
- result.datasource.name == 'datasource-cloudwatch'
- result.datasource.orgId == 1
- result.datasource.password == ''
- result.datasource.type == 'cloudwatch'
- result.datasource.url == 'http://monitoring.us-west-1.amazonaws.com'
- result.datasource.user == ''
- result.datasource.withCredentials == false

- name: Check cloudwatch datasource creation idempotency
register: result
Expand All @@ -44,22 +60,22 @@
- assert:
that:
- not result.changed
# - result.after.access == 'proxy'
# - result.after.basicAuth == false
# - result.after.database == None
# - result.after.isDefault == false
# - result.after.jsonData.authType == 'keys'
# - result.after.jsonData.customMetricsNamespaces == 'n1,n2'
# - result.after.jsonData.defaultRegion == 'us-west-1'
# - result.after.jsonData.tlsAuth == false
# - result.after.jsonData.tlsAuthWithCACert == false
# - result.after.name == 'datasource-cloudwatch'
# - result.after.orgId == 1
# - result.after.password == ''
# - result.after.type == 'cloudwatch'
# - result.after.url == 'http://monitoring.us-west-1.amazonaws.com'
# - result.after.user == ''
# - result.after.withCredentials == false
- result.datasource.access == 'proxy'
- result.datasource.basicAuth == false
- result.datasource.database == ''
- result.datasource.isDefault == false
- result.datasource.jsonData.authType == 'keys'
- result.datasource.jsonData.customMetricsNamespaces == 'n1,n2'
- result.datasource.jsonData.defaultRegion == 'us-west-1'
- result.datasource.jsonData.tlsAuth == false
- result.datasource.jsonData.tlsAuthWithCACert == false
- result.datasource.name == 'datasource-cloudwatch'
- result.datasource.orgId == 1
- result.datasource.password == ''
- result.datasource.type == 'cloudwatch'
- result.datasource.url == 'http://monitoring.us-west-1.amazonaws.com'
- result.datasource.user == ''
- result.datasource.withCredentials == false

- name: Delete cloudwatch datasource
register: result
Expand Down
28 changes: 14 additions & 14 deletions tests/integration/targets/grafana_datasource/tasks/influx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@
- assert:
that:
- not result.changed
# - result.after.basicAuth == false
# - result.after.access == 'proxy'
# - result.after.database == 'telegraf'
# - result.after.isDefault == false
# - result.after.jsonData.timeInterval == '>10s'
# - result.after.jsonData.tlsAuth == false
# - result.after.jsonData.tlsAuthWithCACert == false
# - result.after.name == 'datasource-influxdb'
# - result.after.orgId == 1
# - result.after.password == ''
# - result.after.type == 'influxdb'
# - result.after.url == 'https://influx.company.com:8086'
# - result.after.user == ''
# - result.after.withCredentials == false
- result.datasource.basicAuth == false
- result.datasource.access == 'proxy'
- result.datasource.database == 'telegraf'
- result.datasource.isDefault == false
- result.datasource.jsonData.timeInterval == '>10s'
- result.datasource.jsonData.tlsAuth == false
- result.datasource.jsonData.tlsAuthWithCACert == false
- result.datasource.name == 'datasource-influxdb'
- result.datasource.orgId == 1
- result.datasource.password == ''
- result.datasource.type == 'influxdb'
- result.datasource.url == 'https://influx.company.com:8086'
- result.datasource.user == ''
- result.datasource.withCredentials == false

- name: Delete influxdb datasource
register: result
Expand Down
24 changes: 12 additions & 12 deletions tests/integration/targets/grafana_datasource/tasks/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@
- assert:
that:
- not result.changed
# - result.after.basicAuth == false
# - result.after.database == 'db'
# - result.after.isDefault == false
# - result.after.jsonData.sslmode == 'verify-full'
# - result.after.jsonData.tlsAuth == false
# - result.after.jsonData.tlsAuthWithCACert == false
# - result.after.name == 'datasource-postgres'
# - result.after.orgId == 1
# - result.after.type == 'postgres'
# - result.after.url == 'postgres.company.com:5432'
# - result.after.user == 'postgres'
# - result.after.withCredentials == false
- result.datasource.basicAuth == false
- result.datasource.database == 'db'
- result.datasource.isDefault == false
- result.datasource.jsonData.sslmode == 'verify-full'
- result.datasource.jsonData.tlsAuth == false
- result.datasource.jsonData.tlsAuthWithCACert == false
- result.datasource.name == 'datasource-postgres'
- result.datasource.orgId == 1
- result.datasource.type == 'postgres'
- result.datasource.url == 'postgres.company.com:5432'
- result.datasource.user == 'postgres'
- result.datasource.withCredentials == false

- name: Delete postgres datasource
register: result
Expand Down
24 changes: 12 additions & 12 deletions tests/integration/targets/grafana_datasource/tasks/thruk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
- assert:
that:
- not result.changed
# - result.after.basicAuth == false
# - result.after.access == 'proxy'
# - result.after.isDefault == false
# - result.after.jsonData.tlsAuth == false
# - result.after.jsonData.tlsAuthWithCACert == false
# - result.after.name == 'datasource-thruk'
# - result.after.orgId == 1
# - result.after.password == ''
# - result.after.type == 'sni-thruk-datasource'
# - result.after.url == 'https://thruk.company.com/sitename/thruk'
# - result.after.user == ''
# - result.after.withCredentials == false
- result.datasource.basicAuth == false
- result.datasource.access == 'proxy'
- result.datasource.isDefault == false
- result.datasource.jsonData.tlsAuth == false
- result.datasource.jsonData.tlsAuthWithCACert == false
- result.datasource.name == 'datasource-thruk'
- result.datasource.orgId == 1
- result.datasource.password == ''
- result.datasource.type == 'sni-thruk-datasource'
- result.datasource.url == 'https://thruk.company.com/sitename/thruk'
- result.datasource.user == ''
- result.datasource.withCredentials == false

- name: Delete thruk datasource
register: result
Expand Down

0 comments on commit 6c8bb78

Please sign in to comment.