feat: refactor to ymsctl & yms-daemon

This commit is contained in:
2026-08-17 02:10:10 +08:00
parent 7755da72e7
commit 79f18fcdea
23 changed files with 394 additions and 47 deletions
+20
View File
@@ -105,6 +105,26 @@ func TestStoreMigratesVersionOneAndCommitsBackendContainerDeployment(t *testing.
}
}
func TestListRecentScansSQLiteRequestTextAsRawJSON(t *testing.T) {
t.Parallel()
ctx := context.Background()
store := openTestStore(t)
record, _, err := store.CreateTransaction(ctx, CreateRequest{
ID: "list-transaction", IdempotencyKey: "list-idempotency", Source: "test", Service: "backend",
Request: json.RawMessage(`{"inputType":"native-jar"}`),
})
if err != nil {
t.Fatalf("create list transaction: %v", err)
}
items, err := store.ListRecent(ctx, ListFilter{Limit: 20})
if err != nil {
t.Fatalf("list transactions: %v", err)
}
if len(items) != 1 || items[0].ID != record.ID || string(items[0].Request) != `{"inputType":"native-jar"}` {
t.Fatalf("unexpected listed transaction: %+v", items)
}
}
func TestBackendContainerDeploymentCommitRequiresDrainingTransaction(t *testing.T) {
t.Parallel()
ctx := context.Background()