@@ -16,7 +16,7 @@ def set_command(command, more_options="", cache=False):
16
16
cache_option = ""
17
17
if cache is False :
18
18
cache_option = "--cache-ttl=0"
19
- command = f'grafana-wtf --grafana-url="http://localhost:3000 " { cache_option } { more_options } { command } '
19
+ command = f'grafana-wtf --grafana-url="http://localhost:33333 " { cache_option } { more_options } { command } '
20
20
sys .argv = shlex .split (command )
21
21
22
22
@@ -42,7 +42,7 @@ def test_find_textual_empty(docker_grafana, capsys):
42
42
captured = capsys .readouterr ()
43
43
44
44
# Verify output.
45
- assert 'Searching for expression "foobar" at Grafana instance http://localhost:3000 ' in captured .out
45
+ assert 'Searching for expression "foobar" at Grafana instance http://localhost:33333 ' in captured .out
46
46
assert "Data Sources: 0 hits" in captured .out
47
47
assert "Dashboards: 0 hits" in captured .out
48
48
@@ -73,13 +73,13 @@ def test_find_textual_dashboard_success(ldi_resources, capsys):
73
73
captured = capsys .readouterr ()
74
74
75
75
# Verify output.
76
- assert 'Searching for expression "ldi_readings" at Grafana instance http://localhost:3000 ' in captured .out
76
+ assert 'Searching for expression "ldi_readings" at Grafana instance http://localhost:33333 ' in captured .out
77
77
assert "Dashboards: 2 hits" in captured .out
78
78
assert "luftdaten-info-generic-trend" in captured .out
79
79
assert "Title luftdaten.info generic trend" in captured .out
80
80
assert "Folder Testdrive" in captured .out
81
81
assert "UID ioUrPwQiz" in captured .out
82
- assert "URL http://localhost:3000 /d/ioUrPwQiz/luftdaten-info-generic-trend" in captured .out
82
+ assert "URL http://localhost:33333 /d/ioUrPwQiz/luftdaten-info-generic-trend" in captured .out
83
83
assert "dashboard.panels.[1].targets.[0].measurement: ldi_readings" in captured .out
84
84
assert "dashboard.panels.[7].panels.[0].targets.[0].measurement: ldi_readings" in captured .out
85
85
@@ -92,7 +92,7 @@ def test_find_textual_datasource_success(ldi_resources, capsys):
92
92
captured = capsys .readouterr ()
93
93
94
94
# Verify output.
95
- assert 'Searching for expression "ldi_v2" at Grafana instance http://localhost:3000 ' in captured .out
95
+ assert 'Searching for expression "ldi_v2" at Grafana instance http://localhost:33333 ' in captured .out
96
96
97
97
assert "Data Sources: 1 hits" in captured .out
98
98
assert "name: ldi_v2" in captured .out
@@ -112,13 +112,13 @@ def test_find_tabular_dashboard_success(ldi_resources, capsys):
112
112
captured = capsys .readouterr ()
113
113
114
114
# Verify output.
115
- assert 'Searching for expression "ldi_readings" at Grafana instance http://localhost:3000 ' in captured .out
115
+ assert 'Searching for expression "ldi_readings" at Grafana instance http://localhost:33333 ' in captured .out
116
116
117
117
reference_table = """
118
- | Type | Name | Title | Folder | UID | Created | Updated | Created by | Datasources | URL |
119
- |:-----------|:---------------------------------|:---------------------------------|:----------|:----------|:---------------------|:---------------------|:-------------|:--------------------------------------------------------------------------------------|:-------------------------------------------------------------------|
120
- | Dashboards | luftdaten-info-generic-trend-v27 | luftdaten.info generic trend v27 | Testdrive | ioUrPwQiz | xxxx-xx-xxTxx:xx:xxZ | xxxx-xx-xxTxx:xx:xxZ | admin | -- Grafana --,ldi_v2,weatherbase | http://localhost:3000 /d/ioUrPwQiz/luftdaten-info-generic-trend-v27 |
121
- | Dashboards | luftdaten-info-generic-trend-v33 | luftdaten.info generic trend v33 | Testdrive | jpVsQxRja | xxxx-xx-xxTxx:xx:xxZ | xxxx-xx-xxTxx:xx:xxZ | admin | -- Grafana --,{'type': 'influxdb', 'uid': 'PDF2762CDFF14A314'},{'uid': 'weatherbase'} | http://localhost:3000 /d/jpVsQxRja/luftdaten-info-generic-trend-v33 |
118
+ | Type | Name | Title | Folder | UID | Created | Updated | Created by | Datasources | URL |
119
+ |:-----------|:---------------------------------|:---------------------------------|:----------|:----------|:---------------------|:---------------------|:-------------|:--------------------------------------------------------------------------------------|:-------------------------------------------------------------------- |
120
+ | Dashboards | luftdaten-info-generic-trend-v27 | luftdaten.info generic trend v27 | Testdrive | ioUrPwQiz | xxxx-xx-xxTxx:xx:xxZ | xxxx-xx-xxTxx:xx:xxZ | admin | -- Grafana --,ldi_v2,weatherbase | http://localhost:33333 /d/ioUrPwQiz/luftdaten-info-generic-trend-v27 |
121
+ | Dashboards | luftdaten-info-generic-trend-v33 | luftdaten.info generic trend v33 | Testdrive | jpVsQxRja | xxxx-xx-xxTxx:xx:xxZ | xxxx-xx-xxTxx:xx:xxZ | admin | -- Grafana --,{'type': 'influxdb', 'uid': 'PDF2762CDFF14A314'},{'uid': 'weatherbase'} | http://localhost:33333 /d/jpVsQxRja/luftdaten-info-generic-trend-v33 |
122
122
""" .strip ()
123
123
124
124
output_table = captured .out [captured .out .find ("| Type" ) :]
@@ -140,7 +140,7 @@ def test_replace_dashboard_success(ldi_resources, capsys):
140
140
set_command ("find ldi_v3" )
141
141
grafana_wtf .commands .run ()
142
142
captured = capsys .readouterr ()
143
- assert 'Searching for expression "ldi_v3" at Grafana instance http://localhost:3000 ' in captured .out
143
+ assert 'Searching for expression "ldi_v3" at Grafana instance http://localhost:33333 ' in captured .out
144
144
145
145
# TODO: Expand renaming to data sources.
146
146
assert "Data Sources: 0 hits" in captured .out
@@ -167,7 +167,7 @@ def test_log_empty(ldi_resources, capsys, caplog):
167
167
captured = capsys .readouterr ()
168
168
169
169
# Verify output.
170
- assert 'Aggregating edit history for Grafana dashboard "foobar" at http://localhost:3000 ' in caplog .text
170
+ assert 'Aggregating edit history for Grafana dashboard "foobar" at http://localhost:33333 ' in caplog .text
171
171
assert "[]" in captured .out
172
172
173
173
@@ -180,7 +180,7 @@ def test_log_json_success(ldi_resources, capsys, caplog):
180
180
captured = capsys .readouterr ()
181
181
182
182
# Verify output.
183
- assert 'Aggregating edit history for Grafana dashboard "ioUrPwQiz" at http://localhost:3000 ' in caplog .text
183
+ assert 'Aggregating edit history for Grafana dashboard "ioUrPwQiz" at http://localhost:33333 ' in caplog .text
184
184
185
185
reference = {
186
186
# "datetime": "2021-09-29T17:32:23Z",
@@ -189,7 +189,7 @@ def test_log_json_success(ldi_resources, capsys, caplog):
189
189
"folder" : "Testdrive" ,
190
190
"title" : "luftdaten.info generic trend v27" ,
191
191
"version" : 1 ,
192
- "url" : "http://localhost:3000 /d/ioUrPwQiz/luftdaten-info-generic-trend-v27" ,
192
+ "url" : "http://localhost:33333 /d/ioUrPwQiz/luftdaten-info-generic-trend-v27" ,
193
193
}
194
194
195
195
history = json .loads (captured .out )
@@ -208,10 +208,10 @@ def test_log_tabular_success(ldi_resources, capsys, caplog):
208
208
captured = capsys .readouterr ()
209
209
210
210
# Verify output.
211
- assert 'Aggregating edit history for Grafana dashboard "ioUrPwQiz" at http://localhost:3000 ' in caplog .text
211
+ assert 'Aggregating edit history for Grafana dashboard "ioUrPwQiz" at http://localhost:33333 ' in caplog .text
212
212
213
213
reference = """
214
- | Notes: n/a<br/>[Testdrive » luftdaten.info generic trend v27](http://localhost:3000 /d/ioUrPwQiz/luftdaten-info-generic-trend-v27) | User: admin<br/>Date: xxxx-xx-xxTxx:xx:xxZ |
214
+ | Notes: n/a<br/>[Testdrive » luftdaten.info generic trend v27](http://localhost:33333 /d/ioUrPwQiz/luftdaten-info-generic-trend-v27) | User: admin<br/>Date: xxxx-xx-xxTxx:xx:xxZ |
215
215
""" .strip ()
216
216
217
217
first_item_raw = str .splitlines (captured .out )[- 1 ]
0 commit comments