@@ -17,35 +17,47 @@ function makeDiskUsage(totalGiB: number): DiskUsage {
1717test ( "getCacheKey incorporates language, CodeQL version, and disk space" , async ( t ) => {
1818 const codeql = mockCodeQLVersion ( "2.20.0" ) ;
1919 t . is (
20- await getCacheKey ( codeql , "javascript" , makeDiskUsage ( 50 ) ) ,
20+ await getCacheKey ( codeql , [ "javascript" ] , makeDiskUsage ( 50 ) ) ,
2121 "codeql-overlay-status-javascript-2.20.0-runner-50GB" ,
2222 ) ;
2323 t . is (
24- await getCacheKey ( codeql , "python" , makeDiskUsage ( 50 ) ) ,
24+ await getCacheKey ( codeql , [ "python" ] , makeDiskUsage ( 50 ) ) ,
2525 "codeql-overlay-status-python-2.20.0-runner-50GB" ,
2626 ) ;
2727 t . is (
2828 await getCacheKey (
2929 mockCodeQLVersion ( "2.21.0" ) ,
30- "javascript" ,
30+ [ "javascript" ] ,
3131 makeDiskUsage ( 50 ) ,
3232 ) ,
3333 "codeql-overlay-status-javascript-2.21.0-runner-50GB" ,
3434 ) ;
3535 t . is (
36- await getCacheKey ( codeql , "javascript" , makeDiskUsage ( 100 ) ) ,
36+ await getCacheKey ( codeql , [ "javascript" ] , makeDiskUsage ( 100 ) ) ,
3737 "codeql-overlay-status-javascript-2.20.0-runner-100GB" ,
3838 ) ;
3939} ) ;
4040
41+ test ( "getCacheKey sorts and joins multiple languages" , async ( t ) => {
42+ const codeql = mockCodeQLVersion ( "2.20.0" ) ;
43+ t . is (
44+ await getCacheKey ( codeql , [ "python" , "javascript" ] , makeDiskUsage ( 50 ) ) ,
45+ "codeql-overlay-status-javascript+python-2.20.0-runner-50GB" ,
46+ ) ;
47+ t . is (
48+ await getCacheKey ( codeql , [ "javascript" , "python" ] , makeDiskUsage ( 50 ) ) ,
49+ "codeql-overlay-status-javascript+python-2.20.0-runner-50GB" ,
50+ ) ;
51+ } ) ;
52+
4153test ( "getCacheKey rounds disk space down to nearest 10 GiB" , async ( t ) => {
4254 const codeql = mockCodeQLVersion ( "2.20.0" ) ;
4355 t . is (
44- await getCacheKey ( codeql , "javascript" , makeDiskUsage ( 14 ) ) ,
56+ await getCacheKey ( codeql , [ "javascript" ] , makeDiskUsage ( 14 ) ) ,
4557 "codeql-overlay-status-javascript-2.20.0-runner-10GB" ,
4658 ) ;
4759 t . is (
48- await getCacheKey ( codeql , "javascript" , makeDiskUsage ( 19 ) ) ,
60+ await getCacheKey ( codeql , [ "javascript" ] , makeDiskUsage ( 19 ) ) ,
4961 "codeql-overlay-status-javascript-2.20.0-runner-10GB" ,
5062 ) ;
5163} ) ;
0 commit comments