@@ -183,7 +183,7 @@ def launch(self):
183
183
Path (self .job [1 ]).rename (Path (self .params ['output' ]))
184
184
else :
185
185
print ("none of our files found in the error message!" )
186
- else :
186
+ elif self . job [ 2 ] :
187
187
for one_file in [self .job [0 ], self .job [1 ]]:
188
188
print ('cleaning up' )
189
189
cleanup_file = Path (one_file )
@@ -196,6 +196,9 @@ def launch(self):
196
196
print ('file gone' )
197
197
else :
198
198
print (f'file { str (cleanup_file )} already gone?' )
199
+ print (f"skipping { self .job [0 ]} " )
200
+ else :
201
+ print (f"skipping this layer with { self .job [0 ]} { self .job [1 ]} " )
199
202
print (f"launch(): returning { ret } " )
200
203
return ret
201
204
@@ -279,14 +282,16 @@ def combine_coverage_dirs_multi(cfg,
279
282
if len (sub_jobs ) == 1 :
280
283
print (sub_jobs )
281
284
return sub_jobs [0 ]
285
+ layer = 0
282
286
while len (sub_jobs ) > 1 :
283
287
next_jobs = []
284
288
jobs .append ([])
285
289
while len (sub_jobs ) > 1 :
286
290
last_output = combined_dir / f'{ jobcount } '
287
291
this_subjob = [str (sub_jobs .pop ()),
288
292
str (sub_jobs .pop ()),
289
- str (last_output )]
293
+ str (last_output ),
294
+ count < 5 ]
290
295
jobs [count ].append (this_subjob )
291
296
next_jobs .append (this_subjob [2 ])
292
297
jobcount += 1
@@ -346,39 +351,8 @@ def convert_lcov_to_cobertura(cfg, lcov_file, source_dir, binary, cobertura_xml,
346
351
cov = LcovCobertura (cfg )
347
352
cov .launch (lcov_file , source_dir , binary , cobertura_xml , excludes )
348
353
349
- def main ():
350
- """ go """
351
- # pylint disable=too-many-locals disable=too-many-statements
352
- base_dir = Path (sys .argv [1 ])
353
- os .chdir (base_dir )
354
- coverage_dir = base_dir / 'coverage'
355
- if coverage_dir .exists ():
356
- shutil .rmtree (str (coverage_dir ))
357
- coverage_dir .mkdir ()
358
- gcov_dir = base_dir / sys .argv [2 ]
359
- #try:
360
- # shutil.make_archive("/work/testresults2124",
361
- # 'tar.gz',
362
- # "/work/gcov",
363
- # "/work/gcov",
364
- # True)
365
- #except Exception as ex:
366
- # print(f"Failed to create zip: {str(ex)}")
367
- cfg = SiteConfig (gcov_dir .resolve ())
368
- #import glob
369
- #for filename in glob.iglob('/work/gcov**/**', recursive=True):
370
- # print(filename)
371
- result_dir = combine_coverage_dirs_multi (
372
- cfg ,
373
- gcov_dir ,
374
- psutil .cpu_count (logical = False ))
375
-
376
- sourcedir = base_dir / 'ArangoDB'
377
- binary = sourcedir / 'build' / 'bin' / 'arangod'
378
- lcov_file = gcov_dir / 'coverage.lcov'
379
- print ('converting to lcov file' )
380
- convert_to_lcov_file (cfg , result_dir , lcov_file )
381
- # copy the source files from the sourcecode directory
354
+ def copy_source_directory (sourcedir , coverage_dir ):
355
+ """ copy the source files from the sourcecode directory """
382
356
for copy_dir in [
383
357
Path ('lib' ),
384
358
Path ('arangosh' ),
@@ -401,7 +375,36 @@ def main():
401
375
for filename in files :
402
376
source = os .path .join (root , filename )
403
377
shutil .copy2 (source , path / filename )
378
+ print ('create a symlink into the jemalloc source:' )
379
+ jmdir = sourcedir / '3rdParty' / 'jemalloc' / 'jemalloc' / 'include'
380
+ if not jmdir .exists ():
381
+ jmdir = list ((sourcedir / '3rdParty' / 'jemalloc' ).glob ('v*' ))[0 ] / 'include'
382
+ (sourcedir / 'include' ).symlink_to (jmdir )
404
383
384
+ def main ():
385
+ """ go """
386
+ # pylint disable=too-many-locals disable=too-many-statements
387
+ base_dir = Path (sys .argv [1 ])
388
+ os .chdir (base_dir )
389
+ coverage_dir = base_dir / 'coverage'
390
+ if coverage_dir .exists ():
391
+ shutil .rmtree (str (coverage_dir ))
392
+ coverage_dir .mkdir ()
393
+ gcov_dir = base_dir / sys .argv [2 ]
394
+ cfg = SiteConfig (gcov_dir .resolve ())
395
+ result_dir = combine_coverage_dirs_multi (
396
+ cfg ,
397
+ gcov_dir ,
398
+ psutil .cpu_count (logical = False ))
399
+
400
+ sourcedir = base_dir / 'ArangoDB'
401
+ binary = sourcedir / 'build' / 'bin' / 'arangod'
402
+ lcov_file = gcov_dir / 'coverage.lcov'
403
+
404
+ copy_source_directory (sourcedir , coverage_dir )
405
+
406
+ print ('converting to lcov file' )
407
+ convert_to_lcov_file (cfg , result_dir , lcov_file )
405
408
print ('copy the gcno files from the build directory' )
406
409
buildir = sourcedir / 'build'
407
410
baselen = len (str (buildir ))
@@ -413,12 +416,6 @@ def main():
413
416
source = os .path .join (root , filename )
414
417
shutil .copy2 (source , path / filename )
415
418
416
- print ('create a symlink into the jemalloc source:' )
417
- jmdir = sourcedir / '3rdParty' / 'jemalloc' / 'jemalloc' / 'include'
418
- if not jmdir .exists ():
419
- jmdir = list ((sourcedir / '3rdParty' / 'jemalloc' ).glob ('v*' ))[0 ] / 'include'
420
- (sourcedir / 'include' ).symlink_to (jmdir )
421
-
422
419
cobertura_xml = coverage_dir / 'coverage.xml'
423
420
print ('converting to cobertura report' )
424
421
convert_lcov_to_cobertura (cfg , lcov_file ,
0 commit comments