@@ -35,6 +35,17 @@ const workflowFiles = async () => {
3535 return entries . filter ( ( entry ) => entry . isFile ( ) && / \. y a ? m l $ / . test ( entry . name ) ) ;
3636} ;
3737
38+ const workflowJob = ( workflow , jobName ) => {
39+ const marker = ` ${ jobName } :\n` ;
40+ const start = workflow . indexOf ( marker ) ;
41+ assert . notEqual ( start , - 1 , `missing ${ jobName } job` ) ;
42+
43+ const bodyStart = start + marker . length ;
44+ const remaining = workflow . slice ( bodyStart ) ;
45+ const nextJob = remaining . search ( / ^ [ \w - ] + : / m) ;
46+ return nextJob === - 1 ? remaining : remaining . slice ( 0 , nextJob ) ;
47+ } ;
48+
3849describe ( "JavaScript dependency policy" , ( ) => {
3950 it ( "keeps pnpm-lock.yaml as the only tracked JavaScript lockfile" , async ( ) => {
4051 assert . deepEqual ( await trackedPackageLocks ( ) , [ ] ) ;
@@ -58,8 +69,10 @@ describe("JavaScript dependency policy", () => {
5869describe ( "Rust feature coverage" , ( ) => {
5970 it ( "tests both parallel encoders in Linux CI" , async ( ) => {
6071 const workflow = await readFile ( CI_WORKFLOW_URL , "utf8" ) ;
72+ const job = workflowJob ( workflow , "parallel-features" ) ;
6173
62- assert . match ( workflow , / c a r g o t e s t - p s r c m a p - c o d e c - - f e a t u r e s p a r a l l e l \b / ) ;
63- assert . match ( workflow , / c a r g o t e s t - p s r c m a p - g e n e r a t o r - - f e a t u r e s p a r a l l e l \b / ) ;
74+ assert . match ( job , / ^ r u n s - o n : u b u n t u - l a t e s t $ / m) ;
75+ assert . match ( job , / ^ r u n : c a r g o t e s t - p s r c m a p - c o d e c - - f e a t u r e s p a r a l l e l $ / m) ;
76+ assert . match ( job , / ^ r u n : c a r g o t e s t - p s r c m a p - g e n e r a t o r - - f e a t u r e s p a r a l l e l $ / m) ;
6477 } ) ;
6578} ) ;
0 commit comments