feat: refactor to ymsctl & yms-daemon
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user