Skip to content

Add optional auto-advance controls for workflow test runtimes#1485

Merged
steve-the-edwards merged 3 commits intomainfrom
test-api-refinements
Mar 13, 2026
Merged

Add optional auto-advance controls for workflow test runtimes#1485
steve-the-edwards merged 3 commits intomainfrom
test-api-refinements

Conversation

@steve-the-edwards
Copy link
Copy Markdown
Contributor

@steve-the-edwards steve-the-edwards commented Mar 13, 2026

Summary

  • add autoAdvanceOnStartup to WorkflowTestParams (default true) so startup scheduler draining can be disabled when tests need to assert initial UI first
  • add autoAdvanceBeforeAwait and autoAdvanceBeforeHasCheck to WorkflowTestParams (both default true) to control scheduler draining behavior in deprecated launchForTesting* runtimes
  • add per-call advanceScheduler parameters to awaitNextRendering, awaitNextOutput, and awaitNextSnapshot on WorkflowTestRuntime
  • plumb autoAdvanceBeforeAwait into WorkflowTurbine.awaitNext* defaults, which deprecated launch wrappers now use under the hood
  • add coverage in DeprecatedLaunchSchedulerModeTest for startup, await, and has-check auto-advance control paths
  • update the workflow-testing API dump

Purpose

The value of all of this is to minimize the churn needed to migrate to use this updated version of the API in client tests.

Validation

  • ./gradlew :workflow-testing:ktlintCheck
  • ./gradlew :workflow-testing:test --tests com.squareup.workflow1.testing.DeprecatedLaunchSchedulerModeTest --tests com.squareup.workflow1.testing.WorkflowTurbineTest --tests com.squareup.workflow1.testing.WorkflowTestRuntimeTest :workflow-testing:apiDump

@steve-the-edwards steve-the-edwards changed the title Add optional startup auto-advance control for workflow tests Add optional auto-advance controls for workflow test runtimes Mar 13, 2026
@steve-the-edwards steve-the-edwards marked this pull request as ready for review March 13, 2026 19:11
@steve-the-edwards steve-the-edwards merged commit 4e29f86 into main Mar 13, 2026
77 checks passed
@steve-the-edwards steve-the-edwards deleted the test-api-refinements branch March 13, 2026 19:16
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.

1 participant