Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: cvillanueva@equinix.com <cvillanueva@equinix.com> ## Description Unit tests to validate functionality of tink-cli. These tests do not require external components to be live. They simply test to see if the sub-functions exists and use the help argument to return the description of the command. ## Why is this needed To ensure commands persist between versions. Fixes: # ## How Has This Been Tested? Run `go test -v` from within cmd/tink-cli/cmd ``` agrant@provisioner:/vagrant/cmd/tink-cli/cmd$ go test -v === RUN Test_docsCmd === RUN Test_docsCmd/NoArgs Error: accepts 1 arg(s), received 0 Usage: tink-cli docs [markdown|man] [flags] Flags: -h, --help help for docs -p, --path string Path where documentation will be generated === RUN Test_docsCmd/Help === RUN Test_docsCmd/Markdown === RUN Test_docsCmd/Man === RUN Test_docsCmd/BadFormat Error: invalid argument "invalid" for "tink-cli docs" Usage: tink-cli docs [markdown|man] [flags] Flags: -h, --help help for docs -p, --path string Path where documentation will be generated --- PASS: Test_docsCmd (0.00s) --- PASS: Test_docsCmd/NoArgs (0.00s) --- PASS: Test_docsCmd/Help (0.00s) --- PASS: Test_docsCmd/Markdown (0.00s) --- PASS: Test_docsCmd/Man (0.00s) --- PASS: Test_docsCmd/BadFormat (0.00s) === RUN Test_hardwareCmd === RUN Test_hardwareCmd/NoArgs tink hardware client Usage: tink-cli hardware [command] Examples: tink hardware [command] Available Commands: delete delete hardware by id id get hardware by id ip get hardware by any associated ip list list all known hardware mac get hardware by any associated mac push push new hardware to tink watch register to watch an id for any changes Flags: -h, --help help for hardware Use "tink-cli hardware [command] --help" for more information about a command. === RUN Test_hardwareCmd/ID === RUN Test_hardwareCmd/List === RUN Test_hardwareCmd/IP === RUN Test_hardwareCmd/MAC === RUN Test_hardwareCmd/Delete === RUN Test_hardwareCmd/Watch === RUN Test_hardwareCmd/Push --- PASS: Test_hardwareCmd (0.00s) --- PASS: Test_hardwareCmd/NoArgs (0.00s) --- PASS: Test_hardwareCmd/ID (0.00s) --- PASS: Test_hardwareCmd/List (0.00s) --- PASS: Test_hardwareCmd/IP (0.00s) --- PASS: Test_hardwareCmd/MAC (0.00s) --- PASS: Test_hardwareCmd/Delete (0.00s) --- PASS: Test_hardwareCmd/Watch (0.00s) --- PASS: Test_hardwareCmd/Push (0.00s) === RUN Test_templateCmd === RUN Test_templateCmd/NoArgs tink template client Usage: tink-cli template [command] Examples: tink template [command] Available Commands: create create a workflow template delete delete a template get get a template list list all saved templates update update a template Flags: -h, --help help for template Use "tink-cli template [command] --help" for more information about a command. === RUN Test_templateCmd/List === RUN Test_templateCmd/Create === RUN Test_templateCmd/Delete === RUN Test_templateCmd/Get === RUN Test_templateCmd/Update --- PASS: Test_templateCmd (0.00s) --- PASS: Test_templateCmd/NoArgs (0.00s) --- PASS: Test_templateCmd/List (0.00s) --- PASS: Test_templateCmd/Create (0.00s) --- PASS: Test_templateCmd/Delete (0.00s) --- PASS: Test_templateCmd/Get (0.00s) --- PASS: Test_templateCmd/Update (0.00s) === RUN Test_workflowCmd === RUN Test_workflowCmd/NoArgs tink workflow client Usage: tink-cli workflow [command] Examples: tink workflow [command] Available Commands: create create a workflow data get workflow data delete delete a workflow events show all events for a workflow get get a workflow list list all workflows state get the current workflow state Flags: -h, --help help for workflow Use "tink-cli workflow [command] --help" for more information about a command. === RUN Test_workflowCmd/List === RUN Test_workflowCmd/Create === RUN Test_workflowCmd/Data === RUN Test_workflowCmd/Delete === RUN Test_workflowCmd/Events === RUN Test_workflowCmd/Get === RUN Test_workflowCmd/State --- PASS: Test_workflowCmd (0.00s) --- PASS: Test_workflowCmd/NoArgs (0.00s) --- PASS: Test_workflowCmd/List (0.00s) --- PASS: Test_workflowCmd/Create (0.00s) --- PASS: Test_workflowCmd/Data (0.00s) --- PASS: Test_workflowCmd/Delete (0.00s) --- PASS: Test_workflowCmd/Events (0.00s) --- PASS: Test_workflowCmd/Get (0.00s) --- PASS: Test_workflowCmd/State (0.00s) PASS ok github.com/tinkerbell/tink/cmd/tink-cli/cmd 0.013s ``` ## How are existing users impacted? What migration steps/scripts do we need? No user impact ## Checklist: I have: - [X] updated the documentation and/or roadmap (if required) - [X] added unit or e2e tests - [X] provided instructions on how to upgrade
- Loading branch information