Skip to content

Commit 46b81cf

Browse files
committed
README: add example for filtering test cases. #358
1 parent 6d0c5e2 commit 46b81cf

File tree

1 file changed

+25
-44
lines changed

1 file changed

+25
-44
lines changed

test/e2e/README.md

Lines changed: 25 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## Prerequisites
44

5-
Prepare a client connected to K8S.
5+
- Prepare a client connected to K8S.
6+
- Make sure [Ginkgo V2](https://onsi.github.io/ginkgo/MIGRATING_TO_V2) is installed.
67

78
## Hands-on Lab
89

@@ -14,48 +15,28 @@ export KUBECONFIG=$HOME/.kube/config
1415

1516
### Step 2: Run test
1617

18+
> The Ginkgo version of the following examples is V2.
19+
20+
- Running all cases.
21+
22+
```
23+
ginkgo test/e2e/
24+
```
25+
26+
- Running all cases labeled `simplecase`.
27+
28+
```
29+
ginkgo --label-filter=simplecase test/e2e/
30+
```
31+
32+
- Skip the cases of describing information contains `Namespace`.
33+
34+
```
35+
ginkgo --skip "list namespace" test/e2e/
36+
```
37+
38+
- Just run the description information contains `Namespace`'s cases.
39+
1740
```
18-
make e2e-local
19-
```
20-
Example output of simplecase:
21-
```
22-
$ make e2e-local
23-
=== RUN TestE2E
24-
STEP: Creating framework with timeout: 1200
25-
Running Suite: MySQL Operator E2E Suite
26-
=======================================
27-
Random Seed: 1640785115 - Will randomize all specs
28-
Will run 1 of 1 specs
29-
30-
Namespece test
31-
test list namespace
32-
/home/runkecheng/goCode/src/radondb-mysql-kubernetes/test/e2e/simplecase/list_namespace.go:38
33-
[BeforeEach] Namespece test
34-
/home/runkecheng/goCode/src/radondb-mysql-kubernetes/test/e2e/framework/framework.go:62
35-
STEP: creating a kubernetes client
36-
STEP: create a namespace api object (e2e-mc-1-cnkbs)
37-
[BeforeEach] Namespece test
38-
/home/runkecheng/goCode/src/radondb-mysql-kubernetes/test/e2e/simplecase/list_namespace.go:34
39-
STEP: before each
40-
[It] test list namespace
41-
/home/runkecheng/goCode/src/radondb-mysql-kubernetes/test/e2e/simplecase/list_namespace.go:38
42-
default
43-
kube-public
44-
kube-system
45-
kubesphere-controls-system
46-
kubesphere-devops-system
47-
kubesphere-devops-worker
48-
kubesphere-monitoring-federated
49-
kubesphere-monitoring-system
50-
kubesphere-system
51-
radondb-mysql
52-
radondb-mysql-kubernetes-system
53-
[AfterEach] Namespece test
54-
/home/runkecheng/goCode/src/radondb-mysql-kubernetes/test/e2e/framework/framework.go:63
55-
STEP: Collecting logs
56-
STEP: Run cleanup actions
57-
STEP: Delete testing namespace
58-
59-
Ran 1 of 1 Specs in 0.743 seconds
60-
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
41+
ginkgo --focus "list namespace" test/e2e/
6142
```

0 commit comments

Comments
 (0)