test: expand server protocol scenario coverage
This commit is contained in:
+24
-3
@@ -64,8 +64,8 @@ type harness struct {
|
||||
out io.Writer
|
||||
}
|
||||
|
||||
var integrationSuites = []string{"sample", "store", "server-session"}
|
||||
var e2eScenarios = []string{"smoke", "script", "recovery", "all"}
|
||||
var integrationSuites = []string{"sample", "store", "server-session", "control", "client-agent"}
|
||||
var e2eScenarios = []string{"smoke", "interactive", "idempotency", "reconnect", "retention", "expiry-and-incidents", "script", "recovery", "all"}
|
||||
|
||||
func containsChoice(choices []string, value string) bool {
|
||||
for _, choice := range choices {
|
||||
@@ -231,6 +231,10 @@ func (h *harness) integration(ctx context.Context, args []string) error {
|
||||
suiteErr = h.runStoreSuite(ctx, current, *testCase)
|
||||
case "server-session":
|
||||
suiteErr = h.runServerSessionSuite(ctx, current, *testCase)
|
||||
case "control":
|
||||
suiteErr = h.runGoSuite(ctx, current, "control-real-grpc", "running gRPC control and JSON-RPC compatibility cases", "./internal/server/control", *testCase)
|
||||
case "client-agent":
|
||||
suiteErr = h.runGoSuite(ctx, current, "client-agent-real-websocket", "running real client/server WebSocket control-flow cases", "./test/integration/clientagent", *testCase)
|
||||
}
|
||||
if suiteErr != nil {
|
||||
_ = h.transition(current, "failed", *suite+"-failed", suiteErr.Error())
|
||||
@@ -306,7 +310,7 @@ func (h *harness) e2e(ctx context.Context, args []string) error {
|
||||
}
|
||||
scenarios := []string{*scenario}
|
||||
if *scenario == "all" {
|
||||
scenarios = []string{"smoke", "script", "recovery"}
|
||||
scenarios = []string{"smoke", "interactive", "idempotency", "reconnect", "retention", "expiry-and-incidents", "script", "recovery"}
|
||||
}
|
||||
for _, item := range scenarios {
|
||||
if err := h.runE2EScenario(ctx, current, item, *testCase); err != nil {
|
||||
@@ -325,6 +329,16 @@ func (h *harness) runE2EScenario(ctx context.Context, current *manifest, scenari
|
||||
switch scenario {
|
||||
case "smoke":
|
||||
err = h.runGoSuite(ctx, current, "e2e-client-agent", "real client/server WebSocket and control flow", "./test/integration/clientagent", testCase)
|
||||
case "interactive":
|
||||
err = h.runGoSuite(ctx, current, "e2e-stdin-protocol", "durable stdin append, replay, close, and acknowledgement flow", "./test/integration/clientagent", chooseTestCase(testCase, "^TestControlStdinIntentReplaysAndAcknowledges_HP_DISPATCH_08$"))
|
||||
case "idempotency":
|
||||
err = h.runGoSuite(ctx, current, "e2e-request-idempotency", "request UUID replay and immutable request-hash conflict handling", "./internal/server/control", chooseTestCase(testCase, "^TestRunCommandRequestIDIdempotencyAndValidation_BH_CONTROL_02$"))
|
||||
case "reconnect":
|
||||
err = h.runGoSuite(ctx, current, "e2e-reconnect-reconciliation", "WebSocket reconciliation, fenced dispatch, and session wake handling", "./test/integration/clientagent", chooseTestCase(testCase, "^(TestWebSocketHelloWelcome_HP_SES_06|TestWebSocketDispatchAfterReconciliation_HP_DISPATCH_03|TestControlQueueWakesReconciledSession_HP_DISPATCH_06)$"))
|
||||
case "retention":
|
||||
err = h.runStoreSuite(ctx, current, chooseTestCase(testCase, "^(TestTerminalAgeRetentionEvictsWholeCommand_HP_STORE_08|TestTombstoneFIFOIsCappedInEvictionTransaction_HP_STORE_09|TestRetentionCrashStagesRollForward_CRASH_STORE_04)$"))
|
||||
case "expiry-and-incidents":
|
||||
err = h.runStoreSuite(ctx, current, chooseTestCase(testCase, "^(TestIncidentDirtyResolutionIdempotencyAndRecurrence_HP_STORE_11|TestIrreparableIncidentRequiresExplicitAcknowledgement_BH_STORE_09|TestFilesystemFloorAndCounterMismatch_BH_STORE_08)$"))
|
||||
case "script":
|
||||
err = h.runGoSuite(ctx, current, "e2e-script-transfer", "durable script transfer and replay", "./internal/client/agent", testCase)
|
||||
case "recovery":
|
||||
@@ -338,6 +352,13 @@ func (h *harness) runE2EScenario(ctx context.Context, current *manifest, scenari
|
||||
return h.appendJournal(current.RunID, journalEntry{At: h.now(), Step: "e2e-" + scenario, Status: "passed", Detail: "scenario passed"})
|
||||
}
|
||||
|
||||
func chooseTestCase(override, defaultCase string) string {
|
||||
if override != "" {
|
||||
return override
|
||||
}
|
||||
return defaultCase
|
||||
}
|
||||
|
||||
func (h *harness) runStoreSuite(ctx context.Context, current *manifest, testCase string) error {
|
||||
if err := h.appendJournal(current.RunID, journalEntry{At: h.now(), Step: "store-real-sqlite", Status: "running", Detail: "running real SQLite/WAL and filesystem cases"}); err != nil {
|
||||
return err
|
||||
|
||||
@@ -131,14 +131,14 @@ func TestStableSuiteAndScenarioListing_HP_CFG_01(t *testing.T) {
|
||||
if err := h.integration(context.Background(), []string{"--list"}); err != nil {
|
||||
t.Fatalf("list integration suites: %v", err)
|
||||
}
|
||||
if got, want := output.String(), "integration suites:\nsample\nstore\nserver-session\n"; got != want {
|
||||
if got, want := output.String(), "integration suites:\nsample\nstore\nserver-session\ncontrol\nclient-agent\n"; got != want {
|
||||
t.Fatalf("integration list = %q, want %q", got, want)
|
||||
}
|
||||
output.Reset()
|
||||
if err := h.e2e(context.Background(), []string{"--list"}); err != nil {
|
||||
t.Fatalf("list e2e scenarios: %v", err)
|
||||
}
|
||||
if got, want := output.String(), "e2e scenarios:\nsmoke\nscript\nrecovery\nall\n"; got != want {
|
||||
if got, want := output.String(), "e2e scenarios:\nsmoke\ninteractive\nidempotency\nreconnect\nretention\nexpiry-and-incidents\nscript\nrecovery\nall\n"; got != want {
|
||||
t.Fatalf("e2e list = %q, want %q", got, want)
|
||||
}
|
||||
if err := h.integration(context.Background(), []string{"--suite", "store", "--case", "["}); err == nil {
|
||||
|
||||
Reference in New Issue
Block a user