feat: 清理openspec
This commit is contained in:
@@ -205,7 +205,6 @@ func TestCoreServiceRunHelloRejectsStalePackageKeyAfterReset(t *testing.T) {
|
||||
|
||||
func TestCoreServiceRunHelloRejectsGeneratedRunOnPromotedBuildEndpoint(t *testing.T) {
|
||||
svc, session, instance := newDistributionTestFixture(t)
|
||||
builderID := instance.RunEndpointID
|
||||
instance.State = domain.ServerInstanceStateFailed
|
||||
if err := svc.store.ServerInstances().Update(instance); err != nil {
|
||||
t.Fatalf("mark legacy server failed: %v", err)
|
||||
@@ -213,28 +212,28 @@ func TestCoreServiceRunHelloRejectsGeneratedRunOnPromotedBuildEndpoint(t *testin
|
||||
if _, err := svc.GenerateRunDistributionForSession(session, domain.RunDistributionGenerateRequest{ServerInstanceID: instance.ID, TargetOS: "windows", TargetArch: "amd64", IdempotencyKey: "promoted-hello-fence"}); err != nil {
|
||||
t.Fatalf("generate promoted Run: %v", err)
|
||||
}
|
||||
migrated, err := svc.GetServerInstance(instance.ID)
|
||||
if err != nil {
|
||||
t.Fatalf("get migrated server: %v", err)
|
||||
}
|
||||
key, plainKey, err := svc.ensureActiveComponentKey(instance.ID, domain.DistributionComponentRun, "")
|
||||
if err != nil {
|
||||
t.Fatalf("get component key: %v", err)
|
||||
}
|
||||
hello := validRunControlHello()
|
||||
hello.RunEndpointID = builderID
|
||||
hello.RunEndpointID = platformDistributionBuilderEndpointID
|
||||
hello.RegistrationToken = plainKey
|
||||
hello.ServerInstanceID = instance.ID
|
||||
hello.PluginID = instance.PluginID
|
||||
hello.ComponentKind = domain.DistributionComponentRun
|
||||
hello.KeyGeneration = key.Generation
|
||||
if _, err := svc.RegisterRunHello(hello); err == nil || !strings.Contains(err.Error(), "does not match") {
|
||||
if _, err := svc.RegisterRunHello(hello); err == nil || !strings.Contains(err.Error(), "platform distribution builder") {
|
||||
t.Fatalf("expected shared builder registration rejection, got %v", err)
|
||||
}
|
||||
|
||||
hello.RunEndpointID = migrated.RunEndpointID
|
||||
hello.RunEndpointID = generatedRunEndpointID(instance.ID)
|
||||
if result, err := svc.RegisterRunHello(hello); err != nil || !result.Accepted {
|
||||
t.Fatalf("expected dedicated Run registration acceptance, result=%+v err=%v", result, err)
|
||||
t.Fatalf("expected automatically discovered Run registration acceptance, result=%+v err=%v", result, err)
|
||||
}
|
||||
attached, err := svc.GetServerInstance(instance.ID)
|
||||
if err != nil || attached.RunEndpointID != hello.RunEndpointID {
|
||||
t.Fatalf("expected heartbeat to attach active Run endpoint, instance=%+v err=%v", attached, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user