You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
34
40
35
41
36
42
## Objectives
@@ -124,7 +130,7 @@ Since this project works with BATS, you can use **setup** and **teardown**
124
130
functions to prepare and clean after every test in a file.
125
131
126
132
127
-
## Working with Kubectl or OC commands
133
+
###Working with Kubectl or OC commands
128
134
129
135
If you are working with a native Kubernetes cluster.
130
136
@@ -183,7 +189,7 @@ verify "there are 2 pods named 'nginx'"
183
189
```
184
190
185
191
186
-
## Other Examples
192
+
###Other Examples
187
193
188
194
Examples are available under [the eponym directory](examples/ci).
189
195
It includes...
@@ -284,11 +290,14 @@ verify "there are <number> <resource-type> named '<regular-expression>'"
284
290
*resource-type* is one of the K8s ones (e.g. `pods`, `po`, `services`, `svc`...).
285
291
See [https://kubernetes.io/docs/reference/kubectl/overview/#resource-types](https://kubernetes.io/docs/reference/kubectl/overview/#resource-types) for a complete reference.
286
292
287
-
This simple assertion may fail sometimes.
288
-
As an example, if you count the number of PODs, run your test and then kill the POD, they will still
289
-
be listed, with the TERMINATING state. So, most of the time, you will want to verify the number of instances
290
-
with a given property value. Example: count the number of PODs with a given name pattern and having the `started` status.
291
-
Hence this additional syntax.
293
+
294
+
> :warning: This simple assertion may fail sometimes.
295
+
>
296
+
> As an example, if you count the number of PODs, run your test and then kill the POD, they will still be listed, with the `TERMINATING` state.
297
+
>
298
+
> So, most of the time, you will want to verify the number of instances with a given property value. Example: count the number of PODs with a given name pattern and having the `started` status.
299
+
300
+
Hence this additional syntax (using [next section](#verifying-property-values) documentation to verify additionnal properties):
292
301
293
302
```bash
294
303
# Expecting a given number of instances
@@ -297,14 +306,12 @@ try "at most <number> times every <number>s \
297
306
with '<property-name>' being '<expected-value>'"
298
307
```
299
308
300
-
This is a checking loop.
301
-
It means the loop is interrupted as soon as the assertion is verified. If it reaches the end of the loop
302
-
without having been verified, an error is thrown. Please, refer to [this section](#property-names) for details
303
-
about the property names.
304
-
305
-
This assertion is useful for PODs, whose life cycle changes take time.
309
+
:pushpin: This assertion is useful for PODs, whose life cycle changes take time.
306
310
For services, you may directly use the simple count assertions.
307
311
312
+
This is a checking loop.
313
+
It breaks the loop if as soon as the assertion is verified. If it reaches the end of the loop without having been verified, an error is thrown. Please, refer to [this section](#property-names) for details about the property names.
314
+
308
315
309
316
### Verifying Property Values
310
317
@@ -327,8 +334,8 @@ It breaks the loop if as soon as the assertion is verified. If it reaches the en
327
334
without having been verified, an error is thrown. Please, refer to [this section](#property-names) for details
328
335
about the property names.
329
336
330
-
This assertion verifies all the instances have this property value.
331
-
But unlike the assertion type to count resources, you do not verify how many instances have this value. Notice however that **if it finds 0 item verifying the property, the assertion fails**.
337
+
:memo:This assertion verifies _all the instances_ have this property value.
338
+
But unlike the assertion type to [count resources](#counting-resources), you do not verify _how many instances_ have this value. Notice however that **if it finds 0 item verifying the property, the assertion fails**.
0 commit comments