@@ -19,7 +19,8 @@ const archiver = require("../helpers/archiver"),
1919 downloadBuildArtifacts = require ( '../helpers/buildArtifacts' ) . downloadBuildArtifacts ,
2020 downloadBuildStacktrace = require ( '../helpers/downloadBuildStacktrace' ) . downloadBuildStacktrace ,
2121 updateNotifier = require ( 'update-notifier' ) ,
22- pkg = require ( '../../package.json' ) ;
22+ pkg = require ( '../../package.json' ) ,
23+ packageDiff = require ( '../helpers/package-diff' ) ;
2324const { getStackTraceUrl } = require ( '../helpers/sync/syncSpecsLogs' ) ;
2425
2526module . exports = function run ( args , rawArgs ) {
@@ -158,13 +159,21 @@ module.exports = function run(args, rawArgs) {
158159 // Archive the spec files
159160 logger . debug ( "Started archiving test suite" ) ;
160161 markBlockStart ( 'zip.archive' ) ;
161- return archiver . archive ( bsConfig . run_settings , config . fileName , args . exclude , md5data ) . then ( function ( data ) {
162+ return archiver . archive ( bsConfig . run_settings , config . fileName , args . exclude , md5data ) . then ( async function ( data ) {
162163 logger . debug ( "Completed archiving test suite" ) ;
163164 markBlockEnd ( 'zip.archive' ) ;
164165
165166 let test_zip_size = utils . fetchZipSize ( path . join ( process . cwd ( ) , config . fileName ) ) ;
166167 let npm_zip_size = utils . fetchZipSize ( path . join ( process . cwd ( ) , config . packageFileName ) ) ;
167-
168+ let node_modules_size = await utils . fetchFolderSize ( path . join ( process . cwd ( ) , "node_modules" ) )
169+
170+ //Package diff
171+ let isPackageDiff = false ;
172+ if ( ! md5data . zipUrlPresent ) {
173+ isPackageDiff = packageDiff . run ( `package.json` , `${ config . packageDirName } /package.json` ) ;
174+ logger . debug ( `Package difference was ${ isPackageDiff ? `found` : `not found` } ` ) ;
175+ }
176+
168177 // Uploaded zip file
169178 logger . debug ( "Started uploading the test suite zip" ) ;
170179 logger . debug ( "Started uploading the node_module zip" ) ;
@@ -267,9 +276,13 @@ module.exports = function run(args, rawArgs) {
267276 build_id : data . build_id ,
268277 test_zip_size : test_zip_size ,
269278 npm_zip_size : npm_zip_size ,
279+ node_modules_size : node_modules_size ,
270280 test_suite_zip_upload : md5data . zipUrlPresent ? 0 : 1 ,
271281 package_zip_upload : md5data . packageUrlPresent ? 0 : 1
272282 } ;
283+ if ( dataToSend . test_suite_zip_upload === 1 ) {
284+ dataToSend [ 'is_package_diff' ] = isPackageDiff ;
285+ }
273286
274287 if ( ! md5data . zipUrlPresent && zip . tests_upload_time ) {
275288 dataToSend . test_suite_zip_size = parseFloat ( ( test_zip_size / 1024 ) . toFixed ( 2 ) ) ;
0 commit comments