Skip to content

Commit

Permalink
Final fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudw committed Aug 19, 2024
1 parent d334e42 commit 98a2977
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions metaflow/plugins/aip/tests/flows/flow_triggering_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,13 @@ def start(self):
)

if self.trigger_enabled: # Upload pipeline
# for the case where generate_base64_uuid returns a string starting with '-'
# and template_name == 'wfdsk-ftf-test-he5d4--6rhai0z0wiysuew'
# where aip _create_workflow_yaml() calls sanitize_k8s_name() which returns
# 'wfdsk-ftf-test-he5d4-6rhai0z0wiysuew' without the double --

print(f"{KUBERNETES_NAMESPACE=}")
logger.info(f"{KUBERNETES_NAMESPACE=}")

self.workflow_template_names = [
sanitize_k8s_name(
f"{TEST_TEMPLATE_NAME}-{generate_base64_uuid()}".lower()
f"{TEST_TEMPLATE_NAME}-{current.run_id}-{index}".lower()
)
for _ in range(3)
for index in range(3)
]
self.parent_tag = "parent-workflow"
self.index_tag = "template-index"
Expand All @@ -87,7 +82,7 @@ def start(self):
"--tag",
f"{self.parent_tag}:{current.run_id}",
"--tag",
f"{self.index}:{template_index}",
f"{self.index_tag}:{template_index}",
],
)
subprocess.run(["cat", path])
Expand Down Expand Up @@ -126,7 +121,7 @@ def end(self):
and template["metadata"]["labels"].get(
f"metaflow.org/tag_{self.index_tag}"
)
== 1
== str(1) # All tags value are strings
),
)

Expand Down Expand Up @@ -164,11 +159,6 @@ def end(self):
metaflow_path = f"{current.flow_name}/{metaflow_run_id}/start"

_retry_sleep(self.assert_parent_workflow, metaflow_path=metaflow_path)

# ====== Clean up test templates ======
for template_name in self.workflow_template_names:
logger.info(f"Deleting {template_name}")
argo_helper.template_delete(template_name)
else:
logger.info(f"{self.trigger_enabled=}")

Expand Down

0 comments on commit 98a2977

Please sign in to comment.