Skip to content

Commit 0ef8ac8

Browse files
authored
chore: remove old kuttl tests from repository (argoproj-labs#2167)
Signed-off-by: Jonathan West <jgwest@gmail.com>
1 parent 13584a6 commit 0ef8ac8

431 files changed

Lines changed: 5 additions & 11263 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-build.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,6 @@ jobs:
5050
- v1.27.1-k3s1
5151
- v1.33.5-k3s1
5252
steps:
53-
- name: Download kuttl plugin
54-
env:
55-
KUTTL_VERSION: "0.10.0"
56-
KUTTL_PLUGIN_SUM: "ad21c0d2be495a8f6cfc0821e592ae61afd191ebd453156d9b204e2524fceaf2"
57-
KUTTL_PLUGIN_FILENAME: "kubectl-kuttl_0.10.0_linux_x86_64"
58-
run: |
59-
set -x
60-
echo ${KUTTL_PLUGIN_FILENAME}
61-
curl -OL https://github.com/kudobuilder/kuttl/releases/download/v${KUTTL_VERSION}/${KUTTL_PLUGIN_FILENAME}
62-
echo "${KUTTL_PLUGIN_SUM} ${KUTTL_PLUGIN_FILENAME}" | sha256sum -c -
63-
sudo mv ${KUTTL_PLUGIN_FILENAME} /usr/local/bin/kubectl-kuttl
64-
sudo chmod +x /usr/local/bin/kubectl-kuttl
65-
kubectl-kuttl version
6653
- name: Install K3D
6754
run: |
6855
set -x

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ vendor/
3030
build/_output
3131

3232
kubeconfig
33-
kuttl-test.json
3433
e2e.json
3534

3635
# Desktop Services Store in macOS system

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,11 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
207207

208208
##@ E2E
209209

210-
e2e: ## Run operator e2e tests
211-
kubectl kuttl test ./tests/k8s --config ./tests/kuttl-tests.yaml
212-
213210

214211
start-e2e: install-prometheus-crds ## Start operator for E2E tests (installs required CRDs if needed)
215212
ARGOCD_CLUSTER_CONFIG_NAMESPACES="argocd-e2e-cluster-config, argocd-test-impersonation-1-046, argocd-agent-principal-1-051, argocd-agent-agent-1-052, appset-argocd, appset-old-ns, appset-new-ns, appset-argocd-clusterrole, ns-hosting-principal, ns-hosting-managed-agent, ns-hosting-autonomous-agent" make run
216213

217-
all: test install run e2e ## UnitTest, Run the operator locally and execute e2e tests.
214+
all: test install run ## UnitTest, Run the operator locally
218215

219216
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
220217
controller-gen: ## Download controller-gen locally if necessary.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See the [documentation][docs] for installation and usage of the operator.
1313

1414
## E2E testing
1515

16-
E2E tests are written using [KUTTL](https://kuttl.dev/docs/#install-kuttl-cli). Please Install [KUTTL](https://kuttl.dev/docs/#install-kuttl-cli) to run the tests.
16+
E2E tests are written using Ginkgo. To install Ginkgo, you can use `make ginkgo`. The expected version of Ginkgo will be downloaded into `(repository root)/bin`.
1717

1818
Note that the e2e tests for Redis HA mode require a cluster with at least three worker nodes. A local three-worker node
1919
cluster can be created using [k3d](https://k3d.io/)
Lines changed: 1 addition & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,3 @@
11
# Argo CD Operator E2E Test Guide
22

3-
E2E tests are written using [KUTTL](https://kuttl.dev/docs/#install-kuttl-cli).
4-
5-
## Requirements
6-
7-
This test suite assumes that an Argo CD Operator is installed on the cluster or running locally using `ARGOCD_CLUSTER_CONFIG_NAMESPACES=argocd-e2e-cluster-config make install run`.
8-
9-
The system executing the tests must have following tools installed:
10-
11-
* `kuttl` kubectl plugin (>= v0.11.1)
12-
* `oc` and `kubectl` client
13-
* `jq` for parsing JSON data
14-
* `curl`
15-
16-
There should be a `kubeconfig` pointing to your cluster, user should have full admin privileges (i.e. `kubeadm`).
17-
18-
!!! note
19-
E2E tests utilize GNU Grep under the hood. Please make sure that you have the GNU compatible `grep` installed.
20-
21-
If you are on OSX you can install GNU compatible grep using the below command. The package is installed as `ggrep` by default. Please set this(ggrep) as an alias to `grep`.
22-
23-
```sh
24-
brew install grep
25-
```
26-
27-
Use the below commands to install GNU compatible `grep` on OSX.
28-
29-
Also, note that the e2e tests for Redis HA mode require a cluster with at least three worker nodes. A local three-worker node
30-
cluster can be created using [k3d](https://k3d.io/)
31-
32-
## Running the tests
33-
34-
In any case, you should have set up your `kubeconfig` in such a way that your
35-
default context points to the cluster you want to test. You can use the
36-
`kubectl login ...` command to set this up for you.
37-
38-
## Run e2e tests
39-
40-
```sh
41-
make e2e
42-
```
43-
44-
## Run Operator locally and execute e2e tests
45-
46-
```sh
47-
make all
48-
```
49-
50-
### Running manual with kuttl
51-
52-
```sh
53-
kubectl kuttl test ./tests/k8s --config ./tests/kuttl-tests.yaml
54-
```
55-
56-
### Running single tests
57-
58-
Sometimes (e.g. when initially writing a test or troubleshooting an existing
59-
one), you may want to run single test cases isolated. To do so, you can pass
60-
the name of the test using `--test` to `kuttl`, i.e.
61-
62-
```sh
63-
kubectl kuttl test ./tests/k8s --config ./tests/kuttl-tests.yaml --test 1-004_validate_namespace_scoped_install
64-
```
65-
66-
The name of the test is the name of the directory containing its steps and
67-
assertions.
68-
69-
If you are troubleshooting, you may want to prevent `kuttl` from deleting the
70-
test's namespace afterwards. In order to do so, just pass the additional flag
71-
`--skip-delete` to above command.
72-
73-
## Writing new tests
74-
75-
### Name of the test
76-
77-
Each test comes in its own directory, containing all its test steps. The name
78-
of the test is defined by the name of this directory.
79-
80-
The name of the test should be short, but expressive. The format for naming a
81-
test is currently `<test ID>_<short description>`.
82-
83-
The `<test ID>` is the serial number of the test as defined in the Test Plan
84-
document. The `<short description>` is exactly that, a short description of
85-
what happens in the test.
86-
87-
### Name of the test steps
88-
89-
Each test step is a unique YAML file within the test's directory. The name of
90-
the step is defined by its file name.
91-
92-
The test steps must be named `XX-<name>.yaml`. This is a `kuttl` convention
93-
and cannot be overriden. `XX` is a number (prefixed with `0`, so step `1` must
94-
be `01`), and `<name>` is a free form value for the test step.
95-
96-
There are two reserved words you cannot use for `<name>`:
97-
98-
* `assert` contains positive assertions (i.e. resources that must exist) and
99-
* `errors` contains negative assertions (i.e. resources that must not exist)
100-
101-
Refer to the
102-
[kuttl documentation](https://kuttl.dev/docs)
103-
for more information.
104-
105-
### Documentation
106-
107-
Documentation is important, even for tests. You can should provide inline
108-
documentation in your YAML files (using comments) and a `README.md` in your
109-
test case's directory. The `README.md` should provide some context for the
110-
test case, e.g. what it tries to assert for under which circumstances. This
111-
will help others in troubleshooting failing tests.
112-
113-
### Recipes
114-
115-
`kuttl` unfortunately neither encourages or supports re-use of your test steps
116-
and assertions yet.
117-
118-
Generally, you should try to use `assert` and `errors` declaration whenever
119-
possible and viable. For some cases, you may need to use custom scripts to
120-
get the results you are looking for.
121-
122-
#### Scripts general
123-
124-
Scripts can be executed in a `kuttl.dev/TestStep` resources from a usual test
125-
step declaration.
126-
127-
Your script probably will retrieve some information, and asserts it state. If
128-
the assertion fails, the script should exit with a code > 0, and also print
129-
some information why it failed, e.g.
130-
131-
```yaml
132-
apiVersion: kuttl.dev/v1beta1
133-
kind: TestStep
134-
commands:
135-
- script: |
136-
# Get some piece of information...
137-
if test "$result" != "expected"; then
138-
echo "Expectation failed, should 'expected', is '$result'"
139-
exit 1
140-
fi
141-
```
142-
143-
Also, you may want to use `set -e` and `set -o pipefail` at the top of your
144-
script to catch unexpected errors as test case failures, e.g.
145-
146-
```yaml
147-
apiVersion: kuttl.dev/v1beta1
148-
kind: TestStep
149-
commands:
150-
- script: |
151-
set -e
152-
set -o pipefail
153-
# rest of your script
154-
```
155-
156-
#### Getting values of a resource's environment variables
157-
158-
YAML declarations used in `assert` or `errors` files unfortunately don't handle
159-
arrays very well yet. You will always have to specify the complete expectation,
160-
i.e. the complete array.
161-
162-
If you are just interested in a certain variable, and don't care about the rest,
163-
you can use a script similar to the following using `jq`. E.g. to get the value
164-
of a variable named `FOO` for the `argocd-server` deployment in the test's
165-
namespace:
166-
167-
```yaml
168-
apiVersion: kuttl.dev/v1beta1
169-
kind: TestStep
170-
commands:
171-
- script: |
172-
val=$(kubectl get -n $NAMESPACE deployments argocd-server -o json \
173-
| jq -r '.spec.templates.spec.containers[0].env[]|select(.name=="FOO").value')
174-
if test "$val" != "bar"; then
175-
echo "Expectation failed for for env FOO in argocd-server: should 'bar', is '$val'"
176-
exit 1
177-
fi
178-
```
3+
E2E tests are written using Ginkgo. See [documentation within the source repository](https://github.com/argoproj-labs/argocd-operator/tree/master/tests/ginkgo) for additional information.

hack/test.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/ha/1-020_validate_redis_ha_nonha/01-assert.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

tests/ha/1-020_validate_redis_ha_nonha/01-basic.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/ha/1-020_validate_redis_ha_nonha/01-errors.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

tests/ha/1-020_validate_redis_ha_nonha/02-assert.yaml

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)