Skip to content

Migrate Parametrized Tests to Burst #1354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: sedwards/compose-dispatcher
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions workflow-core/api/workflow-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,23 @@ public final class com/squareup/workflow1/RuntimeConfigOptions$Companion {
public final fun getRENDER_PER_ACTION ()Ljava/util/Set;
}

public final class com/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions : java/lang/Enum {
public static final field CONFLATE Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static final field DEFAULT Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static final field RENDER_ONLY Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static final field RENDER_ONLY_CONFLATE Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static final field RENDER_ONLY_CONFLATE_PARTIAL Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static final field RENDER_ONLY_CONFLATE_PARTIAL_STABLE Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static final field RENDER_ONLY_CONFLATE_STABLE Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static final field RENDER_ONLY_PARTIAL Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static final field RENDER_ONLY_PARTIAL_STABLE Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static final field STABLE Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getRuntimeConfig ()Ljava/util/Set;
public static fun valueOf (Ljava/lang/String;)Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
public static fun values ()[Lcom/squareup/workflow1/RuntimeConfigOptions$Companion$RuntimeOptions;
}

public abstract class com/squareup/workflow1/SessionWorkflow : com/squareup/workflow1/StatefulWorkflow {
public fun <init> ()V
public final fun initialState (Ljava/lang/Object;Lcom/squareup/workflow1/Snapshot;)Ljava/lang/Object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ public enum class RuntimeConfigOptions {
*/
@WorkflowExperimentalRuntime
STABLE_EVENT_HANDLERS,

// /**
// * If we have more actions to process that are queued on nodes not affected by the last
// * action application, then we will continue to process those actions before another render
// * pass.
// */
// @WorkflowExperimentalRuntime
// DRAIN_EXCLUSIVE_ACTIONS,
;

public companion object {
Expand All @@ -82,5 +90,77 @@ public enum class RuntimeConfigOptions {
*/
@WorkflowExperimentalRuntime
public val ALL: RuntimeConfig = entries.toSet()

/**
* Enum of all reasonable config options. Used especially for parameterized testing.
*/
@WorkflowExperimentalRuntime
enum class RuntimeOptions(
val runtimeConfig: RuntimeConfig
) {
DEFAULT(RENDER_PER_ACTION),
RENDER_ONLY(setOf(RENDER_ONLY_WHEN_STATE_CHANGES)),
CONFLATE(setOf(CONFLATE_STALE_RENDERINGS)),
STABLE(setOf(STABLE_EVENT_HANDLERS)),

// DEA(setOf(DRAIN_EXCLUSIVE_ACTIONS)),
RENDER_ONLY_CONFLATE(setOf(RENDER_ONLY_WHEN_STATE_CHANGES, CONFLATE_STALE_RENDERINGS)),
RENDER_ONLY_PARTIAL(setOf(RENDER_ONLY_WHEN_STATE_CHANGES, PARTIAL_TREE_RENDERING)),

// RENDER_ONLY_DEA(setOf(RENDER_ONLY_WHEN_STATE_CHANGES, DRAIN_EXCLUSIVE_ACTIONS)),
RENDER_ONLY_CONFLATE_STABLE(
setOf(RENDER_ONLY_WHEN_STATE_CHANGES, CONFLATE_STALE_RENDERINGS, STABLE_EVENT_HANDLERS)
),
RENDER_ONLY_CONFLATE_PARTIAL(
setOf(RENDER_ONLY_WHEN_STATE_CHANGES, CONFLATE_STALE_RENDERINGS, PARTIAL_TREE_RENDERING)
),

// RENDER_ONLY_CONFLATE_DEA(
// setOf(RENDER_ONLY_WHEN_STATE_CHANGES, CONFLATE_STALE_RENDERINGS, DRAIN_EXCLUSIVE_ACTIONS)
// ),
RENDER_ONLY_PARTIAL_STABLE(
setOf(RENDER_ONLY_WHEN_STATE_CHANGES, PARTIAL_TREE_RENDERING, STABLE_EVENT_HANDLERS)
),

// RENDER_ONLY_PARTIAL_DEA(
// setOf(RENDER_ONLY_WHEN_STATE_CHANGES, PARTIAL_TREE_RENDERING, DRAIN_EXCLUSIVE_ACTIONS)
// ),
// RENDER_ONLY_DEA_STABLE(
// setOf(RENDER_ONLY_WHEN_STATE_CHANGES, DRAIN_EXCLUSIVE_ACTIONS, STABLE_EVENT_HANDLERS)
// ),
RENDER_ONLY_CONFLATE_PARTIAL_STABLE(
setOf(
RENDER_ONLY_WHEN_STATE_CHANGES,
CONFLATE_STALE_RENDERINGS,
PARTIAL_TREE_RENDERING,
STABLE_EVENT_HANDLERS,
)
),
// RENDER_ONLY_CONFLATE_PARTIAL_DEA(
// setOf(
// RENDER_ONLY_WHEN_STATE_CHANGES,
// CONFLATE_STALE_RENDERINGS,
// PARTIAL_TREE_RENDERING,
// DRAIN_EXCLUSIVE_ACTIONS,
// )
// ),
// RENDER_ONLY_PARTIAL_STABLE_DEA(
// setOf(
// RENDER_ONLY_WHEN_STATE_CHANGES,
// PARTIAL_TREE_RENDERING,
// STABLE_EVENT_HANDLERS,
// DRAIN_EXCLUSIVE_ACTIONS,
// )
// ),
// RENDER_ONLY_CONFLATE_PARTIAL_STABLE_DEA(
// setOf(
// RENDER_ONLY_WHEN_STATE_CHANGES,
// CONFLATE_STALE_RENDERINGS,
// PARTIAL_TREE_RENDERING,
// STABLE_EVENT_HANDLERS,
// DRAIN_EXCLUSIVE_ACTIONS,
// )
// ),
}
}
}
1 change: 1 addition & 0 deletions workflow-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import com.squareup.workflow1.buildsrc.iosWithSimulatorArm64
plugins {
id("kotlin-multiplatform")
id("published")
id("app.cash.burst")
}

kotlin {
Expand Down
Loading