Skip to content
Tracon

WorkflowDefinitionStoreContract

Namespace Tracon.Testing.Contracts.Storage · Assembly Tracon.Testing.Contracts.Xunit.dll

Behavior tests for the IWorkflowDefinitionStore contract.

public abstract class WorkflowDefinitionStoreContract : TenantIsolationContract<IWorkflowDefinitionStore>, IAsyncLifetime, IAsyncDisposable
Inheritance
object ← StoreCancellationContract<IWorkflowDefinitionStore> ← TenantIsolationContract<IWorkflowDefinitionStore> ← WorkflowDefinitionStoreContract
Implements
IAsyncLifetime, IAsyncDisposable
Inherited Members
TenantIsolationContract<IWorkflowDefinitionStore>.TenantA, TenantIsolationContract<IWorkflowDefinitionStore>.TenantB, TenantIsolationContract<IWorkflowDefinitionStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IWorkflowDefinitionStore>.SeedAsync(string, string, CancellationToken), TenantIsolationContract<IWorkflowDefinitionStore>.ExistsAsync(string, object), TenantIsolationContract<IWorkflowDefinitionStore>.CountAsync(string, CancellationToken), TenantIsolationContract<IWorkflowDefinitionStore>.TryDeleteAsync(string, object), TenantIsolationContract<IWorkflowDefinitionStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IWorkflowDefinitionStore>.CancellableReadAsync(CancellationToken), TenantIsolationContract<IWorkflowDefinitionStore>.CancellableWriteAsync(CancellationToken), TenantIsolationContract<IWorkflowDefinitionStore>.WroteAnythingAsync(), TenantIsolationContract<IWorkflowDefinitionStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IWorkflowDefinitionStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IWorkflowDefinitionStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IWorkflowDefinitionStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IWorkflowDefinitionStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IWorkflowDefinitionStore>.AmbientTenant, StoreCancellationContract<IWorkflowDefinitionStore>.CreateStoreAsync(), StoreCancellationContract<IWorkflowDefinitionStore>.InitializeAsync(), StoreCancellationContract<IWorkflowDefinitionStore>.DisposeAsync(), StoreCancellationContract<IWorkflowDefinitionStore>.OnDisposeAsync(), StoreCancellationContract<IWorkflowDefinitionStore>.CancellableReadAsync(CancellationToken), StoreCancellationContract<IWorkflowDefinitionStore>.CancellableWriteAsync(CancellationToken), StoreCancellationContract<IWorkflowDefinitionStore>.WroteAnythingAsync(), StoreCancellationContract<IWorkflowDefinitionStore>.Canceled_token_throws_on_read(), StoreCancellationContract<IWorkflowDefinitionStore>.The_write_this_contract_checks_can_be_read_back(), StoreCancellationContract<IWorkflowDefinitionStore>.Canceled_token_throws_on_write_and_leaves_no_trace(), StoreCancellationContract<IWorkflowDefinitionStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The in-memory store and the SQL stores must pass the same scenarios. In particular, version increment, version history and tenant isolation must behave identically in all of them.

protected WorkflowDefinitionStoreContract()

The fully qualified workflow_definition_versions table reference this provider’s raw SQL should use.

protected virtual string QualifiedWorkflowHistoryTable { get; }

string

The expression this provider’s raw SQL uses for “now” in a timestamp column.

protected virtual string RawNowExpression { get; }

string

Whether the backing state of this store can be reached with raw SQL (SQL providers only).

protected virtual bool SupportsRawHistory { get; }

bool

A_rollback_of_a_deleted_definition_creates_it_again_and_continues_the_numbering()

Section titled “ A_rollback_of_a_deleted_definition_creates_it_again_and_continues_the_numbering()”
[Fact]
public Task A_rollback_of_a_deleted_definition_creates_it_again_and_continues_the_numbering()

Task

A_rollback_to_a_version_that_does_not_exist_throws_and_writes_nothing()

