@@ -119,25 +119,28 @@ async function seedWorker(
119119}
120120
121121describe ( "RunEngineControlPlaneResolver adapter" , ( ) => {
122- heteroPostgresTest ( "resolveEnv maps app ResolvedEnv onto ResolvedEngineEnv" , async ( { prisma14 } ) => {
123- const { organization, project, environment } = await seedEnv ( prisma14 , "PRODUCTION" ) ;
124- const adapter = new RunEngineControlPlaneResolver ( buildAppResolver ( prisma14 ) ) ;
122+ heteroPostgresTest (
123+ "resolveEnv maps app ResolvedEnv onto ResolvedEngineEnv" ,
124+ async ( { prisma14 } ) => {
125+ const { organization, project, environment } = await seedEnv ( prisma14 , "PRODUCTION" ) ;
126+ const adapter = new RunEngineControlPlaneResolver ( buildAppResolver ( prisma14 ) ) ;
125127
126- const env = await adapter . resolveEnv ( environment . id ) ;
127- expect ( env ) . not . toBeNull ( ) ;
128- expect ( env ! . id ) . toBe ( environment . id ) ;
129- expect ( env ! . type ) . toBe ( "PRODUCTION" ) ;
130- expect ( env ! . projectId ) . toBe ( project . id ) ;
131- expect ( env ! . organizationId ) . toBe ( organization . id ) ;
132- // Nested + concurrency fields the run-engine MinimalAuthenticatedEnvironment requires.
133- expect ( env ! . project . id ) . toBe ( project . id ) ;
134- expect ( env ! . organization . id ) . toBe ( organization . id ) ;
135- expect ( env ! . maximumConcurrencyLimit ) . toBe ( 9 ) ;
136- expect ( env ! . concurrencyLimitBurstFactor . toNumber ( ) ) . toBe ( 2 ) ;
137- expect ( env ! . archivedAt ) . toBeNull ( ) ;
128+ const env = await adapter . resolveEnv ( environment . id ) ;
129+ expect ( env ) . not . toBeNull ( ) ;
130+ expect ( env ! . id ) . toBe ( environment . id ) ;
131+ expect ( env ! . type ) . toBe ( "PRODUCTION" ) ;
132+ expect ( env ! . projectId ) . toBe ( project . id ) ;
133+ expect ( env ! . organizationId ) . toBe ( organization . id ) ;
134+ // Nested + concurrency fields the run-engine MinimalAuthenticatedEnvironment requires.
135+ expect ( env ! . project . id ) . toBe ( project . id ) ;
136+ expect ( env ! . organization . id ) . toBe ( organization . id ) ;
137+ expect ( env ! . maximumConcurrencyLimit ) . toBe ( 9 ) ;
138+ expect ( env ! . concurrencyLimitBurstFactor . toNumber ( ) ) . toBe ( 2 ) ;
139+ expect ( env ! . archivedAt ) . toBeNull ( ) ;
138140
139- expect ( await adapter . resolveEnv ( "env_missing" ) ) . toBeNull ( ) ;
140- } ) ;
141+ expect ( await adapter . resolveEnv ( "env_missing" ) ) . toBeNull ( ) ;
142+ }
143+ ) ;
141144
142145 heteroPostgresTest (
143146 "resolveWorkerVersion (deployed, no workerId) resolves the promoted MANAGED deployment" ,
@@ -156,7 +159,9 @@ describe("RunEngineControlPlaneResolver adapter", () => {
156159 } ) ;
157160 expect ( version ) . not . toBeNull ( ) ;
158161 expect ( version ! . worker . id ) . toBe ( seeded . worker . id ) ;
159- expect ( version ! . deployment ?. id ) . toBe ( "deployment" in seeded ? seeded . deployment . id : undefined ) ;
162+ expect ( version ! . deployment ?. id ) . toBe (
163+ "deployment" in seeded ? seeded . deployment . id : undefined
164+ ) ;
160165 expect ( version ! . tasks . map ( ( t ) => t . slug ) ) . toContain ( "my-task" ) ;
161166 }
162167 ) ;
@@ -182,13 +187,14 @@ describe("RunEngineControlPlaneResolver adapter", () => {
182187 }
183188 ) ;
184189
185- heteroPostgresTest ( "assertEnvExists resolves for a present env, rejects for a missing one" , async ( {
186- prisma14 ,
187- } ) => {
188- const { environment } = await seedEnv ( prisma14 , "PRODUCTION" ) ;
189- const adapter = new RunEngineControlPlaneResolver ( buildAppResolver ( prisma14 ) ) ;
190+ heteroPostgresTest (
191+ "assertEnvExists resolves for a present env, rejects for a missing one" ,
192+ async ( { prisma14 } ) => {
193+ const { environment } = await seedEnv ( prisma14 , "PRODUCTION" ) ;
194+ const adapter = new RunEngineControlPlaneResolver ( buildAppResolver ( prisma14 ) ) ;
190195
191- await expect ( adapter . assertEnvExists ( environment . id ) ) . resolves . toBeUndefined ( ) ;
192- await expect ( adapter . assertEnvExists ( "env_missing" ) ) . rejects . toThrow ( ) ;
193- } ) ;
196+ await expect ( adapter . assertEnvExists ( environment . id ) ) . resolves . toBeUndefined ( ) ;
197+ await expect ( adapter . assertEnvExists ( "env_missing" ) ) . rejects . toThrow ( ) ;
198+ }
199+ ) ;
194200} ) ;
0 commit comments