1111from databricks .sdk .core import Config , DatabricksError
1212from databricks .sdk .service .compute import CreatePolicyResponse
1313from databricks .sdk .service .iam import AccessControlRequest , PermissionLevel
14- from databricks .sdk .service .jobs import CreateResponse
1514from databricks .sdk .service .ml import CreateExperimentResponse , ModelDatabricks
1615from databricks .sdk .service .ml import PermissionLevel as ModelPermissionLevel
1716from databricks .sdk .service .sql import (
3029 EnvironmentInfo ,
3130 InstanceProfile ,
3231 WorkspaceObjects ,
33- _get_basic_job_cluster ,
34- _get_basic_task ,
3532 _set_random_permissions ,
3633)
3734
4340NUM_TEST_GROUPS = int (os .environ .get ("NUM_TEST_GROUPS" , 5 ))
4441NUM_TEST_INSTANCE_PROFILES = int (os .environ .get ("NUM_TEST_INSTANCE_PROFILES" , 3 ))
4542NUM_TEST_CLUSTER_POLICIES = int (os .environ .get ("NUM_TEST_CLUSTER_POLICIES" , 3 ))
46- NUM_TEST_JOBS = int (os .environ .get ("NUM_TEST_JOBS" , 3 ))
4743NUM_TEST_EXPERIMENTS = int (os .environ .get ("NUM_TEST_EXPERIMENTS" , 3 ))
4844NUM_TEST_MODELS = int (os .environ .get ("NUM_TEST_MODELS" , 3 ))
4945NUM_TEST_WAREHOUSES = int (os .environ .get ("NUM_TEST_WAREHOUSES" , 3 ))
@@ -255,33 +251,6 @@ def instance_profiles(env: EnvironmentInfo, ws: WorkspaceClient) -> list[Instanc
255251 logger .debug ("Test instance profiles deleted" )
256252
257253
258- @pytest .fixture
259- def jobs (env : EnvironmentInfo , ws : WorkspaceClient ) -> list [CreateResponse ]:
260- logger .debug ("Creating test jobs" )
261-
262- test_jobs : list [CreateResponse ] = [
263- ws .jobs .create (
264- name = f"{ env .test_uid } -test-{ i } " , job_clusters = [_get_basic_job_cluster ()], tasks = [_get_basic_task ()]
265- )
266- for i in range (NUM_TEST_JOBS )
267- ]
268-
269- _set_random_permissions (
270- test_jobs ,
271- "job_id" ,
272- RequestObjectType .JOBS ,
273- env ,
274- ws ,
275- permission_levels = [PermissionLevel .CAN_VIEW , PermissionLevel .CAN_MANAGE_RUN , PermissionLevel .CAN_MANAGE ],
276- )
277-
278- yield test_jobs
279-
280- logger .debug ("Deleting test jobs" )
281- executables = [partial (ws .jobs .delete , j .job_id ) for j in test_jobs ]
282- Threader (executables ).run ()
283-
284-
285254@pytest .fixture
286255def cluster_policies (env : EnvironmentInfo , ws : WorkspaceClient ) -> list [CreatePolicyResponse ]:
287256 logger .debug ("Creating test cluster policies" )
@@ -494,7 +463,6 @@ def workspace_objects(ws: WorkspaceClient, env: EnvironmentInfo) -> WorkspaceObj
494463@pytest .fixture
495464def verifiable_objects (
496465 cluster_policies ,
497- jobs ,
498466 experiments ,
499467 models ,
500468 warehouses ,
@@ -505,7 +473,6 @@ def verifiable_objects(
505473 (workspace_objects , "workspace_objects" , None ),
506474 (tokens , "tokens" , RequestObjectType .AUTHORIZATION ),
507475 (cluster_policies , "policy_id" , RequestObjectType .CLUSTER_POLICIES ),
508- (jobs , "job_id" , RequestObjectType .JOBS ),
509476 (experiments , "experiment_id" , RequestObjectType .EXPERIMENTS ),
510477 (models , "id" , RequestObjectType .REGISTERED_MODELS ),
511478 (warehouses , "id" , RequestObjectType .SQL_WAREHOUSES ),
0 commit comments