1818logger = logging .getLogger (__name__ )
1919
2020
21- def test_destroying_non_existing_schema_fails_with_correct_message (ws , sql_backend , env_or_skip , make_random ):
21+ def test_job_failure_propagates_correct_error_message_and_logs (ws , sql_backend , env_or_skip , make_random ):
2222 default_cluster_id = env_or_skip ("TEST_DEFAULT_CLUSTER_ID" )
2323 tacl_cluster_id = env_or_skip ("TEST_LEGACY_TABLE_ACL_CLUSTER_ID" )
2424 ws .clusters .ensure_cluster_is_running (default_cluster_id )
@@ -44,35 +44,13 @@ def test_destroying_non_existing_schema_fails_with_correct_message(ws, sql_backe
4444 },
4545 )
4646
47+ sql_backend .execute (f"DROP SCHEMA { inventory_database } CASCADE" )
48+
4749 with pytest .raises (OperationFailed ) as failure :
4850 install .run_workflow ("099-destroy-schema" )
4951
5052 assert "cannot be found" in str (failure .value )
5153
52-
53- def test_logs_are_available (ws , sql_backend , env_or_skip , make_random ):
54- default_cluster_id = env_or_skip ("TEST_DEFAULT_CLUSTER_ID" )
55- ws .clusters .ensure_cluster_is_running (default_cluster_id )
56-
57- install = WorkspaceInstaller .run_for_config (
58- ws ,
59- WorkspaceConfig (
60- inventory_database = f"ucx_{ make_random (4 )} " ,
61- instance_pool_id = env_or_skip ("TEST_INSTANCE_POOL_ID" ),
62- groups = GroupsConfig (auto = True ),
63- log_level = "INFO" ,
64- ),
65- sql_backend = sql_backend ,
66- prefix = make_random (4 ),
67- override_clusters = {
68- "main" : default_cluster_id ,
69- },
70- )
71-
72- with pytest .raises (OperationFailed ):
73- install .run_workflow ("099-destroy-schema" )
74- assert True
75-
7654 workflow_run_logs = list (ws .workspace .list (f"{ install ._install_folder } /logs" ))
7755 assert len (workflow_run_logs ) == 1
7856
0 commit comments