mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-05 14:02:00 +02:00
Acceptance rows closed: - WriteLBA/SyncCache contract: code comments document write-back vs durability fence semantics - RF=2 stable identity: v2bridge always uses SetReplicaAddrs (preserves ServerID); blockcmd dispatcher also fixed to use setupPrimaryReplicationMulti; test asserts exact expected ReplicaID="vs-2" (not just non-empty) - Tests treating WriteLBA as commit: replica_read_test rewritten with SyncCache as durability fence - publish_healthy contract: 3 gate tests with hard assertions including gate 3 (PrimaryShipperConnected) - SetReplicaAddr deprecation warning added - WALShipper.ReplicaID() getter added for identity verification Test runner enhancements: - sw-test-runner suite command: build → deploy → run N scenarios in one invocation with --skip-deploy support - Suite YAML definitions for T6 Stage 0 and Stage 1 - deploy action: kill stale processes, clean dirs, cross-compile, upload - run-phase20-t6.ps1 PowerShell script (deprecated by suite command) Engine/runtime fixes: - Recovery executor nil-safety improvements - Recovery bundle BuildRecoveryBundle defensive checks - ShipperGroup MinReplicaFlushedLSNAll surface Docs: acceptance checklist refined, test matrix updated, T6 runbook, engine maintainer tutorial, design README updated. 26 files changed, ~1600 insertions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
53 lines
1.1 KiB
Go
53 lines
1.1 KiB
Go
package testrunner
|
|
|
|
import "testing"
|
|
|
|
func TestParseSuite_Valid(t *testing.T) {
|
|
yaml := `
|
|
name: test-suite
|
|
topology:
|
|
nodes:
|
|
m01: {host: 192.168.1.1, user: test, key: /tmp/key}
|
|
deploy:
|
|
kill_ports: [9433]
|
|
binaries:
|
|
- local: weed-linux
|
|
remote: /opt/weed
|
|
scenarios:
|
|
- path: scenarios/test.yaml
|
|
id: T1
|
|
evidence:
|
|
save_to: results/test
|
|
`
|
|
suite, err := ParseSuite([]byte(yaml))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if suite.Name != "test-suite" {
|
|
t.Fatalf("name=%q", suite.Name)
|
|
}
|
|
if len(suite.Scenarios) != 1 {
|
|
t.Fatalf("scenarios=%d", len(suite.Scenarios))
|
|
}
|
|
if suite.Scenarios[0].ID != "T1" {
|
|
t.Fatalf("id=%q", suite.Scenarios[0].ID)
|
|
}
|
|
if len(suite.Deploy.KillPorts) != 1 || suite.Deploy.KillPorts[0] != 9433 {
|
|
t.Fatalf("kill_ports=%v", suite.Deploy.KillPorts)
|
|
}
|
|
}
|
|
|
|
func TestParseSuite_MissingName(t *testing.T) {
|
|
_, err := ParseSuite([]byte(`scenarios: [{path: x.yaml}]`))
|
|
if err == nil {
|
|
t.Fatal("expected error for missing name")
|
|
}
|
|
}
|
|
|
|
func TestParseSuite_NoScenarios(t *testing.T) {
|
|
_, err := ParseSuite([]byte(`name: empty`))
|
|
if err == nil {
|
|
t.Fatal("expected error for no scenarios")
|
|
}
|
|
}
|