feat: move distribution builds to platform Docker builder
This commit is contained in:
@@ -291,7 +291,9 @@ func TestConfigWriteAndFileDispatchAPIAreScopedAndSafe(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCoreAPIServerRuntimeDistributionAndJobWorkflows(t *testing.T) {
|
||||
router := newTestRouter()
|
||||
releaseBuilds := make(chan struct{})
|
||||
t.Cleanup(func() { close(releaseBuilds) })
|
||||
router := newTestRouterWithDistributionBuilder(apiTestDistributionBuilder{release: releaseBuilds})
|
||||
adminSession := createAdminSession(t, router)
|
||||
serverID := createRuntimeAPIFixtures(t, router, adminSession)
|
||||
|
||||
@@ -1604,14 +1606,34 @@ func TestProductionOperationsGovernanceRoutesAreDurableAndRedacted(t *testing.T)
|
||||
}
|
||||
}
|
||||
|
||||
func newTestRouter() http.Handler {
|
||||
type apiTestDistributionBuilder struct {
|
||||
release <-chan struct{}
|
||||
}
|
||||
|
||||
func (builder apiTestDistributionBuilder) Readiness() (bool, string) {
|
||||
return true, ""
|
||||
}
|
||||
|
||||
func (builder apiTestDistributionBuilder) Build(input domain.DistributionBuildInput) ([]byte, error) {
|
||||
if builder.release != nil {
|
||||
<-builder.release
|
||||
}
|
||||
return []byte("api-platform-built-distribution:" + input.JobID), nil
|
||||
}
|
||||
|
||||
func newTestRouterWithDistributionBuilder(builder service.DistributionBuilder) http.Handler {
|
||||
core := service.NewCoreService(repo.NewMemoryStore())
|
||||
core.ConfigureDistributionBuilder(builder)
|
||||
if err := core.SeedLocalPlatformAdmin(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return NewTestRouterWithCore(core)
|
||||
}
|
||||
|
||||
func newTestRouter() http.Handler {
|
||||
return newTestRouterWithDistributionBuilder(nil)
|
||||
}
|
||||
|
||||
func apiRouterWithoutSeededAdmin() http.Handler {
|
||||
return NewTestRouterWithCore(service.NewCoreService(repo.NewMemoryStore()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user