k3s/pkg/kubectl/cmd/edit/testdata
Kubernetes Prow Robot caaad1be26
Merge pull request #72526 from justinsb/testdata_should_not_be_executable
Remove executable permission from testdata
2019-02-28 20:35:56 -08:00
..
testcase-apply-edit-last-applied Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-apply-edit-last-applied-list Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-apply-edit-last-applied-list-fail Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-apply-edit-last-applied-syntax-error Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-create-list Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-create-list-error Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-edit-error-reedit Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-edit-from-empty Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-edit-output-patch Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-immutable-name Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-list Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-list-errors Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-list-record Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-missing-service Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-no-op Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-not-update-annotation Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-repeat-error Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-schemaless-list Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-single-service Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-syntax-error Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-unknown-field-known-group-kind Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-unknown-version-known-group-kind Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
testcase-update-annotation Remove executable permission from testdata 2019-01-03 12:21:31 -05:00
BUILD Manual changes to package visibility and test dependencies 2018-10-06 18:44:05 +02:00
README
record.go
record_editor.sh
record_testcase.sh fix shellcheck in pkg/kubectl/cmd/edit/testdata/record_testcase.sh 2019-02-22 15:10:38 +08:00
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