From 82020042a9928f066b2fbb79cacc246060d075a3 Mon Sep 17 00:00:00 2001 From: taieeuu Date: Fri, 6 Dec 2024 21:14:18 +0800 Subject: [PATCH] fix: the reviewer suggestions Signed-off-by: taieeuu --- boilerplate/flyte/end2end/conftest.py | 2 +- boilerplate/flyte/end2end/test_run.py | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/boilerplate/flyte/end2end/conftest.py b/boilerplate/flyte/end2end/conftest.py index 90ff5cff65..d77fad05d9 100644 --- a/boilerplate/flyte/end2end/conftest.py +++ b/boilerplate/flyte/end2end/conftest.py @@ -44,4 +44,4 @@ def setup_flytesnacks_env(pytestconfig): "test_project_name": pytestconfig.getoption("--test_project_name"), "test_project_domain": pytestconfig.getoption("--test_project_domain"), "cluster_pool_name": pytestconfig.getoption("--cluster_pool_name"), - } \ No newline at end of file + } diff --git a/boilerplate/flyte/end2end/test_run.py b/boilerplate/flyte/end2end/test_run.py index d412a9c692..b300ee974a 100644 --- a/boilerplate/flyte/end2end/test_run.py +++ b/boilerplate/flyte/end2end/test_run.py @@ -136,10 +136,7 @@ def test_run(setup_flytesnacks_env): test_project_name, test_project_domain, ) - - # assert flytesnacks_release_tag == "v1.0.0" - # assert config_file_path == "/path/to/config.yaml" - + # For a given release tag and priority, this function filters the workflow groups from the flytesnacks # manifest file. For example, for the release tag "v0.2.224" and the priority "P0" it returns [ "core" ]. manifest_url = ( @@ -148,6 +145,7 @@ def test_run(setup_flytesnacks_env): ) r = requests.get(manifest_url) parsed_manifest = r.json() + workflow_groups = [] workflow_groups = ( ["lite"] if "lite" in priorities @@ -209,8 +207,11 @@ def test_run(setup_flytesnacks_env): print(f"Result of run:\n{json.dumps(results)}") if return_non_zero_on_failure: - for result in results: - if result["status"] not in ("passing", "coming soon"): - pytest.fail("Workflow execution failed") - - return results + fail_results = [result for result in results if result["status"] not in ("passing", "coming soon")] + if fail_results: + fail_msgs = [ + f"Workflow '{r['label']}' failed with status '{r['status']}'" for r in fail_results + ] + pytest.fail("\n".join(fail_msgs)) + + assert results == [{"label": "core", "status": "passing", "color": "green"}]