Section titled “ A_rollback_to_a_version_that_does_not_exist_throws_and_writes_nothing()”
[Fact]
public Task A_rollback_to_a_version_that_does_not_exist_throws_and_writes_nothing()

Task

A_rollback_writes_the_old_content_as_a_new_version_and_moves_nothing()

Section titled “ A_rollback_writes_the_old_content_as_a_new_version_and_moves_nothing()”
[Fact]
public Task A_rollback_writes_the_old_content_as_a_new_version_and_moves_nothing()

Task

A_save_whose_history_write_fails_leaves_the_current_definition_as_it_was()

Section titled “ A_save_whose_history_write_fails_leaves_the_current_definition_as_it_was()”
[Fact]
public Task A_save_whose_history_write_fails_leaves_the_current_definition_as_it_was()

Task

A_version_or_a_history_that_does_not_exist_is_empty_not_an_error()

Section titled “ A_version_or_a_history_that_does_not_exist_is_empty_not_an_error()”
[Fact]
public Task A_version_or_a_history_that_does_not_exist_is_empty_not_an_error()

Task

Agent_version_pins_survive_the_round_trip()

Section titled “ Agent_version_pins_survive_the_round_trip()”
[Fact]
public Task Agent_version_pins_survive_the_round_trip()

Task

[Fact]
public Task All_fields_survive_the_round_trip()

Task

Another_tenant_neither_reads_nor_rolls_back_nor_numbers_with_this_tenants_history()

Section titled “ Another_tenant_neither_reads_nor_rolls_back_nor_numbers_with_this_tenants_history()”
[Fact]
public Task Another_tenant_neither_reads_nor_rolls_back_nor_numbers_with_this_tenants_history()

Task

Another_tenants_definition_is_not_visible()

Section titled “ Another_tenants_definition_is_not_visible()”
[Fact]
public Task Another_tenants_definition_is_not_visible()

Task

Concurrent_saves_of_one_name_get_distinct_versions_and_each_keeps_its_own_content()

Section titled “ Concurrent_saves_of_one_name_get_distinct_versions_and_each_keeps_its_own_content()”
[Fact]
public Task Concurrent_saves_of_one_name_get_distinct_versions_and_each_keeps_its_own_content()

Task

Reports how many records the given tenant sees through the listing endpoint.

protected override ValueTask<int> CountAsync(string tenantId, CancellationToken cancellationToken)

tenantId string

The reading tenant.

cancellationToken CancellationToken

The token every store call inside the hook must be handed; see TenantIsolationContract.SeedAsync.

ValueTask<int>

The number of records seen.

[Fact]
public Task Deleted_definition_is_not_read_back()

Task

Deleting_a_definition_that_does_not_exist_leaves_the_history_alone()

Section titled “ Deleting_a_definition_that_does_not_exist_leaves_the_history_alone()”
[Fact]
public Task Deleting_a_definition_that_does_not_exist_leaves_the_history_alone()

Task

Deleting_a_nonexistent_definition_returns_false()

Section titled “ Deleting_a_nonexistent_definition_returns_false()”
[Fact]
public Task Deleting_a_nonexistent_definition_returns_false()

Task

Deleting_keeps_the_history_and_the_numbering_continues_after_it()

Section titled “ Deleting_keeps_the_history_and_the_numbering_continues_after_it()”
[Fact]
public Task Deleting_keeps_the_history_and_the_numbering_continues_after_it()

Task

Every_field_of_a_definition_is_kept_by_the_version_it_was_saved_as()

Section titled “ Every_field_of_a_definition_is_kept_by_the_version_it_was_saved_as()”
[Fact]
public Task Every_field_of_a_definition_is_kept_by_the_version_it_was_saved_as()

Task

[Fact]
public Task Every_save_increments_the_version()

Task

Every_save_keeps_its_version_and_the_history_lists_them_newest_first()

