...

Text file src/k8s.io/kubernetes/test/cmd/README.md

Documentation: k8s.io/kubernetes/test/cmd

     1# Kubernetes Command-Line Integration Test Suite
     2
     3This document describes how you can use the Kubernetes command-line integration test-suite.
     4
     5## Running Tests
     6
     7### All Tests
     8
     9To run this entire suite, execute `make test-cmd` from the top level.  This will import each file containing tests functions
    10
    11### Specific Tests
    12
    13To run a subset of tests (e.g. `run_deployment_tests` and `run_impersonation_tests`), execute `make test-cmd WHAT="deployment impersonation"`.  Running specific
    14tests will not try and validate any required resources are available on the server.
    15
    16## Adding Tests
    17
    18Test functions need to have the format `run_*_tests` so they can be executed individually.  Once a test has been added, insert a section in `legacy-script.sh` like
    19
    20```bash
    21######################
    22# Replica Sets       #
    23######################
    24
    25if kube::test::if_supports_resource "${replicasets}" ; then
    26    record_command run_rs_tests
    27fi
    28```
    29
    30Be sure to validate any supported resources required for the test by using the `kube::test::if_supports_resource` function. 
    31
    32
    33### New File
    34
    35If the test resides in a new file, source the file in the top of the `legacy-script.sh` file by adding a new line in
    36```bash
    37source "${KUBE_ROOT}/test/cmd/apply.sh"
    38source "${KUBE_ROOT}/test/cmd/apps.sh"
    39source "${KUBE_ROOT}/test/cmd/authorization.sh"
    40source "${KUBE_ROOT}/test/cmd/batch.sh"
    41...
    42```
    43
    44Please keep the order of the source list alphabetical.

View as plain text