Skip to content

Commit faf8fc8

Browse files
committed
test
Signed-off-by: Kevin Su <pingsutw@apache.org>
1 parent 346fac1 commit faf8fc8

3 files changed

Lines changed: 31 additions & 109 deletions

File tree

.github/workflows/end2end.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/single-binary.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,3 @@ jobs:
246246
tags: ${{ steps.image-names.outputs.tags }}
247247
build-args: "FLYTE_SANDBOX_VERSION=${{ env.FLYTE_SANDBOX_VERSION }}"
248248
push: true
249-
250-
endtoend:
251-
name: End2End Test
252-
needs: [ build-and-push-sandbox-bundled-image ]
253-
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
254-
uses: ./.github/workflows/end2end.yml
255-
with:
256-
priorities: "P0"

boilerplate/flyte/end2end/run-tests.py

Lines changed: 31 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,19 @@
1717

1818

1919
def execute_workflow(
20-
remote: FlyteRemote,
21-
version,
22-
workflow_name,
23-
inputs,
24-
cluster_pool_name: Optional[str] = None,
25-
wait: bool = False,
20+
remote: FlyteRemote,
21+
version,
22+
workflow_name,
23+
inputs,
24+
cluster_pool_name: Optional[str] = None,
2625
):
2726
print(f"Fetching workflow={workflow_name} and version={version}")
2827
wf = remote.fetch_workflow(name=workflow_name, version=version)
29-
print(f"Executing workflow={workflow_name} and version={version}")
30-
return remote.execute(wf, inputs=inputs, wait=wait, cluster_pool=cluster_pool_name)
28+
return remote.execute(wf, inputs=inputs, wait=False, cluster_pool=cluster_pool_name)
3129

3230

3331
def executions_finished(
34-
executions_by_wfgroup: Dict[str, List[FlyteWorkflowExecution]]
32+
executions_by_wfgroup: Dict[str, List[FlyteWorkflowExecution]]
3533
) -> bool:
3634
for executions in executions_by_wfgroup.values():
3735
if not all([execution.is_done for execution in executions]):
@@ -40,7 +38,7 @@ def executions_finished(
4038

4139

4240
def sync_executions(
43-
remote: FlyteRemote, executions_by_wfgroup: Dict[str, List[FlyteWorkflowExecution]]
41+
remote: FlyteRemote, executions_by_wfgroup: Dict[str, List[FlyteWorkflowExecution]]
4442
):
4543
try:
4644
for executions in executions_by_wfgroup.values():
@@ -60,13 +58,12 @@ def report_executions(executions_by_wfgroup: Dict[str, List[FlyteWorkflowExecuti
6058

6159

6260
def schedule_workflow_groups(
63-
tag: str,
64-
workflow_groups: List[str],
65-
remote: FlyteRemote,
66-
terminate_workflow_on_failure: bool,
67-
parsed_manifest: List[dict],
68-
cluster_pool_name: Optional[str] = None,
69-
parallel: bool = True,
61+
tag: str,
62+
workflow_groups: List[str],
63+
remote: FlyteRemote,
64+
terminate_workflow_on_failure: bool,
65+
parsed_manifest: List[dict],
66+
cluster_pool_name: Optional[str] = None,
7067
) -> Dict[str, bool]:
7168
"""
7269
Schedule workflows executions for all workflow groups and return True if all executions succeed, otherwise
@@ -84,14 +81,14 @@ def schedule_workflow_groups(
8481
if not workflows:
8582
continue
8683
executions_by_wfgroup[wf_group] = [
87-
execute_workflow(remote, tag, workflow[0], workflow[1], cluster_pool_name, not parallel)
84+
execute_workflow(remote, tag, workflow[0], workflow[1], cluster_pool_name)
8885
for workflow in workflows
8986
]
9087

9188
# Wait for all executions to finish
9289
attempt = 0
9390
while attempt == 0 or (
94-
not executions_finished(executions_by_wfgroup) and attempt < MAX_ATTEMPTS
91+
not executions_finished(executions_by_wfgroup) and attempt < MAX_ATTEMPTS
9592
):
9693
attempt += 1
9794
print(
@@ -133,14 +130,13 @@ def valid(workflow_group, parsed_manifest):
133130

134131

135132
def run(
136-
flytesnacks_release_tag: str,
137-
priorities: List[str],
138-
config_file_path,
139-
terminate_workflow_on_failure: bool,
140-
test_project_name: str,
141-
test_project_domain: str,
142-
cluster_pool_name: Optional[str] = None,
143-
parallel: bool = True,
133+
flytesnacks_release_tag: str,
134+
priorities: List[str],
135+
config_file_path,
136+
terminate_workflow_on_failure: bool,
137+
test_project_name: str,
138+
test_project_domain: str,
139+
cluster_pool_name: Optional[str] = None,
144140
) -> List[Dict[str, str]]:
145141
remote = FlyteRemote(
146142
Config.auto(config_file=config_file_path),
@@ -188,7 +184,6 @@ def run(
188184
terminate_workflow_on_failure,
189185
parsed_manifest,
190186
cluster_pool_name,
191-
parallel
192187
)
193188

194189
for workflow_group, succeeded in results_by_wfgroup.items():
@@ -248,28 +243,21 @@ def run(
248243
is_flag=False,
249244
help="Name of domain in project to run functional tests on",
250245
)
251-
@click.option(
252-
"--parallel",
253-
is_flag=True,
254-
default=False,
255-
help="Run tests in parallel if set to True",
256-
)
257246
@click.argument(
258247
"cluster_pool_name",
259248
required=False,
260249
type=str,
261250
default=None,
262251
)
263252
def cli(
264-
flytesnacks_release_tag,
265-
priorities,
266-
config_file,
267-
return_non_zero_on_failure,
268-
terminate_workflow_on_failure,
269-
test_project_name,
270-
test_project_domain,
271-
parallel,
272-
cluster_pool_name,
253+
flytesnacks_release_tag,
254+
priorities,
255+
config_file,
256+
return_non_zero_on_failure,
257+
terminate_workflow_on_failure,
258+
test_project_name,
259+
test_project_domain,
260+
cluster_pool_name,
273261
):
274262
print(f"return_non_zero_on_failure={return_non_zero_on_failure}")
275263
results = run(
@@ -280,7 +268,6 @@ def cli(
280268
test_project_name,
281269
test_project_domain,
282270
cluster_pool_name,
283-
parallel
284271
)
285272

286273
# Write a json object in its own line describing the result of this run to stdout

0 commit comments

Comments
 (0)