File tree Expand file tree Collapse file tree 4 files changed +20
-6
lines changed Expand file tree Collapse file tree 4 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ export const executorSchema = z.object({
7272 )
7373 . describe ( 'Call this function while the server is running' ) ,
7474 ] ) ,
75- z . promise ( z . custom < ServeTestingResult > ( ) ) ,
75+ z . promise ( z . union ( [ z . custom < ServeTestingResult > ( ) , z . null ( ) ] ) ) ,
7676 )
7777 . nullable ( ) ,
7878 executeProjectTests : z . function (
Original file line number Diff line number Diff line change @@ -21,9 +21,11 @@ export const localExecutorConfigSchema = z.strictObject({
2121 buildCommand : z . string ( ) . optional ( ) ,
2222 /**
2323 * Command to run when starting a development server inside the app.
24- * Defaults to `<package manager> run start --port 0`.
24+ *
25+ * When `undefined`, defaults to `<package manager> run start --port 0`.
26+ * When `null`, the app has no server and no runtime testing will occur.
2527 */
26- serveCommand : z . string ( ) . optional ( ) ,
28+ serveCommand : z . string ( ) . optional ( ) . nullable ( ) ,
2729 /**
2830 * Optional command for executing project tests.
2931 */
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import {callWithTimeout} from '../../utils/timeout.js';
2727import { executeCommand } from '../../utils/exec.js' ;
2828import { cleanupBuildMessage } from '../../workers/builder/worker.js' ;
2929import { combineAbortSignals } from '../../utils/abort-signal.js' ;
30+ import { ServeTestingResult } from '../../workers/serve-testing/worker-types.js' ;
3031
3132let uniqueIDs = 0 ;
3233
@@ -172,13 +173,18 @@ export class LocalExecutor implements Executor {
172173 } satisfies TestExecutionResult ;
173174 }
174175
175- async serveWebApplication < T > (
176+ async serveWebApplication (
176177 _id : EvalID ,
177178 appDirectoryPath : string ,
178179 rootPromptDef : RootPromptDefinition ,
179180 progress : ProgressLogger ,
180- logicWhileServing : ( serveUrl : string ) => Promise < T > ,
181- ) : Promise < T > {
181+ logicWhileServing : ( serveUrl : string ) => Promise < ServeTestingResult > ,
182+ ) : Promise < ServeTestingResult | null > {
183+ // Serve testing is explicitly disabled.
184+ if ( this . config . serveCommand === null ) {
185+ return null ;
186+ }
187+
182188 return await serveApp (
183189 this . getServeCommand ( ) ,
184190 rootPromptDef ,
Original file line number Diff line number Diff line change @@ -87,6 +87,12 @@ export async function serveAndTestApp(
8787 } ,
8888 ) ;
8989
90+ // An executor might define `serveWebApplication` but conditionally decide
91+ // that no web application can be started/served.
92+ if ( result === null ) {
93+ return null ;
94+ }
95+
9096 if ( result . errorMessage === undefined ) {
9197 progress . log ( rootPromptDef , 'success' , 'Validation of running app is successful' ) ;
9298 } else {
You can’t perform that action at this time.
0 commit comments