Implement catalog startup diagnostics (T-616)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"softbox.local/core/application"
|
||||
)
|
||||
|
||||
func TestStartCatalogBootstrapPublishesThroughRuntime(t *testing.T) {
|
||||
runtime := application.NewRuntime(1)
|
||||
done := startCatalogBootstrap(context.Background(), runtime, application.CatalogSnapshotLoaderFunc(func(context.Context) (application.CatalogSnapshot, error) {
|
||||
return application.CatalogSnapshot{Source: application.CatalogSourceRemote, Items: []application.CatalogListItem{{ID: "tool", Name: "Tool", Version: "1.0.0"}}}, nil
|
||||
}))
|
||||
if err := <-done; err != nil {
|
||||
t.Fatalf("bootstrap error = %v", err)
|
||||
}
|
||||
event := <-runtime.Events()
|
||||
if event.Type != application.EventCatalogRefreshed {
|
||||
t.Fatalf("event type = %q", event.Type)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user