.NET API
TraceStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the ITraceStore contract.
public abstract class TraceStoreContract : TenantIsolationContract<ITraceStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<ITraceStore> ← TraceStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<ITraceStore>.TenantA, TenantIsolationContract<ITraceStore>.TenantB, TenantIsolationContract<ITraceStore>.CreateStoreAsync(), TenantIsolationContract<ITraceStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<ITraceStore>.InitializeAsync(), TenantIsolationContract<ITraceStore>.DisposeAsync(), TenantIsolationContract<ITraceStore>.OnDisposeAsync(), TenantIsolationContract<ITraceStore>.SeedAsync(string, string), TenantIsolationContract<ITraceStore>.ExistsAsync(string, object), TenantIsolationContract<ITraceStore>.CountAsync(string), TenantIsolationContract<ITraceStore>.TryDeleteAsync(string, object), TenantIsolationContract<ITraceStore>.TryOverwriteAsync(string, string), TenantIsolationContract<ITraceStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<ITraceStore>.Tenant_reads_its_own_record(), TenantIsolationContract<ITraceStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<ITraceStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<ITraceStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<ITraceStore>.AmbientTenant, TenantIsolationContract<ITraceStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Because span ids are derived from W3C ids, writing the same span twice must not produce a duplicate record; every implementation must satisfy this rule.
Constructors
Section titled “Constructors”TraceStoreContract()
Section titled “ TraceStoreContract()”protected TraceStoreContract()Properties
Section titled “Properties”TenantId
Section titled “ TenantId”The tenant spans are written under. The store reads its own tenant context; if the write and read tenants do not match, the trace can never be found. This is why the value comes from the same source as the ambient tenant.
protected string TenantId { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Attributes_are_preserved()
Section titled “ Attributes_are_preserved()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TraceStoreContract.cs", 105)]public Task Attributes_are_preserved()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.
Remarks
Section titled “Remarks”The span store has no listing endpoint; the count is reduced to how many of the runs seeded for that tenant are visible.
Empty_set_is_not_written()
Section titled “ Empty_set_is_not_written()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TraceStoreContract.cs", 153)]public Task Empty_set_is_not_written()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.
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.
Remarks
Section titled “Remarks”The write takes the tenant from the batch, the read from ITenantContext; if the two diverge, the trace can never be found.
SeedRunAsync(Guid)
Section titled “ SeedRunAsync(Guid)”Opens a run for spans to attach to.
protected abstract ValueTask SeedRunAsync(Guid runId)Parameters
Section titled “Parameters”runId Guid
The run id.
Returns
Section titled “Returns”A completed task.
Span_tree_round_trips()
Section titled “ Span_tree_round_trips()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TraceStoreContract.cs", 81)]public Task Span_tree_round_trips()Returns
Section titled “Returns”Unrecorded_run_returns_empty()
Section titled “ Unrecorded_run_returns_empty()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TraceStoreContract.cs", 149)]public Task Unrecorded_run_returns_empty()Returns
Section titled “Returns”Writing_the_same_span_twice_does_not_create_a_duplicate()
Section titled “ Writing_the_same_span_twice_does_not_create_a_duplicate()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/TraceStoreContract.cs", 130)]public Task Writing_the_same_span_twice_does_not_create_a_duplicate()