-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
acc: Added acceptance test for CLI commands inside bundle with and without profile flag #2270
Conversation
5e950bb
to
eb81b33
Compare
@@ -0,0 +1 @@ | |||
Badness = "When -p flag is used inside the bundle folder for any CLI commands, CLI use bundle host anyway instead of profile one" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do I know from the output which host is used? The commands only output the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using correct host meaning current-user me returns a expected user. There are no CLI commands (API) which returns host being used, so we can't really use server stubs unless we deviate from API responses.
We could use describe auth describe
command to see the host but this would deviate a bit from idea of this test: "I want my autogenerated CLI commands to make calls against correct host depending on flags I pass"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One idea on testing different hosts that comes to mind (up to you if you think it's worth it):
- Set up 2 servers in the test runner, $DATABRICKS_HOST and $DATABRICKS_OTHER_HOST
- Update RequestLog added by @shreyas-goenka feature to include host that is being used.
targets: | ||
dev: | ||
default: true | ||
workspace: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We don't have to override the same host here since it's the default target
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, but I just made it explicit
"$USERNAME" | ||
|
||
=== Inside the bundle, target and matching profile | ||
>>> errcode $CLI current-user me -t dev -p DEFAULT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This doesn't provide any extra coverage since -t dev is implicit in the configuration. Same below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, because it test what happens if we provide both -t
and -p
with matching hosts.
because we could make a change making -t and -p exclusive and this test would break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(see comments)
…thout profile flag
2ea42d7
to
66ff914
Compare
Changes
This encodes existing behaviour in CLI as reported here: #1358