[ML][Pipelines] Test: update invalid reuse test
* test: remove useless test
* Revert "test: remove useless test"
This reverts commit
* remove assert component id
@@ -536,6 +536,9 @@ class TestComponent(AzureRecordedTestCase):
@pytest.mark.disable_mock_code_hash
@pytest.mark.skipif(condition=not is_live(), reason="reuse test, target to verify service-side behavior")
def test_anonymous_component_reuse(self, client: MLClient, variable_recorder) -> None:
+ # component with different name will be created as different instance;
+ # therefore component reuse will not work as component name differs
+
# component without code
component_name_1 = variable_recorder.get_or_record("component_name_1", str(uuid.uuid4()))
component_name_2 = variable_recorder.get_or_record("component_name_2", str(uuid.uuid4()))
@@ -545,7 +548,6 @@ class TestComponent(AzureRecordedTestCase):
component_resource2 = create_component(
client, _sanitize_python_variable_name(component_name_2), is_anonymous=True
)
- assert component_resource1.id == component_resource2.id
assert component_resource1.environment == component_resource2.environment
assert component_resource1.code == component_resource2.code
@@ -563,9 +565,7 @@ class TestComponent(AzureRecordedTestCase):
path=path,
is_anonymous=True,
)
- # TODO: enable this check when environment reuse is enabled
- # assert component_resource1.id == component_resource2.id
- # assert component_resource1.environment == component_resource2.environment
+ assert component_resource1.environment == component_resource2.environment
assert component_resource1.code == component_resource2.code
def test_command_component_dependency_label_resolution(
