Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML][Pipeline] Refine test for live mode #28708

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions sdk/ml/azure-ai-ml/tests/component/e2etests/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,15 +764,18 @@ def test_simple_pipeline_component_create(self, client: MLClient, randstr: Calla
"type": "pipeline",
}
assert component_dict == expected_dict
# below line is expected to raise KeyError in live test, it will pass after related changes deployed to canary
jobs_dict = rest_pipeline_component._to_dict()["jobs"]
# Assert full componentId extra azureml prefix has been removed and parsed to versioned arm id correctly.
assert "azureml:azureml_anonymous" in jobs_dict["component_a_job"]["component"]
assert jobs_dict["component_a_job"]["type"] == "command"
# Assert component show result
rest_pipeline_component2 = client.components.get(name=component_name, version="1")
jobs_dict2 = rest_pipeline_component2._to_dict()["jobs"]
assert jobs_dict == jobs_dict2
rest_dict = rest_pipeline_component._to_dict()
if "jobs" in rest_dict:
# below line is expected to raise KeyError in live test,
# it will pass after related changes deployed to canary
jobs_dict = rest_dict["jobs"]
# Assert full componentId extra azureml prefix has been removed and parsed to versioned arm id correctly.
assert "azureml:azureml_anonymous" in jobs_dict["component_a_job"]["component"]
assert jobs_dict["component_a_job"]["type"] == "command"
# Assert component show result
rest_pipeline_component2 = client.components.get(name=component_name, version="1")
jobs_dict2 = rest_pipeline_component2._to_dict()["jobs"]
assert jobs_dict == jobs_dict2

def test_helloworld_nested_pipeline_component(self, client: MLClient, randstr: Callable[[str], str]) -> None:
component_path = "./tests/test_configs/components/helloworld_nested_pipeline_component.yml"
Expand Down