@@ -1032,42 +1032,14 @@ test('downloadRemoteArtifact times out stalled artifact responses and removes pa
10321032 }
10331033} ) ;
10341034
1035- test ( 'computeDaemonCodeSignature fingerprints the daemon source tree ' , ( ) => {
1035+ test ( 'computeDaemonCodeSignature includes relative path, size, and mtime ' , ( ) => {
10361036 const root = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'agent-device-daemon-signature-' ) ) ;
10371037 try {
1038- const daemonEntryPath = path . join ( root , 'src' , 'daemon.ts' ) ;
1039- const perfPath = path . join ( root , 'src' , 'platforms' , 'ios' , 'perf.ts' ) ;
1040- fs . mkdirSync ( path . dirname ( perfPath ) , { recursive : true } ) ;
1038+ const daemonEntryPath = path . join ( root , 'dist' , 'src' , 'daemon.js' ) ;
1039+ fs . mkdirSync ( path . dirname ( daemonEntryPath ) , { recursive : true } ) ;
10411040 fs . writeFileSync ( daemonEntryPath , 'console.log("daemon");\n' , 'utf8' ) ;
1042- fs . writeFileSync ( perfPath , 'export const value = 1;\n' , 'utf8' ) ;
1043-
1044- const firstSignature = computeDaemonCodeSignature ( daemonEntryPath , root ) ;
1045- assert . match ( firstSignature , / ^ s r c : \d + : [ a - f 0 - 9 ] { 16 } $ / ) ;
1046-
1047- fs . writeFileSync ( perfPath , 'export const value = 2;\n' , 'utf8' ) ;
1048- const secondSignature = computeDaemonCodeSignature ( daemonEntryPath , root ) ;
1049- assert . notEqual ( secondSignature , firstSignature ) ;
1050- } finally {
1051- fs . rmSync ( root , { recursive : true , force : true } ) ;
1052- }
1053- } ) ;
1054-
1055- test ( 'computeDaemonCodeSignature ignores source test files' , ( ) => {
1056- const root = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'agent-device-daemon-signature-tests-' ) ) ;
1057- try {
1058- const daemonEntryPath = path . join ( root , 'src' , 'daemon.ts' ) ;
1059- const runtimePath = path . join ( root , 'src' , 'platforms' , 'ios' , 'perf.ts' ) ;
1060- const testPath = path . join ( root , 'src' , 'platforms' , 'ios' , '__tests__' , 'perf.test.ts' ) ;
1061- fs . mkdirSync ( path . dirname ( testPath ) , { recursive : true } ) ;
1062- fs . writeFileSync ( daemonEntryPath , 'console.log("daemon");\n' , 'utf8' ) ;
1063- fs . writeFileSync ( runtimePath , 'export const value = 1;\n' , 'utf8' ) ;
1064- fs . writeFileSync ( testPath , 'export const ignored = 1;\n' , 'utf8' ) ;
1065-
1066- const firstSignature = computeDaemonCodeSignature ( daemonEntryPath , root ) ;
1067- fs . writeFileSync ( testPath , 'export const ignored = 2;\n' , 'utf8' ) ;
1068- const secondSignature = computeDaemonCodeSignature ( daemonEntryPath , root ) ;
1069-
1070- assert . equal ( secondSignature , firstSignature ) ;
1041+ const signature = computeDaemonCodeSignature ( daemonEntryPath , root ) ;
1042+ assert . match ( signature , / ^ d i s t \/ s r c \/ d a e m o n \. j s : \d + : \d + $ / ) ;
10711043 } finally {
10721044 fs . rmSync ( root , { recursive : true , force : true } ) ;
10731045 }
0 commit comments