@@ -9,6 +9,7 @@ import { promisify } from "node:util";
99const execFileAsync = promisify ( execFile ) ;
1010const repoRoot = process . cwd ( ) ;
1111const scriptPath = path . join ( repoRoot , "scripts" , "release" , "gh-release.sh" ) ;
12+ const FIXTURE_RELEASE_HELPER_TIMEOUT_MS = 15_000 ;
1213
1314function escapeRegExp ( value : string ) : string {
1415 return value . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, "\\$&" ) ;
@@ -208,7 +209,7 @@ async function runFixtureReleaseHelper(fixture: {
208209 RAY_TEST_LOG : fixture . logPath ,
209210 } ,
210211 maxBuffer : 64 * 1024 ,
211- timeout : 5_000 ,
212+ timeout : FIXTURE_RELEASE_HELPER_TIMEOUT_MS ,
212213 } ) ;
213214
214215 return { code : 0 , stderr, stdout } ;
@@ -222,6 +223,27 @@ async function runFixtureReleaseHelper(fixture: {
222223 }
223224}
224225
226+ async function assertFixtureReleaseHelperSucceeded (
227+ fixture : { logPath : string } ,
228+ result : { code : number ; stderr : string ; stdout : string } ,
229+ ) : Promise < void > {
230+ const commandLog = await readFile ( fixture . logPath , "utf8" ) . catch ( ( ) => "" ) ;
231+
232+ assert . equal (
233+ result . code ,
234+ 0 ,
235+ [
236+ "expected release helper fixture to exit 0" ,
237+ "stdout:" ,
238+ result . stdout ,
239+ "stderr:" ,
240+ result . stderr ,
241+ "commands:" ,
242+ commandLog ,
243+ ] . join ( "\n" ) ,
244+ ) ;
245+ }
246+
225247test ( "gh release helper validates syntax and dry-runs without mutating git state" , async ( ) => {
226248 const version = await readCurrentVersion ( ) ;
227249 const escapedVersion = escapeRegExp ( version ) ;
@@ -323,7 +345,7 @@ test("gh release helper continues when GitHub reports releases are missing", asy
323345
324346 const result = await runFixtureReleaseHelper ( fixture ) ;
325347
326- assert . equal ( result . code , 0 ) ;
348+ await assertFixtureReleaseHelperSucceeded ( fixture , result ) ;
327349 assert . match (
328350 result . stdout ,
329351 / D o n e \. A c t i o n s p u b l i s h t o n p m w h e n e a c h r e l e a s e i s i n p u b l i s h e d s t a t e \. / ,
@@ -352,7 +374,7 @@ test("gh release helper reuses matching local annotated tags", async (t) => {
352374
353375 const result = await runFixtureReleaseHelper ( fixture ) ;
354376
355- assert . equal ( result . code , 0 ) ;
377+ await assertFixtureReleaseHelperSucceeded ( fixture , result ) ;
356378 assert . match ( result . stdout , / R e u s i n g l o c a l a n n o t a t e d t a g c o r e - v 1 \. 2 \. 3 / ) ;
357379 assert . match ( result . stdout , / R e u s i n g l o c a l a n n o t a t e d t a g s d k - v 1 \. 2 \. 3 / ) ;
358380
@@ -378,7 +400,7 @@ test("gh release helper resumes after remote tags or releases already exist safe
378400
379401 const result = await runFixtureReleaseHelper ( fixture ) ;
380402
381- assert . equal ( result . code , 0 ) ;
403+ await assertFixtureReleaseHelperSucceeded ( fixture , result ) ;
382404 assert . match ( result . stdout , / R e u s i n g r e m o t e a n n o t a t e d t a g c o r e - v 1 \. 2 \. 3 / ) ;
383405 assert . match ( result . stdout , / R e u s i n g r e m o t e a n n o t a t e d t a g s d k - v 1 \. 2 \. 3 / ) ;
384406 assert . match ( result . stdout , / R e u s i n g G i t H u b r e l e a s e c o r e - v 1 \. 2 \. 3 / ) ;
0 commit comments