File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed
tests/unitary/default_setup/pipeline Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -519,6 +519,19 @@ def to_dict(self) -> dict:
519
519
dict_details ["spec" ][self .CONST_JOB_ID ] = self .job_id
520
520
if self .description :
521
521
dict_details ["spec" ][self .CONST_DESCRIPTION ] = self .description
522
+ if self .kind == "ML_JOB" :
523
+ if self .environment_variable :
524
+ dict_details ["spec" ][self .CONST_ENVIRONMENT_VARIABLES ] = (
525
+ self .environment_variable
526
+ )
527
+ if self .argument :
528
+ dict_details ["spec" ][self .CONST_COMMAND_LINE_ARGUMENTS ] = (
529
+ self .argument
530
+ )
531
+ if self .maximum_runtime_in_minutes :
532
+ dict_details ["spec" ][self .CONST_MAXIMUM_RUNTIME_IN_MINUTES ] = (
533
+ self .maximum_runtime_in_minutes
534
+ )
522
535
523
536
dict_details ["spec" ].pop (self .CONST_DEPENDS_ON , None )
524
537
Original file line number Diff line number Diff line change @@ -333,6 +333,11 @@ def test_pipeline_define(self):
333
333
"name" : "TestPipelineStepOne" ,
334
334
"jobId" : "TestJobIdOne" ,
335
335
"description" : "Test description one" ,
336
+ "commandLineArguments" : "ARGUMENT --KEY VALUE" ,
337
+ "environmentVariables" : {
338
+ "ENV" : "VALUE"
339
+ },
340
+ "maximumRuntimeInMinutes" : 20
336
341
},
337
342
},
338
343
{
@@ -1060,6 +1065,11 @@ def test_pipeline_to_dict(self):
1060
1065
"name" : "TestPipelineStepOne" ,
1061
1066
"jobId" : "TestJobIdOne" ,
1062
1067
"description" : "Test description one" ,
1068
+ "commandLineArguments" : "ARGUMENT --KEY VALUE" ,
1069
+ "environmentVariables" : {
1070
+ "ENV" : "VALUE"
1071
+ },
1072
+ "maximumRuntimeInMinutes" : 20
1063
1073
},
1064
1074
},
1065
1075
{
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ class DataSciencePipelineStepBaseTest(unittest.TestCase):
38
38
PipelineStep ("TestUpstreamPipelineStepOne" )
39
39
.with_description ("Test upstream pipeline step description one" )
40
40
.with_job_id ("TestJobIdOne" )
41
+ .with_environment_variable (** {"test_key" : "test_value" })
42
+ .with_maximum_runtime_in_minutes (20 )
43
+ .with_argument ("--key val path/to/file" )
41
44
)
42
45
43
46
upstream_pipeline_step_two = (
@@ -85,6 +88,11 @@ def test_pipeline_step_to_dict(self):
85
88
"name" : "TestUpstreamPipelineStepOne" ,
86
89
"jobId" : "TestJobIdOne" ,
87
90
"description" : "Test upstream pipeline step description one" ,
91
+ "environmentVariables" : {
92
+ "test_key" : "test_value"
93
+ },
94
+ "commandLineArguments" : "--key val path/to/file" ,
95
+ "maximumRuntimeInMinutes" : 20
88
96
},
89
97
}
90
98
You can’t perform that action at this time.
0 commit comments