-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
contributing guide: add initial section on testing #1468
Conversation
/assign @guineveresaenger @spiffxp |
@tpepper: GitHub didn't allow me to assign the following users: guineveresaenger. Note that only kubernetes members can be assigned. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might also be worth noting in some place that CI runs these tests either as presubmits on PRs, post submits against master/release branches, or both (maybe even with a link to testgrid (https://testgrid.k8s.io)
contributors/guide/README.md
Outdated
_Improvements needed_ | ||
* link to testing process | ||
* walkthrough of where to find what in the tests (how to use, how to debug) | ||
Testing is the responsibility of all contributors and is in part owned by all sigs, but is also coordinated by [sig-testing](https://github.com/kubernetes/community/tree/master/sig-testing). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link should be: /sig-testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
contributors/guide/README.md
Outdated
* walkthrough of where to find what in the tests (how to use, how to debug) | ||
Testing is the responsibility of all contributors and is in part owned by all sigs, but is also coordinated by [sig-testing](https://github.com/kubernetes/community/tree/master/sig-testing). | ||
|
||
The main testing overview document is [here](https://github.com/kubernetes/community/blob/master/contributors/devel/testing.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link should be: /contributors/devel/testing.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
contributors/guide/README.md
Outdated
|
||
The main testing overview document is [here](https://github.com/kubernetes/community/blob/master/contributors/devel/testing.md). | ||
|
||
There are three coarse types of test in kubernetes. The location of the test code varies with type, as does the specifics of the environment needed to successfully run the test: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/coarse/core/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just dropped the word leaving "three types"
contributors/guide/README.md
Outdated
|
||
There are three coarse types of test in kubernetes. The location of the test code varies with type, as does the specifics of the environment needed to successfully run the test: | ||
|
||
* Unit: These confirm that a particular function behaves as intended. Golang includes native ability for unit testing via the [testing](https://golang.org/pkg/testing/) package. Unit test source code can be found adjacent to the corresponding source code within a given package. For example: functions defined in [kubernetes/cmd/kubeadm/app/util/version.go](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/version.go) will have unit tests in [kubernetes/cmd/kubeadm/app/util/version_test.go](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/version_test.go). These are easily run locally be any developer on any OS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
contributors/guide/README.md
Outdated
There are three coarse types of test in kubernetes. The location of the test code varies with type, as does the specifics of the environment needed to successfully run the test: | ||
|
||
* Unit: These confirm that a particular function behaves as intended. Golang includes native ability for unit testing via the [testing](https://golang.org/pkg/testing/) package. Unit test source code can be found adjacent to the corresponding source code within a given package. For example: functions defined in [kubernetes/cmd/kubeadm/app/util/version.go](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/version.go) will have unit tests in [kubernetes/cmd/kubeadm/app/util/version_test.go](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/version_test.go). These are easily run locally be any developer on any OS. | ||
* Integration: These tests cover interactions of package components or interactions between kubernetes components and some other non-kubernetes system resource (eg: etcd). An example would be testing whether a piece of code can correctly store data to or retrieve data from etcd. Integration tests are stored [here](https://github.com/kubernetes/kubernetes/tree/master/test/integration). Running these can require the developer set up additional functionality on their development system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
contributors/guide/README.md
Outdated
|
||
* Unit: These confirm that a particular function behaves as intended. Golang includes native ability for unit testing via the [testing](https://golang.org/pkg/testing/) package. Unit test source code can be found adjacent to the corresponding source code within a given package. For example: functions defined in [kubernetes/cmd/kubeadm/app/util/version.go](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/version.go) will have unit tests in [kubernetes/cmd/kubeadm/app/util/version_test.go](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/version_test.go). These are easily run locally be any developer on any OS. | ||
* Integration: These tests cover interactions of package components or interactions between kubernetes components and some other non-kubernetes system resource (eg: etcd). An example would be testing whether a piece of code can correctly store data to or retrieve data from etcd. Integration tests are stored [here](https://github.com/kubernetes/kubernetes/tree/master/test/integration). Running these can require the developer set up additional functionality on their development system. | ||
* End-to-end ("e2e"): These are broad tests of overall kubernetes system behavior and coherence. These are more complicated as they require a functional kubernetes cluster built from the sources to be tested. A separate document [here](https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-tests.md) details e2e testing and test cases themselves can be found [here](https://github.com/kubernetes/kubernetes/tree/master/test/e2e). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-tests.md should be /contributors/devel/e2e-tests.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
contributors/guide/README.md
Outdated
* Integration: These tests cover interactions of package components or interactions between kubernetes components and some other non-kubernetes system resource (eg: etcd). An example would be testing whether a piece of code can correctly store data to or retrieve data from etcd. Integration tests are stored [here](https://github.com/kubernetes/kubernetes/tree/master/test/integration). Running these can require the developer set up additional functionality on their development system. | ||
* End-to-end ("e2e"): These are broad tests of overall kubernetes system behavior and coherence. These are more complicated as they require a functional kubernetes cluster built from the sources to be tested. A separate document [here](https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-tests.md) details e2e testing and test cases themselves can be found [here](https://github.com/kubernetes/kubernetes/tree/master/test/e2e). | ||
|
||
Sig-testing is responsible for official infrastructure and its associated automation, which is tracked in the [test-insfra repo](https://github.com/kubernetes/test-infra). If you're looking to run e2e tests on your own infrastructure, [kubetest](https://github.com/kubernetes/test-infra/tree/master/kubetest) is the mechanism. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Sig-testing/sig-testing/
s/test-insfra/test-infra/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
1ec9d24
to
81c7ee3
Compare
I think I hit all @cblecker 's comments and added the suggested CI & results blurb. I thought about also adding a blurb on flakes, especially as a newbie contributor's first touch simple PR's are highly likely to hit job flakes that are clearly unrelated to their PR's (eg: simple comment or link url or typo or otherwise super trivial fixups). The section's already getting long though and @guineveresaenger doesn't want this doc to be large wall of text, so maybe that's better off in a testing FAQ elsewhere. |
contributors/guide/README.md
Outdated
|
||
There are three types of test in kubernetes. The location of the test code varies with type, as does the specifics of the environment needed to successfully run the test: | ||
|
||
* Unit: These confirm that a particular function behaves as intended. Golang includes native ability for unit testing via the [testing](https://golang.org/pkg/testing/) package. Unit test source code can be found adjacent to the corresponding source code within a given package. For example: functions defined in [kubernetes/cmd/kubeadm/app/util/version.go](https://git.k8s.io/kubernetes/cmd/kubeadm/app/util/version.go) will have unit tests in [kubernetes/cmd/kubeadm/app/util/version_test.go](https://git.k8s.io/kubernetes/cmd/kubeadm/app/util/version.go). These are easily run locally be any developer on any OS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the version_test.go link leads to version.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dang copy paste while sitting in a conference talk multitasking. Refixed.
lgtm other than the one fix above. will leave for others to have a chance to look at |
This commit replaces the "Improvements needed" marker for the testing topic with an initial section of overview information and jumping off links to sig-testing, test documentation, and test code. Part of: kubernetes#1413 Signed-off-by: Tim Pepper <[email protected]>
81c7ee3
to
951c10e
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cblecker, tpepper The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
This commit replaces the "Improvements needed" marker for the testing
topic with an initial section of overview information and jumping off links
to sig-testing, test documentation, and test code.
Part of: #1413
Signed-off-by: Tim Pepper [email protected]