.NET API
ExperimentStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IExperimentStore contract.
public abstract class ExperimentStoreContract : TenantIsolationContract<IExperimentStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<IExperimentStore> ← ExperimentStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<IExperimentStore>.TenantA, TenantIsolationContract<IExperimentStore>.TenantB, TenantIsolationContract<IExperimentStore>.CreateStoreAsync(), TenantIsolationContract<IExperimentStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IExperimentStore>.InitializeAsync(), TenantIsolationContract<IExperimentStore>.DisposeAsync(), TenantIsolationContract<IExperimentStore>.OnDisposeAsync(), TenantIsolationContract<IExperimentStore>.SeedAsync(string, string), TenantIsolationContract<IExperimentStore>.ExistsAsync(string, object), TenantIsolationContract<IExperimentStore>.CountAsync(string), TenantIsolationContract<IExperimentStore>.TryDeleteAsync(string, object), TenantIsolationContract<IExperimentStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IExperimentStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IExperimentStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IExperimentStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IExperimentStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IExperimentStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IExperimentStore>.AmbientTenant, TenantIsolationContract<IExperimentStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”These tests run for every implementation. A behavior difference between the in-memory store and the PostgreSQL store is a bug; this class catches that difference.
Constructors
Section titled “Constructors”ExperimentStoreContract()
Section titled “ ExperimentStoreContract()”protected ExperimentStoreContract()Methods
Section titled “Methods”Canary_policy_can_be_set_on_a_draft_experiment_too()
Section titled “ Canary_policy_can_be_set_on_a_draft_experiment_too()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 194)]public Task Canary_policy_can_be_set_on_a_draft_experiment_too()Returns
Section titled “Returns”Canary_policy_is_cleared_with_null()
Section titled “ Canary_policy_is_cleared_with_null()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 182)]public Task Canary_policy_is_cleared_with_null()Returns
Section titled “Returns”Canary_policy_is_set_and_read_back()
Section titled “ Canary_policy_is_set_and_read_back()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 166)]public Task Canary_policy_is_set_and_read_back()Returns
Section titled “Returns”Canary_ramp_is_rejected_on_a_non_running_experiment()
Section titled “ Canary_ramp_is_rejected_on_a_non_running_experiment()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 237)]public Task Canary_ramp_is_rejected_on_a_non_running_experiment()Returns
Section titled “Returns”Canary_ramp_updates_weights_on_a_running_experiment_and_stays_Running()
Section titled “ Canary_ramp_updates_weights_on_a_running_experiment_and_stays_Running()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 219)]public Task Canary_ramp_updates_weights_on_a_running_experiment_and_stays_Running()Returns
Section titled “Returns”CountAsync(string)
Section titled “ CountAsync(string)”Reports how many records the given tenant sees through the listing endpoint.
protected override ValueTask<int> CountAsync(string tenantId)Parameters
Section titled “Parameters”tenantId string
The reading tenant.
Returns
Section titled “Returns”The number of records seen.
Deleting_nonexistent_experiment_returns_false()
Section titled “ Deleting_nonexistent_experiment_returns_false()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 147)]public Task Deleting_nonexistent_experiment_returns_false()Returns
Section titled “Returns”Draft_experiment_can_be_deleted()
Section titled “ Draft_experiment_can_be_deleted()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 138)]public Task Draft_experiment_can_be_deleted()Returns
Section titled “Returns”Draft_experiment_can_be_updated()
Section titled “ Draft_experiment_can_be_updated()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 46)]public Task Draft_experiment_can_be_updated()Returns
Section titled “Returns”ExistsAsync(string, object)
Section titled “ ExistsAsync(string, object)”Reports whether the record is visible from the given tenant’s viewpoint.
protected override ValueTask<bool> ExistsAsync(string tenantId, object key)Parameters
Section titled “Parameters”tenantId string
The reading tenant.
key object
The key returned by TenantIsolationContract.SeedAsync.
Returns
Section titled “Returns”true if the record is visible.
Experiment_lifecycle_does_not_leak_across_tenants()
Section titled “ Experiment_lifecycle_does_not_leak_across_tenants()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 322)]public Task Experiment_lifecycle_does_not_leak_across_tenants()Returns
Section titled “Returns”ListRunningWithCanaryAsync_returns_only_running_experiments_with_canary_defined()
Section titled “ ListRunningWithCanaryAsync_returns_only_running_experiments_with_canary_defined()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 274)]public Task ListRunningWithCanaryAsync_returns_only_running_experiments_with_canary_defined()Returns
Section titled “Returns”Listing_returns_only_that_tenant()
Section titled “ Listing_returns_only_that_tenant()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 151)]public Task Listing_returns_only_that_tenant()Returns
Section titled “Returns”Non_running_experiment_cannot_be_stopped()
Section titled “ Non_running_experiment_cannot_be_stopped()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 117)]public Task Non_running_experiment_cannot_be_stopped()Returns
Section titled “Returns”Nonexistent_experiment_cannot_be_started()
Section titled “ Nonexistent_experiment_cannot_be_started()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 125)]public Task Nonexistent_experiment_cannot_be_started()Returns
Section titled “Returns”Returns_null_when_no_experiment_is_running()
Section titled “ Returns_null_when_no_experiment_is_running()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 162)]public Task Returns_null_when_no_experiment_is_running()Returns
Section titled “Returns”Rollback_stops_the_experiment_restores_weights_and_records_the_reason()
Section titled “ Rollback_stops_the_experiment_restores_weights_and_records_the_reason()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 251)]public Task Rollback_stops_the_experiment_restores_weights_and_records_the_reason()Returns
Section titled “Returns”Running_experiment_cannot_be_deleted()
Section titled “ Running_experiment_cannot_be_deleted()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 129)]public Task Running_experiment_cannot_be_deleted()Returns
Section titled “Returns”Running_experiment_cannot_be_updated()
Section titled “ Running_experiment_cannot_be_updated()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 63)]public Task Running_experiment_cannot_be_updated()Returns
Section titled “Returns”Save_and_get_round_trips()
Section titled “ Save_and_get_round_trips()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 33)]public Task Save_and_get_round_trips()Returns
Section titled “Returns”Second_start_for_same_agent_is_rejected()
Section titled “ Second_start_for_same_agent_is_rejected()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 87)]public Task Second_start_for_same_agent_is_rejected()Returns
Section titled “Returns”SeedAsync(string, string)
Section titled “ SeedAsync(string, string)”Writes a sample record for the given tenant.
protected override ValueTask<object> SeedAsync(string tenantId, string name)Parameters
Section titled “Parameters”tenantId string
The tenant that owns the record.
name string
The name distinguishing the record. The same name may be used by two tenants.
Returns
Section titled “Returns”The key to use for reading the record back.
Setting_canary_policy_is_EXEMPT_from_the_draft_only_edit_restriction()
Section titled “ Setting_canary_policy_is_EXEMPT_from_the_draft_only_edit_restriction()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 206)]public Task Setting_canary_policy_is_EXEMPT_from_the_draft_only_edit_restriction()Returns
Section titled “Returns”Starting_returns_the_running_experiment()
Section titled “ Starting_returns_the_running_experiment()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 72)]public Task Starting_returns_the_running_experiment()Returns
Section titled “Returns”Stopping_stops_the_experiment_and_frees_the_running_slot()
Section titled “ Stopping_stops_the_experiment_and_frees_the_running_slot()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ExperimentStoreContract.cs", 98)]public Task Stopping_stops_the_experiment_and_frees_the_running_slot()Returns
Section titled “Returns”TryDeleteAsync(string, object)
Section titled “ TryDeleteAsync(string, object)”Attempts to delete the record on behalf of the given tenant.
protected override ValueTask<bool?> TryDeleteAsync(string tenantId, object key)Parameters
Section titled “Parameters”tenantId string
The tenant attempting the delete.
key object
The key returned by TenantIsolationContract.SeedAsync.
Returns
Section titled “Returns”true if the delete succeeded, false if the record was not found; null if the store does not offer deletion.