mirror of https://github.com/databricks/cli.git
3fa400f00f
## Changes Generated commands relied on global variables for flags and request payloads. This is difficult to test if a sequence of tests tries to run the same command with various arguments because the global state causes test interference. Moreover, it is impossible to run tests in parallel. This change modifies the approach and turns every command group and command itself into a function that returns a `*cobra.Command`. All flags and request payloads are variables scoped to the command's initialization function. This means it is possible to construct independent copies of the CLI structure and fixes the test isolation issue. The scope of this change is only the generated commands. The other commands will be changed accordingly in subsequent changes. ## Tests Unit and integration tests pass. |
||
---|---|---|
.. | ||
experiments.go |