Skip to content

Commit e56f901

Browse files
Merge pull request #36 from xakraz/master
docs: Update README and add GitHub action
2 parents 6ccb9f6 + b31abcc commit e56f901

File tree

2 files changed

+55
-33
lines changed

2 files changed

+55
-33
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-33
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,31 @@ 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-
* [Property Names](#property-names)
27-
* [Errors](#errors)
28-
* [Error Codes](#error-codes)
29-
* [Debugging Tests](#debugging-tests)
30-
* [Linting](#linting)
31-
* [Tips](#tips)
32-
* [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+
- [Property Names](#property-names)
31+
- [Errors](#errors)
32+
- [Error Codes](#error-codes)
33+
- [Debugging Tests](#debugging-tests)
34+
- [Linting](#linting)
35+
- [Tips](#tips)
36+
- [Beyond K8s assertions](#beyond-k8s-assertions)
37+
38+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3339

3440

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

125131

126-
## Working with Kubectl or OC commands
132+
### Working with Kubectl or OC commands
127133

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

@@ -177,7 +183,7 @@ verify "there are 2 pods named 'nginx'"
177183
```
178184

179185

180-
## Other Examples
186+
### Other Examples
181187

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

281-
This simple assertion may fail sometimes.
282-
As an example, if you count the number of PODs, run your test and then kill the POD, they will still
283-
be listed, with the TERMINATING state. So, most of the time, you will want to verify the number of instances
284-
with a given property value. Example: count the number of PODs with a given name pattern and having the `started` status.
285-
Hence this additional syntax.
287+
288+
> :warning: This simple assertion may fail sometimes.
289+
>
290+
> 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.
291+
>
292+
> 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.
293+
294+
Hence this additional syntax (using [next section](#verifying-property-values) documentation to verify additionnal properties):
286295

287296
```bash
288297
# Expecting a given number of instances
@@ -291,14 +300,14 @@ try "at most <number> times every <number>s \
291300
with '<property-name>' being '<expected-value>'"
292301
```
293302

294-
This is a checking loop.
303+
:pushpin: This assertion is useful for PODs, whose life cycle changes take time.
304+
For services, you may directly use the simple count assertions.
305+
306+
This is a checking loop.
295307
It breaks the loop if as soon as the assertion is verified. If it reaches the end of the loop
296308
without having been verified, an error is thrown. Please, refer to [this section](#property-names) for details
297309
about the property names.
298310

299-
This assertion is useful for PODs, whose life cycle changes take time.
300-
For services, you may directly use the simple count assertions.
301-
302311

303312
### Verifying Property Values
304313

@@ -321,13 +330,13 @@ It breaks the loop if as soon as the assertion is verified. If it reaches the en
321330
without having been verified, an error is thrown. Please, refer to [this section](#property-names) for details
322331
about the property names.
323332

324-
This assertion verifies all the instances have this property value.
325-
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**.
333+
:memo: This assertion verifies _all the instances_ have this property value.
334+
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**.
326335

327336

328337
### Property Names
329338

330-
In all assertions, *property-name* if one of the column names supported by K8s.
339+
In all assertions, *property-name* is one of the column names supported by K8s.
331340
See https://kubernetes.io/docs/reference/kubectl/overview/#custom-columns
332341
You can also find column names by using `kubectl get <resource-type> -o custom-columns=ALL:*`.
333342

0 commit comments

Comments
 (0)