databricks / cli

Databricks CLI
Other
132 stars 50 forks source link

Fix streaming of stdout, stdin, stderr in cobra test runner #1742

Closed shreyas-goenka closed 3 weeks ago

shreyas-goenka commented 4 weeks ago

Changes

We were not using the readers and writers set in the test fixtures in the progress logger. This PR fixes that. It also modifies TestAccAbortBind, which was implicitly relying on the bug.

I encountered this bug while working on https://github.com/databricks/cli/pull/1672.

Tests

Manually.

From non-tty:

Error: failed to bind the resource, err: This bind operation requires user confirmation, but the current console does not support prompting. Please specify --auto-approve if you would like to skip prompts and proceed.

From tty, bind works as expected.

Confirm import changes? Changes will be remotely applied only after running 'bundle deploy'. [y/n]: y
Updating deployment state...
Successfully bound databricks_pipeline with an id '9d2dedbb-f522-4503-96ba-4bc4d5bfa77d'. Run 'bundle deploy' to deploy changes to your workspace
shreyas-goenka commented 4 weeks ago

Triggered the nightlies on this...

shreyas-goenka commented 4 weeks ago

Nightlies are green and happy with this PR.