@@ -2132,101 +2132,99 @@ test.serial("getPrimaryAnalysisConfig - Code Scanning + Code Quality", (t) => {
21322132 ) ;
21332133} ) ;
21342134
2135- test . serial (
2136- "isTrapCachingEnabled: explicit true input overrides self-hosted default" ,
2137- async ( t ) => {
2138- return await withTmpDir ( async ( tmpDir ) => {
2139- setupActionsVars ( tmpDir , tmpDir ) ;
2140- sinon
2141- . stub ( actionsUtil , "getOptionalInput" )
2142- . withArgs ( "trap-caching" )
2143- . returns ( "true" ) ;
2144- t . true ( configUtils . isTrapCachingEnabled ( OverlayDatabaseMode . None ) ) ;
2145- } ) ;
2146- } ,
2147- ) ;
2135+ test ( "isTrapCachingEnabled: explicit true input overrides self-hosted default" , async ( t ) => {
2136+ return await withTmpDir ( async ( tmpDir ) => {
2137+ const action = initAllState ( ) ;
2138+ setupActionsVars ( tmpDir , tmpDir , { } , action . env ) ;
2139+ sinon
2140+ . stub ( action . actions , "getOptionalInput" )
2141+ . withArgs ( "trap-caching" )
2142+ . returns ( "true" ) ;
2143+ t . true ( configUtils . isTrapCachingEnabled ( action , OverlayDatabaseMode . None ) ) ;
2144+ } ) ;
2145+ } ) ;
21482146
2149- test . serial (
2150- "isTrapCachingEnabled: explicit true input overrides overlay defaults" ,
2151- async ( t ) => {
2152- return await withTmpDir ( async ( tmpDir ) => {
2153- setupActionsVars ( tmpDir , path . join ( tmpDir , "hostedtoolcache" ) ) ;
2154- sinon
2155- . stub ( actionsUtil , "getOptionalInput" )
2156- . withArgs ( "trap-caching" )
2157- . returns ( "true" ) ;
2158- for ( const overlayDatabaseMode of [
2159- OverlayDatabaseMode . Overlay ,
2160- OverlayDatabaseMode . OverlayBase ,
2161- ] ) {
2162- t . true ( configUtils . isTrapCachingEnabled ( overlayDatabaseMode ) ) ;
2163- }
2164- } ) ;
2165- } ,
2166- ) ;
2147+ test ( "isTrapCachingEnabled: explicit true input overrides overlay defaults" , async ( t ) => {
2148+ return await withTmpDir ( async ( tmpDir ) => {
2149+ const action = initAllState ( ) ;
2150+ setupActionsVars (
2151+ tmpDir ,
2152+ path . join ( tmpDir , "hostedtoolcache" ) ,
2153+ { } ,
2154+ action . env ,
2155+ ) ;
2156+ sinon
2157+ . stub ( action . actions , "getOptionalInput" )
2158+ . withArgs ( "trap-caching" )
2159+ . returns ( "true" ) ;
2160+ for ( const overlayDatabaseMode of [
2161+ OverlayDatabaseMode . Overlay ,
2162+ OverlayDatabaseMode . OverlayBase ,
2163+ ] ) {
2164+ t . true ( configUtils . isTrapCachingEnabled ( action , overlayDatabaseMode ) ) ;
2165+ }
2166+ } ) ;
2167+ } ) ;
21672168
2168- test . serial (
2169- "isTrapCachingEnabled: explicit false input overrides hosted default" ,
2170- async ( t ) => {
2171- return await withTmpDir ( async ( tmpDir ) => {
2172- setupActionsVars ( tmpDir , path . join ( tmpDir , "hostedtoolcache" ) ) ;
2173- sinon
2174- . stub ( actionsUtil , "getOptionalInput" )
2175- . withArgs ( "trap-caching" )
2176- . returns ( "false" ) ;
2177- t . false ( configUtils . isTrapCachingEnabled ( OverlayDatabaseMode . None ) ) ;
2178- } ) ;
2179- } ,
2180- ) ;
2169+ test ( "isTrapCachingEnabled: explicit false input overrides hosted default" , async ( t ) => {
2170+ return await withTmpDir ( async ( tmpDir ) => {
2171+ const action = initAllState ( ) ;
2172+ setupActionsVars (
2173+ tmpDir ,
2174+ path . join ( tmpDir , "hostedtoolcache" ) ,
2175+ { } ,
2176+ action . env ,
2177+ ) ;
2178+ sinon
2179+ . stub ( action . actions , "getOptionalInput" )
2180+ . withArgs ( "trap-caching" )
2181+ . returns ( "false" ) ;
2182+ t . false ( configUtils . isTrapCachingEnabled ( action , OverlayDatabaseMode . None ) ) ;
2183+ } ) ;
2184+ } ) ;
21812185
2182- test . serial (
2183- "isTrapCachingEnabled: disabled on self-hosted runner by default" ,
2184- async ( t ) => {
2185- return await withTmpDir ( async ( tmpDir ) => {
2186- setupActionsVars ( tmpDir , tmpDir ) ;
2187- sinon
2188- . stub ( actionsUtil , "getOptionalInput" )
2189- . withArgs ( "trap-caching" )
2190- . returns ( undefined ) ;
2191- t . false ( configUtils . isTrapCachingEnabled ( OverlayDatabaseMode . None ) ) ;
2192- } ) ;
2193- } ,
2194- ) ;
2186+ test ( "isTrapCachingEnabled: disabled on self-hosted runner by default" , async ( t ) => {
2187+ return await withTmpDir ( async ( tmpDir ) => {
2188+ const action = initAllState ( ) ;
2189+ setupActionsVars ( tmpDir , tmpDir , { } , action . env ) ;
2190+ sinon
2191+ . stub ( action . actions , "getOptionalInput" )
2192+ . withArgs ( "trap-caching" )
2193+ . returns ( undefined ) ;
2194+ t . false ( configUtils . isTrapCachingEnabled ( action , OverlayDatabaseMode . None ) ) ;
2195+ } ) ;
2196+ } ) ;
21952197
2196- test . serial (
2197- "isTrapCachingEnabled: enabled on hosted runner without overlay analysis" ,
2198- async ( t ) => {
2199- return await withTmpDir ( async ( tmpDir ) => {
2200- const hostedToolCache = path . join ( tmpDir , "hostedtoolcache" ) ;
2201- setupActionsVars ( tmpDir , hostedToolCache ) ;
2202- sinon
2203- . stub ( actionsUtil , "getOptionalInput" )
2204- . withArgs ( "trap-caching" )
2205- . returns ( undefined ) ;
2206- t . true ( configUtils . isTrapCachingEnabled ( OverlayDatabaseMode . None ) ) ;
2207- } ) ;
2208- } ,
2209- ) ;
2198+ test ( "isTrapCachingEnabled: enabled on hosted runner without overlay analysis" , async ( t ) => {
2199+ return await withTmpDir ( async ( tmpDir ) => {
2200+ const action = initAllState ( ) ;
2201+ const hostedToolCache = path . join ( tmpDir , "hostedtoolcache" ) ;
2202+ setupActionsVars ( tmpDir , hostedToolCache , { } , action . env ) ;
2203+ sinon
2204+ . stub ( action . actions , "getOptionalInput" )
2205+ . withArgs ( "trap-caching" )
2206+ . returns ( undefined ) ;
2207+ t . true ( configUtils . isTrapCachingEnabled ( action , OverlayDatabaseMode . None ) ) ;
2208+ } ) ;
2209+ } ) ;
22102210
2211- test . serial (
2212- "isTrapCachingEnabled: disabled on hosted runner with overlay analysis" ,
2213- async ( t ) => {
2214- return await withTmpDir ( async ( tmpDir ) => {
2215- const hostedToolCache = path . join ( tmpDir , "hostedtoolcache" ) ;
2216- setupActionsVars ( tmpDir , hostedToolCache ) ;
2217- sinon
2218- . stub ( actionsUtil , "getOptionalInput" )
2219- . withArgs ( "trap-caching" )
2220- . returns ( undefined ) ;
2221- for ( const overlayDatabaseMode of [
2222- OverlayDatabaseMode . Overlay ,
2223- OverlayDatabaseMode . OverlayBase ,
2224- ] ) {
2225- t . false ( configUtils . isTrapCachingEnabled ( overlayDatabaseMode ) ) ;
2226- }
2227- } ) ;
2228- } ,
2229- ) ;
2211+ test ( "isTrapCachingEnabled: disabled on hosted runner with overlay analysis" , async ( t ) => {
2212+ return await withTmpDir ( async ( tmpDir ) => {
2213+ const action = initAllState ( ) ;
2214+ const hostedToolCache = path . join ( tmpDir , "hostedtoolcache" ) ;
2215+ setupActionsVars ( tmpDir , hostedToolCache , { } , action . env ) ;
2216+ sinon
2217+ . stub ( action . actions , "getOptionalInput" )
2218+ . withArgs ( "trap-caching" )
2219+ . returns ( undefined ) ;
2220+ for ( const overlayDatabaseMode of [
2221+ OverlayDatabaseMode . Overlay ,
2222+ OverlayDatabaseMode . OverlayBase ,
2223+ ] ) {
2224+ t . false ( configUtils . isTrapCachingEnabled ( action , overlayDatabaseMode ) ) ;
2225+ }
2226+ } ) ;
2227+ } ) ;
22302228
22312229test ( "applyIncrementalAnalysisSettings: no-op when mode is not Overlay and diff ranges are unavailable" , async ( t ) => {
22322230 const config = createTestConfig ( { } ) ;
0 commit comments