Add acceptance tests for auth describe

This commit is contained in:
Shreyas Goenka 2025-02-27 19:27:46 +01:00
parent 6a07e05e9b
commit f34d568908
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
15 changed files with 73 additions and 14 deletions

View File

@ -1,14 +1,11 @@
>>> errcode [CLI] bundle deploy >>> errcode [CLI] bundle deploy
Building whl1... Building whl1...
Building whl2... Error: build failed whl1, error: exit status 1, output: Traceback (most recent call last):
Error: Duplicate local library names: my_default_python-0.0.1-py3-none-any.whl File "[TMPDIR]/whl1/setup.py", line 1, in <module>
at resources.jobs.test.tasks[0].libraries[0].whl from setuptools import setup, find_packages
resources.jobs.test.tasks[1].libraries[0].whl ModuleNotFoundError: No module named 'setuptools'
in databricks.yml:36:15
databricks.yml:45:15
Local library names must be unique but found libraries with the same name: whl1/dist/my_default_python-0.0.1-py3-none-any.whl, whl2/dist/my_default_python-0.0.1-py3-none-any.whl
Exit code: 1 Exit code: 1

View File

@ -1,10 +1,11 @@
>>> errcode [CLI] bundle deploy >>> errcode [CLI] bundle deploy
Building whl1... Building whl1...
Building whl2... Error: build failed whl1, error: exit status 1, output: Traceback (most recent call last):
Uploading [package name] File "[TMPDIR]/whl1/setup.py", line 1, in <module>
Uploading [package name] from setuptools import setup, find_packages
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/unique_name_libraries/default/files... ModuleNotFoundError: No module named 'setuptools'
Deploying resources...
Updating deployment state...
Deployment complete!
Exit code: 1

View File

@ -0,0 +1,12 @@
>>> [CLI] auth describe
Host: [DATABRICKS_URL]
User: [USERNAME]
Authenticated with: pat
-----
Current configuration:
✓ host: [DATABRICKS_URL] (from DATABRICKS_HOST environment variable)
✓ token: ******** (from DATABRICKS_TOKEN environment variable)
✓ profile: default
✓ databricks_cli_path: [CLI]
✓ auth_type: pat

View File

@ -0,0 +1 @@
trace $CLI auth describe

View File

@ -0,0 +1,2 @@
bundle:
name: foobar

View File

@ -0,0 +1,12 @@
>>> [CLI] auth describe
Host: [DATABRICKS_URL]
User: [USERNAME]
Authenticated with: pat
-----
Current configuration:
✓ host: [DATABRICKS_URL] (from DATABRICKS_HOST environment variable)
✓ token: ******** (from DATABRICKS_TOKEN environment variable)
✓ profile: default
✓ databricks_cli_path: [CLI]
✓ auth_type: pat

View File

@ -0,0 +1 @@
trace $CLI auth describe

View File

@ -0,0 +1,3 @@
[myprofile]
host = https://test@non-existing-subdomain.databricks.com
token = dapi1234

View File

@ -0,0 +1,6 @@
>>> [CLI] auth describe
Unable to authenticate: Get "https://non-existing-subdomain.databricks.com/api/2.0/preview/scim/v2/Me": dial tcp: lookup non-existing-subdomain.databricks.com: no such host
-----
Current configuration:
✓ profile: myprofile (from bundle)

View File

@ -0,0 +1,6 @@
export DATABRICKS_HOST=""
export DATABRICKS_TOKEN=""
export DATABRICKS_CONFIG_FILE=".databrickscfg"
export DATABRICKS_CONFIG_PROFILE="myprofile"
trace $CLI auth describe

View File

@ -0,0 +1,3 @@
[myprofile]
host = https://test@non-existing-subdomain.databricks.com
token = dapi1234

View File

@ -0,0 +1,2 @@
bundle:
name: foobar

View File

@ -0,0 +1,6 @@
>>> [CLI] auth describe
Unable to authenticate: Get "https://non-existing-subdomain.databricks.com/api/2.0/preview/scim/v2/Me": dial tcp: lookup non-existing-subdomain.databricks.com: no such host
-----
Current configuration:
✓ profile: myprofile (from bundle)

View File

@ -0,0 +1,6 @@
export DATABRICKS_HOST=""
export DATABRICKS_TOKEN=""
export DATABRICKS_CONFIG_FILE=".databrickscfg"
export DATABRICKS_CONFIG_PROFILE="myprofile"
trace $CLI auth describe

View File

@ -0,0 +1 @@
Badness = "The profile is coming from the environment variable, not the bundle. This is a bug because auth describe attributes it to the bundle."