Skip to content

Conversation

@zach-klippenstein
Copy link
Collaborator

It now throws an exception that looks just like the real runtime. This doesn't fail the test,
it errors it, which is also better behavior since this case means the workflow-under-test is
written incorrectly, not that it doesn't match expected test behavior. Fixes #120.

This change also cleans up the way WorkflowIdentifiers are described in error and testing strings,
unifies the impostor and non-impostor calls, makes the string consistent between runtime and tests,
and removes a method from the public API.

…ow/side effect is ran twice.

It now throws an exception that looks just like the real runtime. This doesn't _fail_ the test,
it _errors_ it, which is also better behavior since this case means the workflow-under-test is
written incorrectly, not that it doesn't match expected test behavior. Fixes #120.

This change also cleans up the way `WorkflowIdentifier`s are described in error and testing strings,
unifies the impostor and non-impostor calls, makes the string consistent between runtime and tests,
and removes a method from the public API.
@zach-klippenstein zach-klippenstein added this to the v1.0.0 milestone Jul 13, 2020
@zach-klippenstein zach-klippenstein requested a review from a team as a code owner July 13, 2020 23:03

public final class com/squareup/workflow1/WorkflowIdentifier {
public static final field Companion Lcom/squareup/workflow1/WorkflowIdentifier$Companion;
public final fun describeRealIdentifier ()Ljava/lang/String;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay one less public method!

proxiedIdentifiers
.joinToString { it.typeName }
.let { "WorkflowIdentifier($it)" }
description?.invoke()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First time I've seen an unambiguously good reason to use invoke()

@zach-klippenstein
Copy link
Collaborator Author

Both UI tests timed out. This has been happening more and more, we might need to increase the timeouts.

@zach-klippenstein zach-klippenstein merged commit 4a9d0e9 into main Jul 14, 2020
@zach-klippenstein zach-klippenstein deleted the zachklipp/fix-rendertester branch July 14, 2020 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RenderTester allows duplicate workflows to be rendered.

3 participants