You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributor-docs/development/tests/conformance-tests-sonobuoy.md
+29-21Lines changed: 29 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,19 @@ Hence this reduces the effort required to establish SCS conformity to a minimum.
6
6
7
7
In short this is achieved by storing all tests in a container image, which can then be called and launched on the clusters managed by sonoobuoy.
8
8
9
-
> [!NOTE]
10
-
> A more detailed description of why the SCS has decided to use sonobuoys can be found on the corresponding [Decsision Record][sonbouy-decision-record].
11
-
> In addition, sonobuoy is also used as the toolset for executing Kubernetes very own [conformance tests][k8s-conformance].
9
+
:::note
10
+
A more detailed description of why the SCS has decided to use sonobuoys can be found on the corresponding [Decsision Record][sonbouy-decision-record].
11
+
In addition, sonobuoy is also used as the toolset for executing Kubernetes very own [conformance tests][k8s-conformance].
12
+
:::
12
13
13
14
This document is intended to assist conformance test authors to integrate their tests into the sonobuoy framework.
14
15
This requires a user to write the conformance tests in Golang, as this is the language provided by the framework itself.
15
16
16
17
## Step-by-step instructions for the development of sonobuoy tests using `docker` and `kind`
17
18
18
-
> [!NOTE]
19
-
> This guide refers to the brief instructions provided in the [standards repository][scs-sonobuoy-example-guide]
19
+
:::note
20
+
This guide refers to the brief instructions provided in the [standards repository][scs-sonobuoy-example-guide]
21
+
:::
20
22
21
23
### Prerequisite
22
24
@@ -70,9 +72,11 @@ In general, SCS tests for KaaS are derived from standards that define certain ex
70
72
As an example for this step-by-step guide, let's assume a scenario in which there is a fictional standard called "scs-0299-v1-example-standard.md".
71
73
Pretend that the fictitious standard here stipulates that at least one pod MUST run in the namespace "namespace-test-a".
72
74
73
-
> [!NOTE]
74
-
> The functions and behaviors to be tested MUST be precisely defined in a standard.
75
-
> If you as a developer want to test something that you think is best tested but is not yet part of any standard, you MUST update the standard accordingly.
75
+
:::note
76
+
The functions and behaviors to be tested MUST be precisely defined in a standard.
77
+
If you as a developer want to test something that you think is best tested but is not yet part of any standard, you MUST update the standard accordingly.
78
+
:::
79
+
76
80
77
81
#### 1. Create example test
78
82
@@ -87,9 +91,10 @@ First create a test file according to your standard and adhere to the naming con
87
91
* The prefix MUST contain the name of the standard in lower case letters.
88
92
* As a suffix, the file must end with "_test.go".
89
93
90
-
> [!NOTE]
91
-
> The suffix requirement comes from the go test framework itself. All test files must end with `_test.go`.
92
-
> Otherwise they will not be selected by the test environment.
94
+
:::note
95
+
The suffix requirement comes from the go test framework itself. All test files must end with `_test.go`.
96
+
Otherwise they will not be selected by the test environment.
97
+
:::
93
98
94
99
As an example, we will create a file for the fictitious standard "scs-0299-v1-example-standard.md" as follows:
95
100
@@ -102,11 +107,12 @@ As an example, we test here whether there are more than zero pods in the namespa
102
107
The execution of this test should fail by default as there should be no pods in the namespace and the namespace itself should not exist.
103
108
The aim is to display the results of a failed test so that we can show their interpretation in a later step.
104
109
105
-
> [!NOTE]
106
-
> Attention!!!: in order for the framework to select the functions for testing, their names must begin with "TEST_" in accordance with the naming convention of the golang test framework.
107
-
> The framework in use is [kubernetes-sigs/e2e-framework][e2e-framework].
108
-
> They also provide examples. Before you start implementing your own tests, you should check whether you can use one of the examples as a starting point for your own implementation.
109
-
> Have a look at: [kubernetes-sigs/e2e-framework/examples][e2e-framework-examples]
110
+
:::danger
111
+
In order for the framework to select the functions for testing, their names must begin with "TEST_" in accordance with the naming convention of the golang test framework.
112
+
The framework in use is [kubernetes-sigs/e2e-framework][e2e-framework].
113
+
They also provide examples. Before you start implementing your own tests, you should check whether you can use one of the examples as a starting point for your own implementation.
114
+
Have a look at: [kubernetes-sigs/e2e-framework/examples][e2e-framework-examples]
115
+
:::
110
116
111
117
As an example of this step-by-step guide, copy the following text into the file `scs_0299_v1_example_standard_test.go`:
0 commit comments