@@ -2126,85 +2126,68 @@ test.serial("getPrimaryAnalysisConfig - Code Scanning + Code Quality", (t) => {
21262126} ) ;
21272127
21282128test . serial (
2129- "isTrapCachingEnabled: explicit input true is respected " ,
2129+ "isTrapCachingEnabled: explicit true input overrides self-hosted default " ,
21302130 async ( t ) => {
21312131 return await withTmpDir ( async ( tmpDir ) => {
21322132 setupActionsVars ( tmpDir , tmpDir ) ;
21332133 sinon
21342134 . stub ( actionsUtil , "getOptionalInput" )
21352135 . withArgs ( "trap-caching" )
21362136 . returns ( "true" ) ;
2137- t . true (
2138- await configUtils . isTrapCachingEnabled (
2139- createFeatures ( [ ] ) ,
2140- OverlayDatabaseMode . None ,
2141- ) ,
2142- ) ;
2137+ t . true ( configUtils . isTrapCachingEnabled ( OverlayDatabaseMode . None ) ) ;
21432138 } ) ;
21442139 } ,
21452140) ;
21462141
21472142test . serial (
2148- "isTrapCachingEnabled: disabled on self-hosted runner by default " ,
2143+ "isTrapCachingEnabled: explicit true input overrides overlay defaults " ,
21492144 async ( t ) => {
21502145 return await withTmpDir ( async ( tmpDir ) => {
2151- setupActionsVars ( tmpDir , tmpDir ) ;
2146+ setupActionsVars ( tmpDir , path . join ( tmpDir , "hostedtoolcache" ) ) ;
21522147 sinon
21532148 . stub ( actionsUtil , "getOptionalInput" )
21542149 . withArgs ( "trap-caching" )
2155- . returns ( undefined ) ;
2156- t . false (
2157- await configUtils . isTrapCachingEnabled (
2158- createFeatures ( [ ] ) ,
2159- OverlayDatabaseMode . None ,
2160- ) ,
2161- ) ;
2150+ . returns ( "true" ) ;
2151+ for ( const overlayDatabaseMode of [
2152+ OverlayDatabaseMode . Overlay ,
2153+ OverlayDatabaseMode . OverlayBase ,
2154+ ] ) {
2155+ t . true ( configUtils . isTrapCachingEnabled ( overlayDatabaseMode ) ) ;
2156+ }
21622157 } ) ;
21632158 } ,
21642159) ;
21652160
21662161test . serial (
2167- "isTrapCachingEnabled: enabled on hosted runner by default" ,
2162+ "isTrapCachingEnabled: explicit false input overrides hosted default" ,
21682163 async ( t ) => {
21692164 return await withTmpDir ( async ( tmpDir ) => {
2170- const hostedToolCache = path . join ( tmpDir , "hostedtoolcache" ) ;
2171- setupActionsVars ( tmpDir , hostedToolCache ) ;
2165+ setupActionsVars ( tmpDir , path . join ( tmpDir , "hostedtoolcache" ) ) ;
21722166 sinon
21732167 . stub ( actionsUtil , "getOptionalInput" )
21742168 . withArgs ( "trap-caching" )
2175- . returns ( undefined ) ;
2176- t . true (
2177- await configUtils . isTrapCachingEnabled (
2178- createFeatures ( [ ] ) ,
2179- OverlayDatabaseMode . None ,
2180- ) ,
2181- ) ;
2169+ . returns ( "false" ) ;
2170+ t . false ( configUtils . isTrapCachingEnabled ( OverlayDatabaseMode . None ) ) ;
21822171 } ) ;
21832172 } ,
21842173) ;
21852174
21862175test . serial (
2187- "isTrapCachingEnabled: enabled on hosted runner when overlay enabled but feature flag off " ,
2176+ "isTrapCachingEnabled: disabled on self- hosted runner by default " ,
21882177 async ( t ) => {
21892178 return await withTmpDir ( async ( tmpDir ) => {
2190- const hostedToolCache = path . join ( tmpDir , "hostedtoolcache" ) ;
2191- setupActionsVars ( tmpDir , hostedToolCache ) ;
2179+ setupActionsVars ( tmpDir , tmpDir ) ;
21922180 sinon
21932181 . stub ( actionsUtil , "getOptionalInput" )
21942182 . withArgs ( "trap-caching" )
21952183 . returns ( undefined ) ;
2196- t . true (
2197- await configUtils . isTrapCachingEnabled (
2198- createFeatures ( [ ] ) ,
2199- OverlayDatabaseMode . Overlay ,
2200- ) ,
2201- ) ;
2184+ t . false ( configUtils . isTrapCachingEnabled ( OverlayDatabaseMode . None ) ) ;
22022185 } ) ;
22032186 } ,
22042187) ;
22052188
22062189test . serial (
2207- "isTrapCachingEnabled: disabled on hosted runner when overlay enabled and feature flag on " ,
2190+ "isTrapCachingEnabled: enabled on hosted runner without overlay analysis " ,
22082191 async ( t ) => {
22092192 return await withTmpDir ( async ( tmpDir ) => {
22102193 const hostedToolCache = path . join ( tmpDir , "hostedtoolcache" ) ;
@@ -2213,18 +2196,13 @@ test.serial(
22132196 . stub ( actionsUtil , "getOptionalInput" )
22142197 . withArgs ( "trap-caching" )
22152198 . returns ( undefined ) ;
2216- t . false (
2217- await configUtils . isTrapCachingEnabled (
2218- createFeatures ( [ Feature . OverlayAnalysisDisableTrapCaching ] ) ,
2219- OverlayDatabaseMode . Overlay ,
2220- ) ,
2221- ) ;
2199+ t . true ( configUtils . isTrapCachingEnabled ( OverlayDatabaseMode . None ) ) ;
22222200 } ) ;
22232201 } ,
22242202) ;
22252203
22262204test . serial (
2227- "isTrapCachingEnabled: enabled on hosted runner when overlay is None even with feature flag on " ,
2205+ "isTrapCachingEnabled: disabled on hosted runner with overlay analysis " ,
22282206 async ( t ) => {
22292207 return await withTmpDir ( async ( tmpDir ) => {
22302208 const hostedToolCache = path . join ( tmpDir , "hostedtoolcache" ) ;
@@ -2233,12 +2211,12 @@ test.serial(
22332211 . stub ( actionsUtil , "getOptionalInput" )
22342212 . withArgs ( "trap-caching" )
22352213 . returns ( undefined ) ;
2236- t . true (
2237- await configUtils . isTrapCachingEnabled (
2238- createFeatures ( [ Feature . OverlayAnalysisDisableTrapCaching ] ) ,
2239- OverlayDatabaseMode . None ,
2240- ) ,
2241- ) ;
2214+ for ( const overlayDatabaseMode of [
2215+ OverlayDatabaseMode . Overlay ,
2216+ OverlayDatabaseMode . OverlayBase ,
2217+ ] ) {
2218+ t . false ( configUtils . isTrapCachingEnabled ( overlayDatabaseMode ) ) ;
2219+ }
22422220 } ) ;
22432221 } ,
22442222) ;
0 commit comments