Wire SCUM schema probe durable run path
This commit is contained in:
@@ -119,6 +119,12 @@ func TestJobExecutionInputModelRoundTripPreservesLifecycleMetadata(t *testing.T)
|
||||
PluginID: "game.scum",
|
||||
Prerequisites: []domain.RuntimeServerPrerequisite{{Key: "steamcmd", Kind: "tool"}},
|
||||
},
|
||||
SQLiteSchemaProbe: &domain.SCUMSchemaProbeRequest{
|
||||
RequestID: "probe-1",
|
||||
JobID: "job-1",
|
||||
Binding: domain.SCUMBindingIdentity{ServerInstanceID: "server-1", RunBindingID: "runtime-binding-1", RunEndpointID: "run-1", PluginID: "game.scum", PluginVersion: "0.1.6", AdapterVersion: "adapter-1", DatabaseIdentity: "scum-database"},
|
||||
Bounds: domain.DefaultSCUMSchemaProbeBounds(),
|
||||
},
|
||||
}
|
||||
|
||||
row := executionInputFromDomain(source)
|
||||
@@ -130,8 +136,13 @@ func TestJobExecutionInputModelRoundTripPreservesLifecycleMetadata(t *testing.T)
|
||||
if row.Deployment == nil || row.Deployment.CreateInputs["maxPlayers"] != "128" {
|
||||
t.Fatalf("expected model deployment inputs to be isolated from source mutation, row=%+v", row.Deployment)
|
||||
}
|
||||
source.SQLiteSchemaProbe.Bounds.MaxObjects = 1
|
||||
if row.SQLiteSchemaProbe == nil || row.SQLiteSchemaProbe.Bounds.MaxObjects != domain.DefaultSCUMSchemaProbeBounds().MaxObjects {
|
||||
t.Fatalf("expected model schema probe to be isolated from source mutation, row=%+v", row.SQLiteSchemaProbe)
|
||||
}
|
||||
source.Inputs["playerId"] = "steam-123"
|
||||
source.Deployment.CreateInputs["maxPlayers"] = "128"
|
||||
source.SQLiteSchemaProbe.Bounds.MaxObjects = domain.DefaultSCUMSchemaProbeBounds().MaxObjects
|
||||
row.Inputs["playerId"] = "row-mutated"
|
||||
if source.Inputs["playerId"] != "steam-123" {
|
||||
t.Fatalf("expected source execution inputs to be isolated from model mutation, source=%+v", source.Inputs)
|
||||
@@ -140,8 +151,13 @@ func TestJobExecutionInputModelRoundTripPreservesLifecycleMetadata(t *testing.T)
|
||||
if source.Deployment.CreateInputs["maxPlayers"] != "128" {
|
||||
t.Fatalf("expected source deployment inputs to be isolated from model mutation, source=%+v", source.Deployment)
|
||||
}
|
||||
row.SQLiteSchemaProbe.Bounds.MaxObjects = 2
|
||||
if source.SQLiteSchemaProbe.Bounds.MaxObjects != domain.DefaultSCUMSchemaProbeBounds().MaxObjects {
|
||||
t.Fatalf("expected source schema probe to be isolated from model mutation, source=%+v", source.SQLiteSchemaProbe)
|
||||
}
|
||||
row.Inputs["playerId"] = "steam-123"
|
||||
row.Deployment.CreateInputs["maxPlayers"] = "128"
|
||||
row.SQLiteSchemaProbe.Bounds.MaxObjects = domain.DefaultSCUMSchemaProbeBounds().MaxObjects
|
||||
|
||||
roundTrip := row.ToDomain()
|
||||
if !reflect.DeepEqual(roundTrip, source) {
|
||||
@@ -149,7 +165,8 @@ func TestJobExecutionInputModelRoundTripPreservesLifecycleMetadata(t *testing.T)
|
||||
}
|
||||
roundTrip.Inputs["playerId"] = "mutated"
|
||||
roundTrip.Deployment.CreateInputs["maxPlayers"] = "16"
|
||||
if source.Inputs["playerId"] != "steam-123" || row.Inputs["playerId"] != "steam-123" || source.Deployment.CreateInputs["maxPlayers"] != "128" || row.Deployment.CreateInputs["maxPlayers"] != "128" {
|
||||
roundTrip.SQLiteSchemaProbe.Bounds.MaxObjects = 3
|
||||
if source.Inputs["playerId"] != "steam-123" || row.Inputs["playerId"] != "steam-123" || source.Deployment.CreateInputs["maxPlayers"] != "128" || row.Deployment.CreateInputs["maxPlayers"] != "128" || source.SQLiteSchemaProbe.Bounds.MaxObjects != domain.DefaultSCUMSchemaProbeBounds().MaxObjects || row.SQLiteSchemaProbe.Bounds.MaxObjects != domain.DefaultSCUMSchemaProbeBounds().MaxObjects {
|
||||
t.Fatalf("expected execution inputs to round-trip without aliasing, source=%+v row=%+v", source, row)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user