@@ -280,27 +280,26 @@ def test_submit_dft(self):
280280 self .cmd (f"az quantum workspace set -g { test_resource_group } -w { test_workspace_temp } -l { test_location } " )
281281
282282 # Run a "microsoft.dft" job to test that successful job returns proper output
283- results = self .cmd ("az quantum run -t microsoft.dft --job-input-format microsoft.xyz .v1 --job-output-format microsoft.dft-results.v1 --job-input-file src/quantum/azext_quantum/tests/latest/input_data/dft_molecule_success.xyz --job-params {{ \\ \" tasks \\ \" :[{{ \\ \" taskType \\ \" : \\ \" spe \\ \" , \\ \" basisSet \\ \" :{{ \\ \" name \\ \" : \\ \" def2-svp \\ \" , \\ \" cartesian \\ \" :false}}, \\ \" xcFunctional \\ \" :{{ \\ \" name \\ \" : \\ \" m06-2x \\ \" , \\ \" gridLevel \\ \" :4}}, \\ \" scf \\ \" :{{ \\ \" method \\ \" : \\ \" rks \\ \" , \\ \" maxSteps \\ \" :100, \\ \" convergeThreshold \\ \" :1e-8}}}}]}} -o json" ).get_output_in_json ()
283+ results = self .cmd ("az quantum run -t microsoft.dft --job-input-format microsoft.qc-schema .v1 --job-output-format microsoft.dft-results.v1 --job-input-file src/quantum/azext_quantum/tests/latest/input_data/dft_molecule_success.json -o json" ).get_output_in_json ()
284284 self .assertIsNotNone (results ["results" ])
285285 self .assertTrue (len (results ["results" ]) == 1 )
286286 self .assertTrue (results ["results" ][0 ]["success" ])
287287
288288 # Run a "microsoft.dft" job to test that failed run returns "Job"-object if job didn't produce any output
289289 # In the test case below the run doesn't produce any output since the job fails on input parameter validation (i.e. taskType: "invalidTask")
290- results = self .cmd ("az quantum run -t microsoft.dft --job-input-format microsoft.xyz.v1 --job-output-format microsoft.dft-results.v1 --job-input-file src/quantum/azext_quantum/tests/latest/input_data/dft_molecule_success.xyz --job-params {{\\ \" tasks\\ \" :[{{\\ \" taskType\\ \" :\\ \" invalidTask\\ \" ,\\ \" basisSet\\ \" :{{\\ \" name\\ \" :\\ \" def2-svp\\ \" ,\\ \" cartesian\\ \" :false}},\\ \" xcFunctional\\ \" :{{\\ \" name\\ \" :\\ \" m06-2x\\ \" ,\\ \" gridLevel\\ \" :4}},\\ \" scf\\ \" :{{\\ \" method\\ \" :\\ \" rks\\ \" ,\\ \" maxSteps\\ \" :100,\\ \" convergeThreshold\\ \" :1e-8}}}}]}} -o json" ).get_output_in_json ()
291- self .assertEqual ("Job" , results ["itemType" ]) # the object is a "Job"-object
292- self .assertEqual ("Failed" , results ["status" ])
293- self .assertIsNotNone (results ["errorData" ])
294- self .assertEqual ("InvalidInputData" , results ["errorData" ]["code" ])
295- self .assertEqual ("microsoft.dft" , results ["target" ])
290+ results = self .cmd ("az quantum run -t microsoft.dft --job-input-format microsoft.qc-schema.v1 --job-output-format microsoft.dft-results.v1 --job-input-file src/quantum/azext_quantum/tests/latest/input_data/dft_molecule_failure_bad_params.json -o json" ).get_output_in_json ()
291+ self .assertIsNotNone (results ["results" ])
292+ self .assertTrue (len (results ["results" ]) == 1 )
293+ self .assertFalse (results ["results" ][0 ]["success" ])
294+ self .assertTrue (results ["results" ][0 ]["error" ]["error_type" ] == "input_error" )
296295
297296 # Run a "microsoft.dft" job to test that failed run returns output if it was produced by the job
298297 # In the test case below the job fails to converge in "maxSteps", but it still produces the output with a detailed message
299- results = self .cmd ("az quantum run -t microsoft.dft --job-input-format microsoft.xyz.v1 --job-output-format microsoft.dft-results.v1 --job-input-file src/quantum/azext_quantum/tests/latest/input_data/dft_molecule_failure.xyz --job-params {{\\ \" tasks\\ \" :[{{\\ \" taskType\\ \" :\\ \" go\\ \" ,\\ \" basisSet\\ \" :{{\\ \" name\\ \" :\\ \" def2-tzvpp\\ \" ,\\ \" cartesian\\ \" :false}},\\ \" xcFunctional\\ \" :{{\\ \" name\\ \" :\\ \" m06-2x\\ \" ,\\ \" gridLevel\\ \" :4}},\\ \" scf\\ \" :{{\\ \" method\\ \" :\\ \" rks\\ \" ,\\ \" maxSteps\\ \" :5,\\ \" convergeThreshold\\ \" :1e-8}},\\ \" geometryOptimization\\ \" :{{\\ \" gdiis\\ \" :false}}}}]}} -o json" ).get_output_in_json ()
300- self .assertTrue ("itemType" not in results or results ["itemType" ] != "Job" ) # the object is not a "Job"-object
298+ results = self .cmd ("az quantum run -t microsoft.dft --job-input-format microsoft.qc-schema.v1 --job-output-format microsoft.dft-results.v1 --job-input-file src/quantum/azext_quantum/tests/latest/input_data/dft_molecule_failure_no_convergence.json -o json" ).get_output_in_json ()
301299 self .assertIsNotNone (results ["results" ])
302300 self .assertTrue (len (results ["results" ]) == 1 )
303301 self .assertFalse (results ["results" ][0 ]["success" ])
302+ self .assertTrue (results ["results" ][0 ]["error" ]["error_type" ] == "convergence_error" )
304303
305304 self .cmd (f'az quantum workspace delete -g { test_resource_group } -w { test_workspace_temp } ' )
306305
0 commit comments