@@ -17,6 +17,8 @@ const freshUrlEnv = "LUO_AUDIO_OUTPUT_REMOTE_FRESH_URL";
1717const freshHeadersEnv = "LUO_AUDIO_OUTPUT_REMOTE_FRESH_HEADERS" ;
1818const nativePlaybackEnv = "LUO_AUDIO_OUTPUT_REMOTE_NATIVE_PLAYBACK" ;
1919const nativePlaybackModeEnv = "LUO_AUDIO_OUTPUT_REMOTE_NATIVE_MODE" ;
20+ const nativePlaybackSkipHelperEnv =
21+ "LUO_AUDIO_OUTPUT_REMOTE_NATIVE_SKIP_HELPER" ;
2022const nativePlaybackStates = new Set ( [ "starting" , "playing" , "ended" ] ) ;
2123const projectRoot = path . resolve ( __dirname , ".." ) ;
2224const protocolVersion = 2 ;
@@ -493,8 +495,6 @@ async function verifyNativePlaybackFromFreshAudio(scenario, options = {}) {
493495 } ;
494496 }
495497
496- const helperInfo = prepareAudioOutputHelper ( { projectRoot } ) ;
497-
498498 const cacheDir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "luo-remote-native-" ) ) ;
499499 const extension = extensionForContentType (
500500 wholeFresh . contentType ,
@@ -503,6 +503,26 @@ async function verifyNativePlaybackFromFreshAudio(scenario, options = {}) {
503503 const cachePath = path . join ( cacheDir , `fresh-audio${ extension } ` ) ;
504504 fs . writeFileSync ( cachePath , wholeFresh . bytes ) ;
505505
506+ const nativeMode = normalizeNativePlaybackMode (
507+ process . env [ nativePlaybackModeEnv ] ,
508+ ) ;
509+
510+ if ( parseBooleanEnv ( nativePlaybackSkipHelperEnv , false ) ) {
511+ return {
512+ attempted : true ,
513+ started : false ,
514+ cachePath,
515+ extension,
516+ bytesReceived : wholeFresh . bytesReceived ,
517+ bodySha256 : wholeFresh . bodySha256 ,
518+ contentType : wholeFresh . contentType ,
519+ requestedMode : nativeMode ,
520+ reason : `Native helper startup skipped by ${ nativePlaybackSkipHelperEnv } .` ,
521+ } ;
522+ }
523+
524+ const helperInfo = prepareAudioOutputHelper ( { projectRoot } ) ;
525+
506526 const helper = spawn ( helperInfo . helperPath , [ ] , {
507527 cwd : projectRoot ,
508528 env : process . env ,
@@ -511,9 +531,6 @@ async function verifyNativePlaybackFromFreshAudio(scenario, options = {}) {
511531 } ) ;
512532 const events = attachHelperEventParser ( helper ) ;
513533 const deviceId = process . env . LUO_AUDIO_OUTPUT_TEST_DEVICE_ID || "" ;
514- const nativeMode = normalizeNativePlaybackMode (
515- process . env [ nativePlaybackModeEnv ] ,
516- ) ;
517534 const timeoutMs = parseIntegerEnv (
518535 "LUO_AUDIO_OUTPUT_REMOTE_NATIVE_TIMEOUT_MS" ,
519536 15_000 ,
0 commit comments