From 6069c0f5ab52247a54e9ee5a38d302531cad240d Mon Sep 17 00:00:00 2001 From: Samhita Alla Date: Fri, 1 Dec 2023 22:18:13 +0530 Subject: [PATCH] search Signed-off-by: Samhita Alla --- flyte_tests_validate.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/flyte_tests_validate.py b/flyte_tests_validate.py index a0352b9cc..aa5f1e3ea 100644 --- a/flyte_tests_validate.py +++ b/flyte_tests_validate.py @@ -39,21 +39,18 @@ def get_commands(output): # Use the `pyflyte run` command to execute the workflow output_string = str(subprocess.run(["pyflyte", "run", file_name], capture_output=True, text=True).stdout) - print(output_string) - print(workflow) - print(workflow in output_string) - # Check if the workflow specified is present in the pyflyte run output - if workflow in output_string: + print(output_string.split()) + just_the_workflow = workflow.split(".")[2] + if just_the_workflow in output_string.split(): print("Workflow found in the pyflyte run output.") else: raise Exception("Workflow not found in the pyflyte run output.") # Check if the specified parameters are valid options_output = subprocess.run( - ["pyflyte", "run", file_name, workflow.split(".")[2], "--help"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + ["pyflyte", "run", file_name, just_the_workflow, "--help"], + capture_output=True, text=True, ).stdout