Skip to content

Commit 525a68e

Browse files
committed
Adding Conformance Guidelines document.
1 parent bda72bc commit 525a68e

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

contributors/devel/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ Guide](http://kubernetes.io/docs/admin/).
4343
* **Document Conventions** ([how-to-doc.md](how-to-doc.md))
4444
Document style advice for contributors.
4545

46+
* **Conformance Tests Guidelines** ([conformance-guidelines.md](conformance-guidelines.md))
47+
Documenting Conformance tests.
48+
4649
* **Running a cluster locally** ([running-locally.md](running-locally.md)):
4750
A fast and lightweight local cluster deployment for development.
4851

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Conformance Test Guidelines
2+
3+
The Kubernetes conformance test suite is a set of testcases, currently a
4+
subset of the integration/e2e tests, that the Architecture SIG has approved
5+
to define the core set of interoperable features that all Kubernetes
6+
deployments must support.
7+
8+
For each Kubernetes release, a Conformance Document will be generated
9+
that lists all of the tests that comprise the conformance test suite, along
10+
with the formal specification of each test. This document will help people
11+
understand what features are being tested without having to look through
12+
the testcase's code directly.
13+
14+
## Adding New Tests
15+
16+
To include a testcase in the conformance test suite, the following
17+
steps must be taken:
18+
- the testcase must use the `framework.ConformanceIt()` function rather
19+
than the `framework.It()` function
20+
- the testcase must include a comment immediately before the
21+
`framework.ConformanceIt()` call that includes all of the required
22+
metadata about the test (see the [Test Metadata](#test-metadata) section)
23+
24+
The PR associated with this change will be automatically be blocked until the
25+
Architecture SIG has reviewed and approved the change. The mechanism by which
26+
the Architecture SIG is notified of the desired change is still TBD.
27+
28+
## Test Metadata
29+
30+
Each conformance test must include the following piece of metadata
31+
within its associated comment:
32+
33+
- `Release`: indicates the Kubernetes release that the test was added to the
34+
conformance test suite. If the test was modified in subsequent releases
35+
then those releases should be included as well (comma separated)
36+
- `Testname`: a human readable short name of the test
37+
- `Description`: a detailed description of the test. This field must describe
38+
the required behaviour of the Kubernetes components being tested using
39+
[RFC2119](https://tools.ietf.org/html/rfc2119) keywords. This field
40+
is meant to be a "specification" of the tested Kubernetes features, as
41+
such, it must be detailed enough so that readers can fully understand
42+
the aspects of Kubernetes that are being tested without having to read
43+
the test's code directly. Additionally, this test should provide a clear
44+
distinction between the parts of the test that are there for the purpose
45+
of validating Kubernetes rather than simply infrastructure logic that
46+
is necessary to setup, or clean up, the test.
47+
48+
## Sample Conformance Test
49+
50+
The following snippet of code shows a sample conformance test's metadata:
51+
52+
```
53+
/*
54+
Release : v1.9
55+
Testname: Kubelet: log output
56+
Description: By default the stdout and stderr from the process being
57+
executed in a pod MUST be sent to the pod's logs.
58+
*/
59+
framework.ConformanceIt("it should print the output to logs", func() {
60+
...
61+
})
62+
```
63+
64+
The corresponding portion of the Conformance Document would then look
65+
like this:
66+
67+
- - -
68+
## [Kubelet: log output](https://github.com/kubernetes/kubernetes/tree/release-1.9/test/e2e_node/kubelet_test.go#L47)
69+
70+
Release : v1.9
71+
By default the stdout and stderr from the process being executed in a pod MUST be sent to the pod's logs.
72+
```
73+
- - -
74+
75+

0 commit comments

Comments
 (0)