Skip to content

Commit 3144fc3

Browse files
committed
kuttl test file names have changed, update references
1 parent ebbd317 commit 3144fc3

File tree

5 files changed

+18
-32
lines changed

5 files changed

+18
-32
lines changed

testing/kuttl/README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,6 @@ There are two ways to run a single test in isolation:
4444
- using an env var with the make target: `KUTTL_TEST='kuttl test --test <test-name>' make check-kuttl`
4545
- using `kubectl kuttl --test` flag: `kubectl kuttl test testing/kuttl/e2e-generated --test <test-name>`
4646

47-
### Writing additional tests
48-
49-
To make it easier to read tests, we want to put our `assert.yaml`/`errors.yaml` files after the
50-
files that create/update the objects for a step. To achieve this, infix an extra `-` between the
51-
step number and the object/step name.
52-
53-
For example, if the `00` test step wants to create a cluster and then assert that the cluster is ready,
54-
the files would be named
55-
56-
```yaml
57-
00--cluster.yaml # note the extra `-` to ensure that it sorts above the following file
58-
00-assert.yaml
59-
```
60-
6147
### Generating tests
6248

6349
KUTTL is good at setting up K8s objects for testing, but does not have a native way to dynamically

testing/kuttl/e2e/delete-namespace/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
* Check that nothing remains.
77

88
Note: KUTTL provides a `$NAMESPACE` var that can be used in scripts/commands,
9-
but which cannot be used in object definition yamls (like `01--cluster.yaml`).
9+
but which cannot be used in object definition yamls (like `01-cluster.yaml`).
1010
Therefore, we use a given, non-random namespace that is defined in the makefile
1111
and generated with `generate-kuttl`.

testing/kuttl/e2e/exporter-password-change/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Exporter Password Change
22

3-
## 00--create-cluster:
3+
## 00-create-cluster:
44
The TestStep will:
55

66
1) Apply the `files/inital-postgrescluster.yaml` file to create a cluster with monitoring enabled
@@ -13,7 +13,7 @@ The TestStep will:
1313

1414
This TestAssert will loop through a script until:
1515
1) the instance pod has the `ContainersReady` condition with status `true`
16-
2) the asserts from `00--create-cluster` are met.
16+
2) the asserts from `00-create-cluster` are met.
1717

1818
## 01-assert:
1919

testing/kuttl/e2e/major-upgrade-missing-image/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,31 @@ PostgresCluster spec or via the RELATED_IMAGES environment variables.
66

77
### Basic PGUpgrade controller and CRD instance validation
88

9-
* 01--valid-upgrade: create a valid PGUpgrade instance
9+
* 01-valid-upgrade: create a valid PGUpgrade instance
1010
* 01-assert: check that the PGUpgrade instance exists and has the expected status
1111

1212
### Verify new statuses for missing required container images
1313

14-
* 10--cluster: create the cluster with an unavailable image (i.e. Postgres 11)
14+
* 10-cluster: create the cluster with an unavailable image (i.e. Postgres 11)
1515
* 10-assert: check that the PGUpgrade instance has the expected reason: "PGClusterNotShutdown"
1616
* 11-shutdown-cluster: set the spec.shutdown value to 'true' as required for upgrade
1717
* 11-assert: check that the new reason is set, "PGClusterPrimaryNotIdentified"
1818

1919
### Update to an available Postgres version, start and upgrade PostgresCluster
2020

21-
* 12--start-and-update-version: update the Postgres version on both CRD instances and set 'shutdown' to false
21+
* 12-start-and-update-version: update the Postgres version on both CRD instances and set 'shutdown' to false
2222
* 12-assert: verify that the cluster is running and the PGUpgrade instance now has the new status info with reason: "PGClusterNotShutdown"
23-
* 13--shutdown-cluster: set spec.shutdown to 'true'
23+
* 13-shutdown-cluster: set spec.shutdown to 'true'
2424
* 13-assert: check that the PGUpgrade instance has the expected reason: "PGClusterMissingRequiredAnnotation"
25-
* 14--annotate-cluster: set the required annotation
25+
* 14-annotate-cluster: set the required annotation
2626
* 14-assert: verify that the upgrade succeeded and the new Postgres version shows in the cluster's status
27-
* 15--start-cluster: set the new Postgres version and spec.shutdown to 'false'
27+
* 15-start-cluster: set the new Postgres version and spec.shutdown to 'false'
2828

2929
### Verify upgraded PostgresCluster
3030

3131
* 15-assert: verify that the cluster is running
3232
* 16-check-pgbackrest: check that the pgbackrest setup has successfully completed
33-
* 17--check-version: check the version reported by PostgreSQL
33+
* 17-check-version: check the version reported by PostgreSQL
3434
* 17-assert: assert the Job from the previous step succeeded
3535

3636

testing/kuttl/e2e/scaledown/readme.MD

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ have the expected number of pods.
88

99
### From two sets to one set
1010

11-
* 00--create-cluster: create the cluster with two instance sets, one replica each
11+
* 00-create-cluster: create the cluster with two instance sets, one replica each
1212
* 00-assert: check that the cluster exists with the expected status
13-
* 01--update-cluster: update the cluster to remove one instance set
13+
* 01-update-cluster: update the cluster to remove one instance set
1414
* 01-assert: check that the cluster exists with the expected status
15-
* 02--delete-cluster
15+
* 02-delete-cluster
1616

1717
### From one set with multiple replicas to one set with one replica
1818

19-
* 10--create-cluster: create the cluster with one instance set with two replicas
19+
* 10-create-cluster: create the cluster with one instance set with two replicas
2020
* 10-assert: check that the cluster exists with the expected status
2121
* 11-annotate: set the roles as labels on the pods
22-
* 12--update-cluster: update the cluster to remove one replica
22+
* 12-update-cluster: update the cluster to remove one replica
2323
* 12-assert: check that the cluster exists with the expected status; and that the `master` pod that exists was the `master` before the scaledown
24-
* 13--delete-cluster: delete the cluster
24+
* 13-delete-cluster: delete the cluster
2525

2626
### From two sets with variable replicas to two set with one replica each
2727

28-
* 20--create-cluster: create the cluster with two instance sets, with two and one replica
28+
* 20-create-cluster: create the cluster with two instance sets, with two and one replica
2929
* 20-assert: check that the cluster exists with the expected status
30-
* 21--update-cluster: update the cluster to reduce the two-replica instance to one-replica
30+
* 21-update-cluster: update the cluster to reduce the two-replica instance to one-replica
3131
* 21-assert: check that the cluster exists with the expected status

0 commit comments

Comments
 (0)