k3s/pkg/kubectl/cmd/testdata/edit
Jeffrey Regan 7abff879d7 Introduce visibility rules to kubernetes code.
**What this PR does / why we need it**:

Visibility rules allow dependency control.  The rules currently in
place make all targets public, to override the default state of
private.  This PR removes public visibility from kubectl code.  It
uses specially named pacakge groups to identify "bad" dependencies on
kubectl code for later refactoring or removal.

**Which issue this PR fixes**

First in a series of PRs to address kubernetes/community#598

**Release note**:
```release-note
NONE
```
2017-05-15 12:50:56 -07:00
..
testcase-create-list Simplify 'kubectl edit' logic 2017-02-14 14:51:06 -05:00
testcase-create-list-error Simplify 'kubectl edit' logic 2017-02-14 14:51:06 -05:00
testcase-edit-error-reedit
testcase-immutable-name
testcase-list
testcase-list-errors
testcase-list-record Add advanced 'kubectl edit' test scenarios 2017-02-14 14:50:45 -05:00
testcase-missing-service
testcase-no-op
testcase-not-update-annotation make edit respect --save-config 2017-02-27 13:34:07 -08:00
testcase-repeat-error Add advanced 'kubectl edit' test scenarios 2017-02-14 14:50:45 -05:00
testcase-schemaless-list Switch 'kubectl edit' to use unstructured objects, handle schemaless objects 2017-02-14 14:55:02 -05:00
testcase-single-service
testcase-syntax-error Simplify 'kubectl edit' logic 2017-02-14 14:51:06 -05:00
testcase-unknown-field-known-group-kind Add 'kubectl edit' testcase for unknown field in known group/version/kind 2017-02-20 20:40:03 -05:00
testcase-unknown-version-known-group-kind Switch 'kubectl edit' to use unstructured objects, handle schemaless objects 2017-02-14 14:55:02 -05:00
testcase-update-annotation make edit respect --save-config 2017-02-27 13:34:07 -08:00
BUILD Introduce visibility rules to kubernetes code. 2017-05-15 12:50:56 -07:00
README
record.go
record_editor.sh
record_testcase.sh
test_editor.sh

README

This folder contains test cases for interactive edit, and helpers for recording new test cases

To record a new test:

1. Start a local cluster running unsecured on http://localhost:8080 (e.g. hack/local-up-cluster.sh)
2. Set up any pre-existing resources you want to be available on that server (namespaces, resources to edit, etc)
3. Run ./pkg/kubectl/cmd/testdata/edit/record_testcase.sh my-testcase
4. Run the desired `kubectl edit ...` command, and interact with the editor as desired until it completes.
  * You can do things that cause errors to appear in the editor (change immutable fields, fail validation, etc)
  * You can perform edit flows that invoke the editor multiple times
  * You can make out-of-band changes to the server resources that cause conflict errors to be returned
  * The API requests/responses and editor inputs/outputs are captured in your testcase folder
5. Type exit.
6. Inspect the captured requests/responses and inputs/outputs for sanity
7. Modify the generated test.yaml file:
  * Set a description of what the test is doing
  * Enter the args (if any) you invoked edit with
  * Enter the filename (if any) you invoked edit with
  * Enter the output format (if any) you invoked edit with
  * Optionally specify substrings to look for in the stdout or stderr of the edit command
8. Add your new testcase name to the list of testcases in edit_test.go
9. Run `go test ./pkg/kubectl/cmd -run TestEdit -v` to run edit tests