Skip to content

[Channel RFC] Conformance + Fault Injection test suite (Aevatar.GAgents.Channel.Testing) #264

@eanzhao

Description

@eanzhao

Parent RFC: #254

Scope

Conformance Suite + Fault Injection Suite —— 本 RFC 架构承诺的可执行契约。

Deliverables

Test infrastructure package:

  • test/Aevatar.GAgents.Channel.Testing(抽象基类库,不是 production code——放 test/ 不放 agents/)

Conformance base class (ChannelAdapterConformanceTests<TAdapter>):

public abstract class ChannelAdapterConformanceTests<TAdapter>
    where TAdapter : IChannelTransport, IChannelOutboundPort
{
    protected abstract TAdapter CreateAdapter();
    protected abstract WebhookFixture? WebhookFixture { get; }
    protected abstract GatewayFixture? GatewayFixture { get; }
    
    // 14 conformance tests — see RFC §8.1
}

Composer base class (MessageComposerUnitTests<TComposer>):

  • 6 composer unit tests — see RFC §8.2

Fault Injection Suite (ChannelAdapterFaultTests<TAdapter>) — RFC §8.3:

  • CommitCrashConsumeGap_BotStillExecutesActivityAfterRestart
  • Inbound_SamePayloadRetried_ProducesSameActivityId
  • Inbound_DuplicateFromPlatformRetry_DedupedExactlyOnce
  • Inbound_DuplicateFromConcurrentSilos_DedupedExactlyOnce
  • Gateway_ResumeInvalidated_FallsBackToIdentify
  • Gateway_PreStopMissing_DetectsEventGap
  • InboundStream_Saturation_TriggersBackpressureSignal
  • RawPayload_DoesNotLeakCredentials
  • EmitResult_ErrorMessage_DoesNotContainVendorRawBody
  • Streaming_DisposedWithoutComplete_MarksMessageInterrupted
  • Streaming_IntentDegradesMidway_ReachesTerminalState
  • Projector_TombstonedEntry_InvokesDispatcherDeleteAsync
  • Projector_LaggedBehindHousekeeping_DoesNotMissTombstone
  • Shard_DualSupervisor_OnlyLeaderWritesSessionState
  • ShardLeaderGrain_StaleWriteRejectedByLeaseEpoch
  • ShardLeaderGrain_LastSeqMonotonicallyIncreases
  • Dedup_AuthoritativeAtGrainNotAtPipeline_NoDoubleSideEffect
  • Send_BypassingTurnContext_UsesBotCredentialNotUser
  • DiscordInteraction_AckedButCommitCrashed_RecoveredFromJournal(defer to Discord sub issue)
  • StreamingHandle_IdempotentBySequenceNumber_NotByContent
  • WorkingBuffer_SaturationTimeout_DoesNotAdvanceInboxCheckpoint
  • RedactFailure_FailsClosed_NoCommit
  • ProactiveCommand_CredentialResolutionFailed_EmitsFailedEventPermanent
  • ProactiveCommand_TransientAdapterError_AllowsRetryBySameCommandId
  • ProactiveCommand_PermanentFailure_SetsNotRetryable
  • RedactorSustainedFailure_TripsBreakerWritesForensicQuarantine
  • QuarantineOverflow_DropsOldestAndAlerts
  • HealthCheckAsync_ThrowsOrTimesOut_TreatedAsUnhealthy
  • Cutover_HttpInflight_DrainsBeforeTermination
  • Cutover_BotTurnInflight_DrainsBeforeTermination

Per-adapter test projects:

  • test/Aevatar.GAgents.Channel.Lark.Tests(继承 ChannelAdapterConformanceTests<LarkChannelAdapter>
  • test/Aevatar.GAgents.Channel.Telegram.Tests(同)
  • test/Aevatar.GAgents.Channel.Runtime.Tests(runtime 单元测试)

Acceptance

  • Aevatar.GAgents.Channel.Testing 基类库 build 通过
  • Lark + Telegram 两个 adapter 过全部 conformance + composer + fault injection tests
  • CI integrates Suite pass 为 hard merge gate(Phase 3+ channel adapter 不过 Suite 不 merge)

References

  • RFC §8 Conformance Suite (§8.1 / §8.2 / §8.3)

Dependencies

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions