Skip to content

Commit 473fcb2

Browse files
committed
chore: fix test smells
1 parent a64def2 commit 473fcb2

5 files changed

Lines changed: 9 additions & 52 deletions

File tree

.github/workflows/build_cluster_http_path.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import os
22
import re
33

4+
spog_native = os.getenv("TEST_PECO_SPOG_NATIVE") == "1"
45
spog_workspace_id = os.getenv("TEST_PECO_SPOG_WORKSPACE_ID")
56

6-
if spog_workspace_id:
7+
if spog_native:
8+
if not spog_workspace_id:
9+
raise RuntimeError("TEST_PECO_SPOG_NATIVE requires TEST_PECO_SPOG_WORKSPACE_ID.")
710
workspace_id = spog_workspace_id
811
else:
912
workspace_re = re.compile(r"^.*-(\d+)\..*$")
@@ -13,7 +16,7 @@
1316

1417
cluster_id = os.getenv("TEST_PECO_CLUSTER_ID")
1518
uc_cluster_id = os.getenv("TEST_PECO_UC_CLUSTER_ID")
16-
suffix = f"?o={workspace_id}" if spog_workspace_id else ""
19+
suffix = f"?o={workspace_id}" if spog_native else ""
1720
http_path = f"sql/protocolv1/o/{workspace_id}/{cluster_id}{suffix}"
1821
uc_http_path = f"sql/protocolv1/o/{workspace_id}/{uc_cluster_id}{suffix}"
1922

.github/workflows/integration-min-deps.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,6 @@ jobs:
290290
run: |
291291
mkdir -p logs
292292
DBT_TEST_USER=notnecessaryformosttests@example.com \
293-
DBT_DATABRICKS_LOCATION_ROOT="$DBT_DATABRICKS_LOCATION_ROOT" \
294-
DBT_DATABRICKS_HOST_NAME="$DBT_DATABRICKS_HOST_NAME" \
295-
DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH="$DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH" \
296-
DBT_DATABRICKS_CLIENT_ID="$DBT_DATABRICKS_CLIENT_ID" \
297-
DBT_DATABRICKS_CLIENT_SECRET="$DBT_DATABRICKS_CLIENT_SECRET" \
298293
xargs -r hatch -v run min-deps:pytest \
299294
--color=yes -v \
300295
--profile databricks_uc_cluster \
@@ -389,11 +384,6 @@ jobs:
389384
run: |
390385
mkdir -p logs
391386
DBT_TEST_USER=notnecessaryformosttests@example.com \
392-
DBT_DATABRICKS_LOCATION_ROOT="$DBT_DATABRICKS_LOCATION_ROOT" \
393-
DBT_DATABRICKS_HOST_NAME="$DBT_DATABRICKS_HOST_NAME" \
394-
DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH="$DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH" \
395-
DBT_DATABRICKS_CLIENT_ID="$DBT_DATABRICKS_CLIENT_ID" \
396-
DBT_DATABRICKS_CLIENT_SECRET="$DBT_DATABRICKS_CLIENT_SECRET" \
397387
xargs -r hatch -v run min-deps:pytest \
398388
--color=yes -v \
399389
--profile databricks_uc_sql_endpoint \
@@ -486,11 +476,7 @@ jobs:
486476
run: |
487477
mkdir -p logs
488478
DBT_TEST_USER=notnecessaryformosttests@example.com \
489-
DBT_DATABRICKS_LOCATION_ROOT="$DBT_DATABRICKS_LOCATION_ROOT" \
490-
DBT_DATABRICKS_HOST_NAME="$DBT_DATABRICKS_HOST_NAME" \
491479
DBT_DATABRICKS_HTTP_PATH="$DBT_DATABRICKS_CLUSTER_HTTP_PATH" \
492-
DBT_DATABRICKS_CLIENT_ID="$DBT_DATABRICKS_CLIENT_ID" \
493-
DBT_DATABRICKS_CLIENT_SECRET="$DBT_DATABRICKS_CLIENT_SECRET" \
494480
xargs -r hatch -v run min-deps:pytest \
495481
--color=yes -v \
496482
--profile databricks_cluster \
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,6 @@ jobs:
145145
run: |
146146
mkdir -p logs
147147
DBT_TEST_USER=notnecessaryformosttests@example.com \
148-
DBT_DATABRICKS_LOCATION_ROOT="$DBT_DATABRICKS_LOCATION_ROOT" \
149-
DBT_DATABRICKS_HOST_NAME="$DBT_DATABRICKS_HOST_NAME" \
150-
DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH="$DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH" \
151-
DBT_DATABRICKS_CLIENT_ID="$DBT_DATABRICKS_CLIENT_ID" \
152-
DBT_DATABRICKS_CLIENT_SECRET="$DBT_DATABRICKS_CLIENT_SECRET" \
153148
xargs -r hatch -v run pytest \
154149
--color=yes -v \
155150
--profile databricks_uc_cluster \
@@ -232,11 +227,6 @@ jobs:
232227
run: |
233228
mkdir -p logs
234229
DBT_TEST_USER=notnecessaryformosttests@example.com \
235-
DBT_DATABRICKS_LOCATION_ROOT="$DBT_DATABRICKS_LOCATION_ROOT" \
236-
DBT_DATABRICKS_HOST_NAME="$DBT_DATABRICKS_HOST_NAME" \
237-
DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH="$DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH" \
238-
DBT_DATABRICKS_CLIENT_ID="$DBT_DATABRICKS_CLIENT_ID" \
239-
DBT_DATABRICKS_CLIENT_SECRET="$DBT_DATABRICKS_CLIENT_SECRET" \
240230
xargs -r hatch -v run pytest \
241231
--color=yes -v \
242232
--profile databricks_uc_sql_endpoint \
@@ -317,11 +307,7 @@ jobs:
317307
run: |
318308
mkdir -p logs
319309
DBT_TEST_USER=notnecessaryformosttests@example.com \
320-
DBT_DATABRICKS_LOCATION_ROOT="$DBT_DATABRICKS_LOCATION_ROOT" \
321-
DBT_DATABRICKS_HOST_NAME="$DBT_DATABRICKS_HOST_NAME" \
322310
DBT_DATABRICKS_HTTP_PATH="$DBT_DATABRICKS_CLUSTER_HTTP_PATH" \
323-
DBT_DATABRICKS_CLIENT_ID="$DBT_DATABRICKS_CLIENT_ID" \
324-
DBT_DATABRICKS_CLIENT_SECRET="$DBT_DATABRICKS_CLIENT_SECRET" \
325311
xargs -r hatch -v run pytest \
326312
--color=yes -v \
327313
--profile databricks_cluster \