Section titled “ Every_save_keeps_its_version_and_the_history_lists_them_newest_first()”
[Fact]
public Task Every_save_keeps_its_version_and_the_history_lists_them_newest_first()

Task

Runs raw SQL against the backing store. Only called when WorkflowDefinitionStoreContract.SupportsRawHistory is true.

protected virtual ValueTask ExecuteRawAsync(string sql)

sql string

ValueTask

Reports whether the record is visible from the given tenant’s viewpoint.

protected override ValueTask<bool> ExistsAsync(string tenantId, object key)

tenantId string

The reading tenant.

key object

The key returned by TenantIsolationContract.SeedAsync.

ValueTask<bool>

true if the record is visible.

Function_node_settings_survive_the_round_trip()

Section titled “ Function_node_settings_survive_the_round_trip()”
[Fact]
public Task Function_node_settings_survive_the_round_trip()

Task

[Fact]
public Task Incoming_version_value_is_ignored()

Task

[Fact]
public Task Listing_is_sorted_by_name()

Task

[Fact]
public Task Magentic_manager_name_is_preserved()

Task

[Fact]
public Task Node_list_survives_the_round_trip()

Task

Node_timeouts_and_the_run_timeout_survive_the_round_trip()

Section titled “ Node_timeouts_and_the_run_timeout_survive_the_round_trip()”
[Fact]
public Task Node_timeouts_and_the_run_timeout_survive_the_round_trip()

Task

Parameter_schema_survives_the_round_trip()

Section titled “ Parameter_schema_survives_the_round_trip()”
[Fact]
public Task Parameter_schema_survives_the_round_trip()

Task

Same_name_is_independent_across_tenants()

Section titled “ Same_name_is_independent_across_tenants()”
[Fact]
public Task Same_name_is_independent_across_tenants()

Task

[Fact]
public Task Saved_definition_is_read_back()

Task

Saving_again_without_node_settings_clears_them()

Section titled “ Saving_again_without_node_settings_clears_them()”
[Fact]
public Task Saving_again_without_node_settings_clears_them()

Task

Saving_again_without_timeouts_clears_them()

Section titled “ Saving_again_without_timeouts_clears_them()”
[Fact]
public Task Saving_again_without_timeouts_clears_them()

Task

SeedAsync(string, string, CancellationToken)

Section titled “ SeedAsync(string, string, CancellationToken)”

Writes a sample record for the given tenant.

protected override ValueTask<object> SeedAsync(string tenantId, string name, CancellationToken cancellationToken)

tenantId string

The tenant that owns the record.

name string

The name distinguishing the record. The same name may be used by two tenants.

cancellationToken CancellationToken

The token every store call inside the hook must be handed. The cancellation contract calls this hook with a token that is already cancelled, so a hook that drops the token reports a store as sound when it is not.

ValueTask<object>

The key to use for reading the record back.

The_new_members_refuse_a_cancelled_token_and_a_cancelled_rollback_leaves_no_trace()

Section titled “ The_new_members_refuse_a_cancelled_token_and_a_cancelled_rollback_leaves_no_trace()”
[Fact]
public Task The_new_members_refuse_a_cancelled_token_and_a_cancelled_rollback_leaves_no_trace()

Task

The_request_timeout_survives_the_round_trip()

Section titled “ The_request_timeout_survives_the_round_trip()”
[Fact]
public Task The_request_timeout_survives_the_round_trip()

Task

The_response_mode_survives_the_round_trip()

Section titled “ The_response_mode_survives_the_round_trip()”
[Fact]
public Task The_response_mode_survives_the_round_trip()

Task

Attempts to delete the record on behalf of the given tenant.

protected override ValueTask<bool?> TryDeleteAsync(string tenantId, object key)

tenantId string

The tenant attempting the delete.

key object

The key returned by TenantIsolationContract.SeedAsync.

ValueTask<bool?>

true if the delete succeeded, false if the record was not found; null if the store does not offer deletion.