Skip to content

Commit 354b419

Browse files
authored
add test for submit component with set unknown input file. (Azure#29985)
* add test * update test * update recording * update code * update code
1 parent a1571ac commit 354b419

File tree

2 files changed

+463
-0
lines changed

2 files changed

+463
-0
lines changed

sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3286,3 +3286,19 @@ def pipeline_func():
32863286
node_compute = rest_obj.properties.jobs[node_name]["computeId"]
32873287
assert is_singularity_id_for_resource(node_compute)
32883288
assert node_compute.endswith(singularity_vc.name)
3289+
3290+
def test_assign_value_to_unknown_filed(self, client: MLClient):
3291+
path = "./tests/test_configs/components/helloworld_component.yml"
3292+
component_func = load_component(source=path)
3293+
# Due to it will block ci with the tags of yaml when generating records, remove the tags here.
3294+
component_func.tags = {}
3295+
3296+
@dsl.pipeline()
3297+
def pipeline_func(input):
3298+
node = component_func(component_in_path=input)
3299+
node.unknown_field = input
3300+
3301+
pipeline_job: PipelineJob = pipeline_func(input=Input(path=path))
3302+
pipeline_job.settings.default_compute = "cpu-cluster"
3303+
job_res = client.jobs.create_or_update(job=pipeline_job, experiment_name="test_unknown_field")
3304+
assert job_res.jobs["node"].unknown_field == "${{parent.inputs.input}}"

0 commit comments

Comments
 (0)