.github/workflows/integration.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,6 @@ jobs:
305305
run: |
306306
mkdir -p logs
307307
DBT_TEST_USER=notnecessaryformosttests@example.com \
308-
DBT_DATABRICKS_LOCATION_ROOT="$DBT_DATABRICKS_LOCATION_ROOT" \
309-
DBT_DATABRICKS_HOST_NAME="$DBT_DATABRICKS_HOST_NAME" \
310-
DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH="$DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH" \
311-
DBT_DATABRICKS_CLIENT_ID="$DBT_DATABRICKS_CLIENT_ID" \
312-
DBT_DATABRICKS_CLIENT_SECRET="$DBT_DATABRICKS_CLIENT_SECRET" \
313308
xargs -r hatch -v run pytest \
314309
--color=yes -v \
315310
--profile databricks_uc_cluster \
@@ -408,11 +403,6 @@ jobs:
408403
run: |
409404
mkdir -p logs
410405
DBT_TEST_USER=notnecessaryformosttests@example.com \
411-
DBT_DATABRICKS_LOCATION_ROOT="$DBT_DATABRICKS_LOCATION_ROOT" \
412-
DBT_DATABRICKS_HOST_NAME="$DBT_DATABRICKS_HOST_NAME" \
413-
DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH="$DBT_DATABRICKS_UC_CLUSTER_HTTP_PATH" \
414-
DBT_DATABRICKS_CLIENT_ID="$DBT_DATABRICKS_CLIENT_ID" \
415-
DBT_DATABRICKS_CLIENT_SECRET="$DBT_DATABRICKS_CLIENT_SECRET" \
416406
xargs -r hatch -v run pytest \
417407
--color=yes -v \
418408
--profile databricks_uc_sql_endpoint \
@@ -509,11 +499,7 @@ jobs:
509499
run: |
510500
mkdir -p logs
511501
DBT_TEST_USER=notnecessaryformosttests@example.com \
512-
DBT_DATABRICKS_LOCATION_ROOT="$DBT_DATABRICKS_LOCATION_ROOT" \
513-
DBT_DATABRICKS_HOST_NAME="$DBT_DATABRICKS_HOST_NAME" \
514502
DBT_DATABRICKS_HTTP_PATH="$DBT_DATABRICKS_CLUSTER_HTTP_PATH" \
515-
DBT_DATABRICKS_CLIENT_ID="$DBT_DATABRICKS_CLIENT_ID" \
516-
DBT_DATABRICKS_CLIENT_SECRET="$DBT_DATABRICKS_CLIENT_SECRET" \
517503
xargs -r hatch -v run pytest \
518504
--color=yes -v \
519505
--profile databricks_cluster \

tests/functional/adapter/spog/conftest.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ def _require_spog_test_env():
1919
"with SPOG support installed."
2020
)
2121
if os.getenv("TEST_PECO_SPOG_NATIVE") == "1":
22-
pytest.skip(
23-
"SPOG override tests are redundant on a SPOG-native profile."
24-
)
22+
pytest.skip("SPOG override tests are redundant on a SPOG-native profile.")
2523

2624

2725
def _workspace_id() -> str:
26+
"""Return the SPOG workspace ID to point tests at.
27+
"""
2828
workspace_id = os.getenv("TEST_PECO_SPOG_WORKSPACE_ID")
2929
if not workspace_id:
3030
raise RuntimeError("SPOG functional tests require TEST_PECO_SPOG_WORKSPACE_ID to be set.")
@@ -33,15 +33,11 @@ def _workspace_id() -> str:
3333

3434
def _spog_host() -> str:
3535
"""Return the SPOG host to point tests at.
36-
37-
Prefers TEST_PECO_SPOG_HOST so the default (non-SPOG) integration workflow
38-
can still exercise SPOG routing. Falls back to DBT_DATABRICKS_HOST_NAME,
39-
which the SPOG-specific workflow already sets to a SPOG vanity URL.
4036
"""
4137
host = os.getenv("TEST_PECO_SPOG_HOST")
4238
if not host:
4339
raise RuntimeError(
44-
"SPOG functional tests require TEST_PECO_SPOG_HOST or DBT_DATABRICKS_HOST_NAME."
40+
"SPOG functional tests require TEST_PECO_SPOG_HOST to be set."
4541
)
4642
return host
4743

0 commit comments

Comments
 (0)