Merge ~esunar/charm-prometheus2:added-focal-jammy-tests into charm-prometheus2:master
- Git
- lp:~esunar/charm-prometheus2
- added-focal-jammy-tests
- Merge into master
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Eric Chen | ||||||||
Approved revision: | d36d552501ad99d338c04e769ce5e9b48472c26c | ||||||||
Merged at revision: | 38debb52f8a6089e918b049de796e0046ffa1869 | ||||||||
Proposed branch: | ~esunar/charm-prometheus2:added-focal-jammy-tests | ||||||||
Merge into: | charm-prometheus2:master | ||||||||
Diff against target: |
392 lines (+113/-39) 20 files modified
.gitignore (+3/-0) charmcraft.yaml (+7/-5) src/metadata.yaml (+1/-3) src/reactive/prometheus.py (+5/-7) src/tests/functional/tests/bundles/base-vault.yaml (+63/-0) src/tests/functional/tests/bundles/base.yaml (+2/-3) src/tests/functional/tests/bundles/bionic-vault.yaml (+3/-2) src/tests/functional/tests/bundles/bionic.yaml (+1/-0) src/tests/functional/tests/bundles/focal-vault.yaml (+1/-0) src/tests/functional/tests/bundles/focal.yaml (+1/-0) src/tests/functional/tests/bundles/jammy-vault.yaml (+1/-0) src/tests/functional/tests/bundles/jammy.yaml (+1/-0) src/tests/functional/tests/bundles/overlays/bionic.yaml.j2 (+1/-0) src/tests/functional/tests/bundles/overlays/focal-vault.yaml.j2 (+1/-0) src/tests/functional/tests/bundles/overlays/focal.yaml.j2 (+1/-0) src/tests/functional/tests/bundles/overlays/jammy-vault.yaml.j2 (+1/-0) src/tests/functional/tests/bundles/overlays/jammy.yaml.j2 (+1/-0) src/tests/functional/tests/tests.yaml (+14/-10) src/tests/functional/tests/tests_prometheus.py (+2/-0) src/tests/unit/test_reactive_prometheus.py (+3/-9) |
||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Eric Chen | Approve | ||
🤖 prod-jenkaas-bootstack (community) | continuous-integration | Approve | |
Robert Gildein | Needs Fixing | ||
Tianqi Xiao (community) | Approve | ||
Martin Kalcok | Pending | ||
BootStack Reviewers | Pending | ||
Review via email: mp+430023@code.launchpad.net |
Commit message
Close LP #1947911
Close LP #1986047
Description of the change
- added functional tests for focal and jammy
- fixed functional tests with vault
- fixed lint errors
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote : | # |
Erhan Sunar (esunar) wrote (last edit ): | # |
func test logs: https:/
unit test logs: https:/
lint logs: https:/
Tianqi Xiao (txiao) wrote : | # |
Thanks for the MP. I have some suggestions in this comment and in-line:
- I would be helpful also attaching results from lint and unit tests
- For the link to func test logs, it is not properly redirecting because the plain form is not intended for sharing. Please remove `plain/` at the end of the link.
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:4b82ce6743c
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:4b82ce6743c
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Erhan Sunar (esunar) wrote : | # |
added
> Thanks for the MP. I have some suggestions in this comment and in-line:
>
> - I would be helpful also attaching results from lint and unit tests
> - For the link to func test logs, it is not properly redirecting because the
> plain form is not intended for sharing. Please remove `plain/` at the end of
> the link.
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
PASSED: Continuous integration, rev:8c9296a873e
https:/
Executed test runs:
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Tianqi Xiao (txiao) wrote : | # |
Overall looks good, just one small change needed in the test.yaml file. Please see my inline comment below.
Erhan Sunar (esunar) wrote : | # |
> Overall looks good, just one small change needed in the test.yaml file. Please
> see my inline comment below.
fixed the typo in smoke_bundles in test.yaml
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:d440a278e73
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
PASSED: Continuous integration, rev:d440a278e73
https:/
Executed test runs:
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Eric Chen (eric-chen) wrote : | # |
A inline question , thanks!
Chi Wai CHAN (raychan96) wrote : | # |
Not a reviewer, just a comment.
Can you also fix the "[WARNING] DEPRECATION: Application ubuntu uses 'workload-
Erhan Sunar (esunar) wrote : | # |
> Not a reviewer, just a comment.
>
> Can you also fix the "[WARNING] DEPRECATION: Application ubuntu uses
> 'workload-
> instead.". It show up in functional test logs.
Eric Chen (eric-chen) wrote : | # |
We still use bionic for mysql
=====
mysql:
charm: percona-cluster
num_units: 1
+ series: bionic
=======
May I know the reason and I sill suggest to add some note there. It helps the next maintainer to upgrade it at good timing
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:f70bd14c0f1
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Erhan Sunar (esunar) wrote : | # |
> We still use bionic for mysql
>
> =====
> mysql:
> charm: percona-cluster
> num_units: 1
> + series: bionic
>
> =======
>
> May I know the reason and I sill suggest to add some note there. It helps the
> next maintainer to upgrade it at good timing
Focal is only supported on the 5.7/edge channel and there is no jammy support. Should I use the edge version?
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:ab82e8a74a3
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Eric Chen (eric-chen) wrote : | # |
I am not prefer to use edge channel, because edge channel is not stable. But our CI/CD pipeline needs some level of stability. So keep bionic is okay to me, I just want to know the reason and see if we need to add some comment in the bundle file.
But, I also curious that do we really need "percona-cluster" in our functional test if it doesn't support focal and jammy in the future?
In openstack base bundle, they use mysql-innodb-
https:/
Please Robert/
Robert Gildein (rgildein) wrote : | # |
I agree that it make much more sense to use `mysql-
it's more supported. It shouldn't change anything in our tests.
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:d36d552501a
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:d36d552501a
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:d36d552501a
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:d36d552501a
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:d36d552501a
https:/
Executed test runs:
ABORTED: https:/
None: https:/
Click here to trigger a rebuild:
https:/
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
FAILED: Continuous integration, rev:d36d552501a
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote : | # |
PASSED: Continuous integration, rev:d36d552501a
https:/
Executed test runs:
SUCCESS: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Eric Chen (eric-chen) : | # |
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote : | # |
Change successfully merged at revision 38debb52f8a6089
Preview Diff
1 | diff --git a/.gitignore b/.gitignore |
2 | index 60b19fd..12fa515 100644 |
3 | --- a/.gitignore |
4 | +++ b/.gitignore |
5 | @@ -39,3 +39,6 @@ dist/ |
6 | # Builds |
7 | build/ |
8 | *.charm |
9 | + |
10 | +#vscode history plugin |
11 | +.history/** |
12 | diff --git a/charmcraft.yaml b/charmcraft.yaml |
13 | index 40983f6..84129d5 100644 |
14 | --- a/charmcraft.yaml |
15 | +++ b/charmcraft.yaml |
16 | @@ -3,17 +3,19 @@ parts: |
17 | charm: |
18 | source: src |
19 | plugin: reactive |
20 | - build-snaps: [charm] |
21 | + build-snaps: |
22 | + - charm/2.x/stable |
23 | bases: |
24 | - build-on: |
25 | - name: ubuntu |
26 | - channel: "18.04" |
27 | - architectures: ["amd64"] |
28 | - - name: ubuntu |
29 | - channel: "20.04" |
30 | + channel: "22.04" |
31 | architectures: ["amd64"] |
32 | run-on: |
33 | - name: ubuntu |
34 | + channel: "22.04" |
35 | + architectures: |
36 | + - amd64 |
37 | + - name: ubuntu |
38 | channel: "20.04" |
39 | architectures: |
40 | - amd64 |
41 | diff --git a/src/metadata.yaml b/src/metadata.yaml |
42 | index 7defc7f..65ce9bb 100644 |
43 | --- a/src/metadata.yaml |
44 | +++ b/src/metadata.yaml |
45 | @@ -8,9 +8,7 @@ description: | |
46 | condition is observed to be true. |
47 | Due to significant database changes in version 2.0 this charm |
48 | supports prometheus 2.0 and later only. |
49 | -series: |
50 | - - bionic |
51 | - - focal |
52 | +series: [] |
53 | tags: |
54 | - monitoring |
55 | subordinate: false |
56 | diff --git a/src/reactive/prometheus.py b/src/reactive/prometheus.py |
57 | index acdb0ec..39473af 100644 |
58 | --- a/src/reactive/prometheus.py |
59 | +++ b/src/reactive/prometheus.py |
60 | @@ -361,14 +361,12 @@ def get_remote_write_config(): |
61 | return None |
62 | try: |
63 | return yaml.dump( |
64 | - yaml.safe_load(config.get("remote-write-config")), |
65 | - default_flow_style=False |
66 | + yaml.safe_load(config.get("remote-write-config")), default_flow_style=False |
67 | ) |
68 | except Exception as e: |
69 | hookenv.log( |
70 | - "Failed to parse remote-write-config option, " |
71 | - "Exception: {}".format(e), |
72 | - hookenv.WARNING |
73 | + "Failed to parse remote-write-config option, " "Exception: {}".format(e), |
74 | + hookenv.WARNING, |
75 | ) |
76 | return None |
77 | |
78 | @@ -410,7 +408,7 @@ def write_prometheus_config_yml(): |
79 | hookenv.log( |
80 | "Options 'remote-write' and 'remote-write-config'" |
81 | " are not expected together, 'remote-write' may ignored.", |
82 | - hookenv.WARNING |
83 | + hookenv.WARNING, |
84 | ) |
85 | remote_write = None |
86 | |
87 | @@ -1019,4 +1017,4 @@ def tls_update(): |
88 | set_state("prometheus.do-reload") |
89 | |
90 | # Per layer:tls-client docs, this state needs to be manually removed |
91 | - remove_state("tls_client.client.certs.changed") |
92 | \ No newline at end of file |
93 | + remove_state("tls_client.client.certs.changed") |
94 | diff --git a/src/tests/functional/tests/bundles/base-vault.yaml b/src/tests/functional/tests/bundles/base-vault.yaml |
95 | new file mode 100644 |
96 | index 0000000..087602f |
97 | --- /dev/null |
98 | +++ b/src/tests/functional/tests/bundles/base-vault.yaml |
99 | @@ -0,0 +1,63 @@ |
100 | +description: "charm-prometheus2 test bundle" |
101 | +applications: |
102 | + prometheus2: |
103 | + num_units: 1 |
104 | + options: |
105 | + scrape-interval: 30s |
106 | + scrape-timeout: 20s |
107 | + ubuntu: |
108 | + charm: ch:ubuntu |
109 | + num_units: 1 |
110 | + telegraf: |
111 | + charm: ch:telegraf |
112 | + options: |
113 | + prometheus_output_port: default |
114 | + etcd: |
115 | + charm: etcd |
116 | + num_units: 3 |
117 | + vault: |
118 | + charm: ch:vault |
119 | + num_units: 1 |
120 | + series: focal |
121 | + options: |
122 | + auto-generate-root-ca-cert: true |
123 | + vault-mysql-router: |
124 | + charm: ch:mysql-router |
125 | + channel: 8.0/stable |
126 | + mysql-innodb-cluster: |
127 | + charm: ch:mysql-innodb-cluster |
128 | + channel: 8.0/stable |
129 | + num_units: 3 |
130 | + keystone: |
131 | + charm: ch:keystone |
132 | + num_units: 1 |
133 | + series: focal |
134 | + options: |
135 | + admin-password: openstack |
136 | + keystone-mysql-router: |
137 | + charm: ch:mysql-router |
138 | + channel: 8.0/stable |
139 | +relations: |
140 | +- - prometheus2:target |
141 | + - telegraf:prometheus-client |
142 | +- - telegraf |
143 | + - ubuntu |
144 | + |
145 | +- - vault:shared-db |
146 | + - vault-mysql-router:shared-db |
147 | +- - vault-mysql-router:db-router |
148 | + - mysql-innodb-cluster:db-router |
149 | + |
150 | +- - keystone:shared-db |
151 | + - keystone-mysql-router:shared-db |
152 | +- - keystone-mysql-router:db-router |
153 | + - mysql-innodb-cluster:db-router |
154 | + |
155 | +- - vault:certificates |
156 | + - keystone:certificates |
157 | +- - vault:certificates |
158 | + - etcd:certificates |
159 | +- - prometheus2:manual-jobs |
160 | + - etcd:prometheus |
161 | +- - vault:certificates |
162 | + - prometheus2:certificates |
163 | diff --git a/src/tests/functional/tests/bundles/bionic.yaml b/src/tests/functional/tests/bundles/base.yaml |
164 | similarity index 87% |
165 | rename from src/tests/functional/tests/bundles/bionic.yaml |
166 | rename to src/tests/functional/tests/bundles/base.yaml |
167 | index 9f7269b..65b96c0 100644 |
168 | --- a/src/tests/functional/tests/bundles/bionic.yaml |
169 | +++ b/src/tests/functional/tests/bundles/base.yaml |
170 | @@ -1,4 +1,3 @@ |
171 | -series: bionic |
172 | description: "prometheus2-charm test bundle" |
173 | applications: |
174 | prometheus2: |
175 | @@ -7,10 +6,10 @@ applications: |
176 | scrape-interval: 30s |
177 | scrape-timeout: 20s |
178 | ubuntu: |
179 | - charm: cs:ubuntu |
180 | + charm: ch:ubuntu |
181 | num_units: 1 |
182 | telegraf: |
183 | - charm: cs:telegraf |
184 | + charm: ch:telegraf |
185 | options: |
186 | prometheus_output_port: default |
187 | relations: |
188 | diff --git a/src/tests/functional/tests/bundles/bionic-vault.yaml b/src/tests/functional/tests/bundles/bionic-vault.yaml |
189 | index 411bce3..e5c6b4f 100644 |
190 | --- a/src/tests/functional/tests/bundles/bionic-vault.yaml |
191 | +++ b/src/tests/functional/tests/bundles/bionic-vault.yaml |
192 | @@ -1,4 +1,3 @@ |
193 | -series: bionic |
194 | description: "charm-prometheus2 test bundle" |
195 | applications: |
196 | prometheus2: |
197 | @@ -10,7 +9,7 @@ applications: |
198 | charm: ch:ubuntu |
199 | num_units: 1 |
200 | telegraf: |
201 | - charm: cs:telegraf |
202 | + charm: ch:telegraf |
203 | options: |
204 | prometheus_output_port: default |
205 | etcd: |
206 | @@ -19,6 +18,7 @@ applications: |
207 | vault: |
208 | charm: ch:vault |
209 | num_units: 1 |
210 | + series: focal |
211 | options: |
212 | auto-generate-root-ca-cert: true |
213 | mysql: |
214 | @@ -27,6 +27,7 @@ applications: |
215 | keystone: |
216 | charm: ch:keystone |
217 | num_units: 1 |
218 | + series: focal |
219 | options: |
220 | admin-password: openstack |
221 | relations: |
222 | diff --git a/src/tests/functional/tests/bundles/bionic.yaml b/src/tests/functional/tests/bundles/bionic.yaml |
223 | new file mode 120000 |
224 | index 0000000..f81f6ff |
225 | --- /dev/null |
226 | +++ b/src/tests/functional/tests/bundles/bionic.yaml |
227 | @@ -0,0 +1 @@ |
228 | +base.yaml |
229 | \ No newline at end of file |
230 | diff --git a/src/tests/functional/tests/bundles/focal-vault.yaml b/src/tests/functional/tests/bundles/focal-vault.yaml |
231 | new file mode 120000 |
232 | index 0000000..a7f879a |
233 | --- /dev/null |
234 | +++ b/src/tests/functional/tests/bundles/focal-vault.yaml |
235 | @@ -0,0 +1 @@ |
236 | +base-vault.yaml |
237 | \ No newline at end of file |
238 | diff --git a/src/tests/functional/tests/bundles/focal.yaml b/src/tests/functional/tests/bundles/focal.yaml |
239 | new file mode 120000 |
240 | index 0000000..f81f6ff |
241 | --- /dev/null |
242 | +++ b/src/tests/functional/tests/bundles/focal.yaml |
243 | @@ -0,0 +1 @@ |
244 | +base.yaml |
245 | \ No newline at end of file |
246 | diff --git a/src/tests/functional/tests/bundles/jammy-vault.yaml b/src/tests/functional/tests/bundles/jammy-vault.yaml |
247 | new file mode 120000 |
248 | index 0000000..a7f879a |
249 | --- /dev/null |
250 | +++ b/src/tests/functional/tests/bundles/jammy-vault.yaml |
251 | @@ -0,0 +1 @@ |
252 | +base-vault.yaml |
253 | \ No newline at end of file |
254 | diff --git a/src/tests/functional/tests/bundles/jammy.yaml b/src/tests/functional/tests/bundles/jammy.yaml |
255 | new file mode 120000 |
256 | index 0000000..f81f6ff |
257 | --- /dev/null |
258 | +++ b/src/tests/functional/tests/bundles/jammy.yaml |
259 | @@ -0,0 +1 @@ |
260 | +base.yaml |
261 | \ No newline at end of file |
262 | diff --git a/src/tests/functional/tests/bundles/overlays/bionic.yaml.j2 b/src/tests/functional/tests/bundles/overlays/bionic.yaml.j2 |
263 | new file mode 100644 |
264 | index 0000000..04930d7 |
265 | --- /dev/null |
266 | +++ b/src/tests/functional/tests/bundles/overlays/bionic.yaml.j2 |
267 | @@ -0,0 +1 @@ |
268 | +series: bionic |
269 | \ No newline at end of file |
270 | diff --git a/src/tests/functional/tests/bundles/overlays/focal-vault.yaml.j2 b/src/tests/functional/tests/bundles/overlays/focal-vault.yaml.j2 |
271 | new file mode 100644 |
272 | index 0000000..1bdf16f |
273 | --- /dev/null |
274 | +++ b/src/tests/functional/tests/bundles/overlays/focal-vault.yaml.j2 |
275 | @@ -0,0 +1 @@ |
276 | +series: focal |
277 | \ No newline at end of file |
278 | diff --git a/src/tests/functional/tests/bundles/overlays/focal.yaml.j2 b/src/tests/functional/tests/bundles/overlays/focal.yaml.j2 |
279 | new file mode 100644 |
280 | index 0000000..1bdf16f |
281 | --- /dev/null |
282 | +++ b/src/tests/functional/tests/bundles/overlays/focal.yaml.j2 |
283 | @@ -0,0 +1 @@ |
284 | +series: focal |
285 | \ No newline at end of file |
286 | diff --git a/src/tests/functional/tests/bundles/overlays/jammy-vault.yaml.j2 b/src/tests/functional/tests/bundles/overlays/jammy-vault.yaml.j2 |
287 | new file mode 100644 |
288 | index 0000000..61d74ad |
289 | --- /dev/null |
290 | +++ b/src/tests/functional/tests/bundles/overlays/jammy-vault.yaml.j2 |
291 | @@ -0,0 +1 @@ |
292 | +series: jammy |
293 | \ No newline at end of file |
294 | diff --git a/src/tests/functional/tests/bundles/overlays/jammy.yaml.j2 b/src/tests/functional/tests/bundles/overlays/jammy.yaml.j2 |
295 | new file mode 100644 |
296 | index 0000000..61d74ad |
297 | --- /dev/null |
298 | +++ b/src/tests/functional/tests/bundles/overlays/jammy.yaml.j2 |
299 | @@ -0,0 +1 @@ |
300 | +series: jammy |
301 | \ No newline at end of file |
302 | diff --git a/src/tests/functional/tests/tests.yaml b/src/tests/functional/tests/tests.yaml |
303 | index 7d40c7e..17533c6 100644 |
304 | --- a/src/tests/functional/tests/tests.yaml |
305 | +++ b/src/tests/functional/tests/tests.yaml |
306 | @@ -1,25 +1,29 @@ |
307 | charm_name: prometheus2 |
308 | configure: |
309 | - - model_alias_bionic_vault: |
310 | + - model_alias_vault: |
311 | - zaza.openstack.charm_tests.vault.setup.auto_initialize_no_validation_no_wait |
312 | tests: |
313 | - - model_alias_bionic_vault: |
314 | + - model_alias_vault: |
315 | - tests.tests_prometheus.TlsPrometheusCharmTest |
316 | - - model_alias_bionic: |
317 | + - model_alias_basic: |
318 | - tests.tests_prometheus.BasicPrometheusCharmTest |
319 | gate_bundles: |
320 | - - model_alias_bionic_vault: bionic-vault |
321 | - - model_alias_bionic: bionic |
322 | + - model_alias_vault: jammy-vault |
323 | + - model_alias_vault: focal-vault |
324 | + - model_alias_vault: bionic-vault |
325 | + - model_alias_basic: jammy |
326 | + - model_alias_basic: focal |
327 | + - model_alias_basic: bionic |
328 | smoke_bundles: |
329 | - - model_alias_bionic: bionic |
330 | + - model_alias_basic: jammy |
331 | target_deploy_status: |
332 | ubuntu: |
333 | - workload-status-message: "" |
334 | + workload-status-message-prefix: "" |
335 | telegraf: |
336 | - workload-status-message: Monitoring |
337 | + workload-status-message-prefix: Monitoring |
338 | vault: |
339 | workload-status: blocked |
340 | - workload-status-message: Vault needs to be initialized |
341 | + workload-status-message-prefix: Vault needs to be initialized |
342 | etcd: |
343 | workload-status: blocked |
344 | - workload-status-message: Missing relation to certificate authority |
345 | + workload-status-message-prefix: Missing relation to certificate authority |
346 | diff --git a/src/tests/functional/tests/tests_prometheus.py b/src/tests/functional/tests/tests_prometheus.py |
347 | index 441da34..bb5aa70 100644 |
348 | --- a/src/tests/functional/tests/tests_prometheus.py |
349 | +++ b/src/tests/functional/tests/tests_prometheus.py |
350 | @@ -162,6 +162,8 @@ class TlsPrometheusCharmTest(PrometheusCharmTestBase): |
351 | """Test service reload.""" |
352 | model.add_unit("ubuntu", wait_appear=True) |
353 | model.block_until_all_units_idle(timeout=600) |
354 | + if len(model.get_units("etcd")) > 0: |
355 | + model.block_until_wl_status_info_starts_with("etcd", "Healthy") |
356 | |
357 | action = model.run_on_unit("ubuntu/1", "hostname -f") |
358 | new_target = action["Stdout"].strip() |
359 | diff --git a/src/tests/unit/test_reactive_prometheus.py b/src/tests/unit/test_reactive_prometheus.py |
360 | index 606cb6b..e05b35e 100644 |
361 | --- a/src/tests/unit/test_reactive_prometheus.py |
362 | +++ b/src/tests/unit/test_reactive_prometheus.py |
363 | @@ -579,20 +579,14 @@ class TestPrometheusContext(unittest.TestCase): |
364 | """Verify updating prometheus remote_write endpoint.""" |
365 | remote_write_url = "http://localhost:8086/api/v1/prom/write" |
366 | config = self.def_config |
367 | - config.update( |
368 | - { |
369 | - "remote-write": remote_write_url |
370 | - } |
371 | - ) |
372 | + config.update({"remote-write": remote_write_url}) |
373 | hookenv.config.return_value = config |
374 | react_prom.update_prometheus_no_targets() |
375 | react_prom.write_prometheus_config_yml() |
376 | react_prom.write_prometheus_config_def() |
377 | react_prom.validate_config.assert_called_once_with() |
378 | yaml_content = yaml.safe_load(open(self.prom_yml)) |
379 | - exp_list = [{ |
380 | - "url": "http://localhost:8086/api/v1/prom/write" |
381 | - }] |
382 | + exp_list = [{"url": "http://localhost:8086/api/v1/prom/write"}] |
383 | self.assertListEqual(yaml_content["remote_write"], exp_list) |
384 | |
385 | @mock.patch("reactive.prometheus.set_state") |
386 | @@ -966,4 +960,4 @@ class TestPrometheusContext(unittest.TestCase): |
387 | bus.set_state("prometheus.installed") |
388 | bus.dispatch() |
389 | host.service_running.assert_called_with("snap.promreg.promreg") |
390 | - host.service_restart.assert_called_with("snap.promreg.promreg") |
391 | \ No newline at end of file |
392 | + host.service_restart.assert_called_with("snap.promreg.promreg") |
This merge proposal is being monitored by mergebot. Change the status to Approved to merge.