@@ -19,7 +19,8 @@ const archiver = require("../helpers/archiver"),
19
19
downloadBuildArtifacts = require ( '../helpers/buildArtifacts' ) . downloadBuildArtifacts ,
20
20
downloadBuildStacktrace = require ( '../helpers/downloadBuildStacktrace' ) . downloadBuildStacktrace ,
21
21
updateNotifier = require ( 'update-notifier' ) ,
22
- pkg = require ( '../../package.json' ) ;
22
+ pkg = require ( '../../package.json' ) ,
23
+ packageDiff = require ( '../helpers/package-diff' ) ;
23
24
const { getStackTraceUrl } = require ( '../helpers/sync/syncSpecsLogs' ) ;
24
25
25
26
module . exports = function run ( args , rawArgs ) {
@@ -158,13 +159,21 @@ module.exports = function run(args, rawArgs) {
158
159
// Archive the spec files
159
160
logger . debug ( "Started archiving test suite" ) ;
160
161
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 ) {
162
163
logger . debug ( "Completed archiving test suite" ) ;
163
164
markBlockEnd ( 'zip.archive' ) ;
164
165
165
166
let test_zip_size = utils . fetchZipSize ( path . join ( process . cwd ( ) , config . fileName ) ) ;
166
167
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
+
168
177
// Uploaded zip file
169
178
logger . debug ( "Started uploading the test suite zip" ) ;
170
179
logger . debug ( "Started uploading the node_module zip" ) ;
@@ -267,9 +276,13 @@ module.exports = function run(args, rawArgs) {
267
276
build_id : data . build_id ,
268
277
test_zip_size : test_zip_size ,
269
278
npm_zip_size : npm_zip_size ,
279
+ node_modules_size : node_modules_size ,
270
280
test_suite_zip_upload : md5data . zipUrlPresent ? 0 : 1 ,
271
281
package_zip_upload : md5data . packageUrlPresent ? 0 : 1
272
282
} ;
283
+ if ( dataToSend . test_suite_zip_upload === 1 ) {
284
+ dataToSend [ 'is_package_diff' ] = isPackageDiff ;
285
+ }
273
286
274
287
if ( ! md5data . zipUrlPresent && zip . tests_upload_time ) {
275
288
dataToSend . test_suite_zip_size = parseFloat ( ( test_zip_size / 1024 ) . toFixed ( 2 ) ) ;
0 commit comments