Skip to content

Commit 7927bb1

Browse files
Merge branch 'master' into #34
2 parents 853cb18 + e56f901 commit 7927bb1

File tree

2 files changed

+55
-35
lines changed

2 files changed

+55
-35
lines changed

.github/workflows/toc.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: TOC Generator
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
8+
jobs:
9+
generateTOC:
10+
name: TOC Generator
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: technote-space/toc-generator@v4

README.md

+42-35
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,32 @@ This kind of test is the ultimate set of verifications to run for a project, lon
1111

1212
## Table of Contents
1313

14-
* [Objectives](#objectives)
15-
* [Examples](#examples)
16-
* [Test files and result](#test-files-and-result)
17-
* [Working with Kubectl or OC commands](#working-with-kubectl-or-oc-commands)
18-
* [Other Examples](#other-examples)
19-
* [Usage](#usage)
20-
* [Setup](#setup)
21-
* [Executing tests by hand](#executing-tests-by-hand)
22-
* [Continuous Integration](#continuous-integration)
23-
* [Syntax Reference](#syntax-reference)
24-
* [Counting Resources](#counting-resources)
25-
* [Verifying Property Values](#verifying-property-values)
26-
* [Using Regular Expressions](#using-regular-expressions)
27-
* [Property Names](#property-names)
28-
* [Errors](#errors)
29-
* [Error Codes](#error-codes)
30-
* [Debugging Tests](#debugging-tests)
31-
* [Linting](#linting)
32-
* [Tips](#tips)
33-
* [Beyond K8s assertions](#beyond-k8s-assertions)
14+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
15+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
16+
<!-- param::isNotitle::true:: -->
17+
18+
- [Objectives](#objectives)
19+
- [Examples](#examples)
20+
- [Test files and result](#test-files-and-result)
21+
- [Working with Kubectl or OC commands](#working-with-kubectl-or-oc-commands)
22+
- [Other Examples](#other-examples)
23+
- [Usage](#usage)
24+
- [Manual Setup](#manual-setup)
25+
- [Docker Setup](#docker-setup)
26+
- [Continuous Integration](#continuous-integration)
27+
- [Syntax Reference](#syntax-reference)
28+
- [Counting Resources](#counting-resources)
29+
- [Verifying Property Values](#verifying-property-values)
30+
- [Using Regular Expressions](#using-regular-expressions)
31+
- [Property Names](#property-names)
32+
- [Errors](#errors)
33+
- [Error Codes](#error-codes)
34+
- [Debugging Tests](#debugging-tests)
35+
- [Linting](#linting)
36+
- [Tips](#tips)
37+
- [Beyond K8s assertions](#beyond-k8s-assertions)
38+
39+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3440

3541

3642
## Objectives
@@ -124,7 +130,7 @@ Since this project works with BATS, you can use **setup** and **teardown**
124130
functions to prepare and clean after every test in a file.
125131

126132

127-
## Working with Kubectl or OC commands
133+
### Working with Kubectl or OC commands
128134

129135
If you are working with a native Kubernetes cluster.
130136

@@ -183,7 +189,7 @@ verify "there are 2 pods named 'nginx'"
183189
```
184190

185191

186-
## Other Examples
192+
### Other Examples
187193

188194
Examples are available under [the eponym directory](examples/ci).
189195
It includes...
@@ -284,11 +290,14 @@ verify "there are <number> <resource-type> named '<regular-expression>'"
284290
*resource-type* is one of the K8s ones (e.g. `pods`, `po`, `services`, `svc`...).
285291
See [https://kubernetes.io/docs/reference/kubectl/overview/#resource-types](https://kubernetes.io/docs/reference/kubectl/overview/#resource-types) for a complete reference.
286292

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):
292301

293302
```bash
294303
# Expecting a given number of instances
@@ -297,14 +306,12 @@ try "at most <number> times every <number>s \
297306
with '<property-name>' being '<expected-value>'"
298307
```
299308

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.
306310
For services, you may directly use the simple count assertions.
307311

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+
308315

309316
### Verifying Property Values
310317

@@ -327,8 +334,8 @@ It breaks the loop if as soon as the assertion is verified. If it reaches the en
327334
without having been verified, an error is thrown. Please, refer to [this section](#property-names) for details
328335
about the property names.
329336

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**.
332339

333340

334341
### Using Regular Expressions

0 commit comments

Comments
 (0)