From dc526455f04724d501a09aa3f45aeb88da95a118 Mon Sep 17 00:00:00 2001 From: Prasad Katti Date: Sat, 18 Apr 2020 20:29:40 -0700 Subject: [PATCH] Move integration testing doc from the readme.md to the website --- site/content/en/docs/contrib/testing.en.md | 33 ++++++++++++++++++++-- test/integration/README.md | 30 +------------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/site/content/en/docs/contrib/testing.en.md b/site/content/en/docs/contrib/testing.en.md index bc8e02eae5..2f88cf99d9 100644 --- a/site/content/en/docs/contrib/testing.en.md +++ b/site/content/en/docs/contrib/testing.en.md @@ -16,8 +16,9 @@ make test ### Integration Tests -Integration tests are currently run manually. -To run them, build the binary and run the tests: +#### The basics + +From the minikube root directory, build the binary and run the tests: ```shell make integration @@ -29,6 +30,34 @@ You may find it useful to set various options to test only a particular test aga env TEST_ARGS="-minikube-start-args=--driver=hyperkit -test.run TestStartStop" make integration ``` +#### Quickly iterating on a single test + +Run a single test on an active cluster: + +```shell +make integration -e TEST_ARGS="-test.run TestFunctional/parallel/MountCmd --profile=minikube --cleanup=false" +``` + +WARNING: For this to work repeatedly, the test must be written so that it cleans up after itself. + +The `--cleanup=false` test arg ensures that the cluster will not be deleted after the test is run. + +See [main.go](https://github.com/kubernetes/minikube/blob/master/test/integration/main.go) for details. + +#### Disabling parallelism + +```shell +make integration -e TEST_ARGS="-test.parallel=1" +``` + +#### Testing philosophy + +- Tests should be so simple as to be correct by inspection +- Readers should need to read only the test body to understand the test +- Top-to-bottom readability is more important than code de-duplication + +Tests are typically read with a great air of skepticism, because chances are they are being read only when things are broken. + ### Conformance Tests These are Kubernetes tests that run against an arbitrary cluster and exercise a wide range of Kubernetes features. diff --git a/test/integration/README.md b/test/integration/README.md index 7af031f6ea..8a62883dde 100644 --- a/test/integration/README.md +++ b/test/integration/README.md @@ -1,29 +1 @@ -# Integration tests - -## The basics - -To run all tests from the minikube root directory: - -`make integration` - -## Quickly iterating on a single test - -Run a single test on an active cluster: - -`make integration -e TEST_ARGS="-test.run TestFunctional/parallel/MountCmd --profile=minikube --cleanup=false"` - -WARNING: For this to work repeatedly, the test must be written so that it cleans up after itself. - -See `main.go` for details. - -## Disabling parallelism - -`make integration -e TEST_ARGS="-test.parallel=1"` - -## Testing philosophy - -- Tests should be so simple as to be correct by inspection -- Readers should need to read only the test body to understand the test -- Top-to-bottom readability is more important than code de-duplication - -Tests are typically read with a great air of skepticism, because chances are they are being read only when things are broken. +This document has moved to https://minikube.sigs.k8s.io/docs/contrib/testing/#integration-tests