@@ -1013,7 +1013,7 @@ describe("E2E reusable workflow contract", () => {
10131013 expect ( installStepIndex ) . toBeLessThan ( stepIndex ( "Export CI inference environment" ) ) ;
10141014 expect ( installStepIndex ) . toBeLessThan ( stepIndex ( "Run E2E script" ) ) ;
10151015
1016- expect ( nightlyWorkflow . jobs [ "cloud-onboard-e2e" ] . with ?. apt_packages ) . toBe ( "expect" ) ;
1016+ expect ( nightlyWorkflow . jobs [ "cloud-onboard-e2e" ] . with ?. apt_packages ) . toBeUndefined ( ) ;
10171017 expect ( nightlyWorkflow . jobs [ "network-policy-e2e" ] . with ?. apt_packages ) . toBe ( "expect" ) ;
10181018 expect (
10191019 nightlyWorkflow . jobs [ "issue-4434-tui-unreachable-inference-e2e" ] . steps ?. find (
@@ -1084,6 +1084,42 @@ describe("E2E reusable workflow contract", () => {
10841084 }
10851085 } ) ;
10861086
1087+ it ( "keeps apt package requests tied to reviewed host-tool consumers" , ( ) => {
1088+ const reviewedAptPackageLiterals = new Set ( [ "expect" , "expect iptables" ] ) ;
1089+ const reusableExpectConsumers : Record < string , string > = { } ;
1090+
1091+ for ( const [ name , job ] of Object . entries ( nightlyWorkflow . jobs ) ) {
1092+ const aptPackages = job . with ?. apt_packages ;
1093+ if ( aptPackages !== undefined ) {
1094+ expect ( reviewedAptPackageLiterals . has ( aptPackages ) , name ) . toBe ( true ) ;
1095+ expect ( aptPackages , name ) . not . toMatch (
1096+ / \$ \{ \{ | m a t r i x \. | i n p u t s \. | g i t h u b \. e v e n t \. i n p u t s | e n v \. / ,
1097+ ) ;
1098+ if ( aptPackages . split ( / \s + / ) . includes ( "expect" ) ) {
1099+ reusableExpectConsumers [ name ] = String ( job . with ?. script ?? "" ) ;
1100+ }
1101+ }
1102+
1103+ for ( const step of job . steps ?? [ ] ) {
1104+ if ( ! String ( step . uses ?? "" ) . includes ( "install-apt-packages" ) ) continue ;
1105+
1106+ const packages = String ( step . with ?. packages ?? "" ) ;
1107+ expect ( reviewedAptPackageLiterals . has ( packages ) , `${ name } :${ step . name ?? "" } ` ) . toBe ( true ) ;
1108+ expect ( packages , `${ name } :${ step . name ?? "" } ` ) . not . toMatch (
1109+ / \$ \{ \{ | m a t r i x \. | i n p u t s \. | g i t h u b \. e v e n t \. i n p u t s | e n v \. / ,
1110+ ) ;
1111+ }
1112+ }
1113+
1114+ expect ( reusableExpectConsumers ) . toEqual ( {
1115+ "network-policy-e2e" : "test/e2e/test-network-policy.sh" ,
1116+ } ) ;
1117+ for ( const [ name , script ] of Object . entries ( reusableExpectConsumers ) ) {
1118+ const scriptText = readFileSync ( new URL ( `../${ script } ` , import . meta. url ) , "utf8" ) ;
1119+ expect ( scriptText , name ) . toContain ( "command -v expect" ) ;
1120+ }
1121+ } ) ;
1122+
10871123 it ( "keeps the apt package validator scoped to simple host tool packages" , ( ) => {
10881124 for ( const packageName of [
10891125 "expect" ,
0 commit comments