test semantics
This commit is contained in:
@@ -39,6 +39,7 @@ class MockMappingService:
|
||||
self.mappings = mappings
|
||||
|
||||
def get_remote_ids_batch(self, env_id, resource_type, uuids):
|
||||
# @INVARIANT_VIOLATION: resource_type parameter is silently ignored. Lookups are UUID-only; chart and dataset UUIDs share the same namespace. Tests that mix resource types will produce false positives.
|
||||
result = {}
|
||||
for uuid in uuids:
|
||||
if uuid in self.mappings:
|
||||
|
||||
@@ -148,6 +148,7 @@ class CleanReleaseCompliancePlugin:
|
||||
# @PURPOSE: Provide minimal plugin loader contract used by TaskManager in integration tests.
|
||||
# @INVARIANT: has_plugin/get_plugin only acknowledge the seeded compliance plugin id.
|
||||
class _PluginLoaderStub:
|
||||
# @CONTRACT: Partial PluginLoader stub. Implements: has_plugin, get_plugin. Stubs (NotImplementedError): list_plugins, get_all_plugins, get_all_plugin_configs.
|
||||
def __init__(self, plugin: CleanReleaseCompliancePlugin):
|
||||
self._plugin = plugin
|
||||
|
||||
@@ -159,6 +160,21 @@ class _PluginLoaderStub:
|
||||
raise ValueError("Plugin not found")
|
||||
return self._plugin
|
||||
|
||||
def list_plugins(self):
|
||||
raise NotImplementedError(
|
||||
"list_plugins not implemented in _PluginLoaderStub; add if test path requires plugin enumeration"
|
||||
)
|
||||
|
||||
def get_all_plugins(self):
|
||||
raise NotImplementedError(
|
||||
"get_all_plugins not implemented in _PluginLoaderStub; add if test path requires full plugin set"
|
||||
)
|
||||
|
||||
def get_all_plugin_configs(self):
|
||||
raise NotImplementedError(
|
||||
"get_all_plugin_configs not implemented in _PluginLoaderStub; add if test path requires plugin configs"
|
||||
)
|
||||
|
||||
|
||||
# [/DEF:_PluginLoaderStub:Class]
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ def make_adapter():
|
||||
client = MagicMock()
|
||||
client.network = MagicMock()
|
||||
return SupersetCompilationAdapter(environment=environment, client=client), client
|
||||
|
||||
|
||||
# [/DEF:make_adapter:Function]
|
||||
|
||||
|
||||
@@ -61,6 +63,8 @@ def test_preview_prefers_supported_client_method_before_network_fallback():
|
||||
assert preview.compiled_sql == "SELECT 1"
|
||||
client.compile_preview.assert_called_once()
|
||||
client.network.request.assert_not_called()
|
||||
|
||||
|
||||
# [/DEF:test_preview_prefers_supported_client_method_before_network_fallback:Function]
|
||||
|
||||
|
||||
@@ -88,10 +92,14 @@ def test_preview_falls_back_across_matrix_until_supported_endpoint_returns_sql()
|
||||
assert preview.preview_status.value == "ready"
|
||||
assert preview.compiled_sql == "SELECT * FROM dataset_77"
|
||||
assert client.network.request.call_count == 2
|
||||
# @FRAGILE: Positional call assertion — ordering changes will break this test without indicating a real regression. Prefer content-based assertion.
|
||||
first_call = client.network.request.call_args_list[0].kwargs
|
||||
# @FRAGILE: Positional call assertion — ordering changes will break this test without indicating a real regression. Prefer content-based assertion.
|
||||
second_call = client.network.request.call_args_list[1].kwargs
|
||||
assert first_call["endpoint"] == "/dataset/77/preview"
|
||||
assert second_call["endpoint"] == "/dataset/77/sql"
|
||||
|
||||
|
||||
# [/DEF:test_preview_falls_back_across_matrix_until_supported_endpoint_returns_sql:Function]
|
||||
|
||||
|
||||
@@ -124,11 +132,15 @@ def test_sql_lab_launch_falls_back_to_legacy_execute_endpoint():
|
||||
|
||||
assert sql_lab_ref == "query-123"
|
||||
assert client.network.request.call_count == 2
|
||||
# @FRAGILE: Positional call assertion — ordering changes will break this test without indicating a real regression. Prefer content-based assertion.
|
||||
first_call = client.network.request.call_args_list[0].kwargs
|
||||
# @FRAGILE: Positional call assertion — ordering changes will break this test without indicating a real regression. Prefer content-based assertion.
|
||||
second_call = client.network.request.call_args_list[1].kwargs
|
||||
assert first_call["endpoint"] == "/sqllab/execute/"
|
||||
assert second_call["endpoint"] == "/sql_lab/execute/"
|
||||
|
||||
|
||||
# [/DEF:test_sql_lab_launch_falls_back_to_legacy_execute_endpoint:Function]
|
||||
|
||||
|
||||
# [/DEF:SupersetCompatibilityMatrixTests:Module]
|
||||
# [/DEF:SupersetCompatibilityMatrixTests:Module]
|
||||
|
||||
Reference in New Issue
Block a user