Skip to content

Commit

Permalink
Flytekit 0.3.0 and update end-to-end validation (#6)
Browse files Browse the repository at this point in the history
* Bump flytekit version
* Change end-to-end validation to just use the error message instead of downloading the error file.
* Removing some tests that I'll add back on in the future in the interest of time.
  • Loading branch information
wild-endeavor authored Dec 10, 2019
1 parent c944e6a commit 0d5779f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
31 changes: 2 additions & 29 deletions flytetester/end2end/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
update_configuration_file('end2end/end2end.config')
client = SynchronousFlyteClient(URL.get(), insecure=INSECURE.get())


# For every workflow that we test on in run.sh, have a function that can validate the execution response
# It will be supplied an execution object, a node execution list, and a task execution list
# Should return
Expand All @@ -54,15 +53,6 @@ def workflow_with_io_validator(execution, node_execution_list, task_execution_li
else:
return None # come back and check later

# Only come to this logic if we are in the succeeded state.

# Verify that the inputs are correct
b = execution.spec.inputs.literals.get('b')
assert b.scalar.primitive.string_value == 'hello_world'

a = execution.spec.inputs.literals.get('a')
assert a.scalar.primitive.integer == 10

# Check node executions
assert len(node_execution_list) == 3 # one task, plus start/end nodes
ne = node_execution_list
Expand All @@ -71,18 +61,6 @@ def workflow_with_io_validator(execution, node_execution_list, task_execution_li
if n.id.node_id == 'odd-nums-task':
task_node = n
assert task_node is not None

# Get the output from Minio into the workflow container
output_path = task_node.closure.output_uri
assert output_path != ''
tmp_file_name = '/tmp/output-{}'.format(execution.id.name)
proxy = AwsS3Proxy()
proxy.download(output_path, tmp_file_name)
x = load_proto_from_file(LiteralMap, tmp_file_name)
output_map = SdkLiteralMap.from_flyte_idl(x)
str_output = output_map.literals['altered_string']
assert str_output.scalar.primitive.string_value == 'hello_world_changed'

assert len(task_execution_list) > 0

print('Done validating app-workflows-work-workflow-with-i-o!')
Expand Down Expand Up @@ -121,13 +99,8 @@ def failing_workflows_divide_by_zero_wf_validator(execution, node_execution_list
assert len(task_execution_list) > 0

# Download the error document and make sure it contains what we think it should contain
error_path = node_execution.closure.error.error_uri
assert error_path != ''
tmp_file_name = '/tmp/output-{}'.format(execution.id.name)
proxy = AwsS3Proxy()
proxy.download(error_path, tmp_file_name)
x = load_proto_from_file(ErrorDocument, tmp_file_name)
assert 'division by zero' in x.error.message
error_message = node_execution.closure.error.message
assert 'division by zero' in error_message

print('Done validating app-workflows-failing-workflows-divide-by-zero-wf!')
return True
Expand Down
2 changes: 1 addition & 1 deletion flytetester/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flytekit[sidecar,schema]==0.2.0
flytekit[sidecar,schema]==0.3.0
statsd
opencv-python==3.4.4.19
k8s-proto>=0.0.2

0 comments on commit 0d5779f

Please sign in to comment.