feat: enforce shared application resource quotas across namespaces
This commit is contained in:
@@ -41,10 +41,16 @@ func executionID(t *testing.T) core.ID {
|
||||
}
|
||||
return id
|
||||
}
|
||||
func newExecutionFixture(t *testing.T, ctx context.Context, db *sql.DB) *executionFixture {
|
||||
func newExecutionFixture(t *testing.T, ctx context.Context, db *sql.DB, application ...core.ID) *executionFixture {
|
||||
t.Helper()
|
||||
f := &executionFixture{t: t, ctx: ctx, db: db, tasks: service.New(NewTaskStore(db))}
|
||||
err := Bootstrap(ctx, db, BootstrapInput{Application: "worker-" + string(executionID(t)), Namespace: "default", Environment: "test", Queue: "work"}, func(v BootstrapResult) error { f.resources = v; return nil })
|
||||
in := BootstrapInput{Application: "worker-" + string(executionID(t)), Namespace: "default", Environment: "test", Queue: "work"}
|
||||
if len(application) > 0 {
|
||||
in.Application = ""
|
||||
in.ExistingApplicationID = application[0]
|
||||
in.Namespace = "ns-" + string(executionID(t))
|
||||
}
|
||||
err := Bootstrap(ctx, db, in, func(v BootstrapResult) error { f.resources = v; return nil })
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user