@@ -183,7 +183,7 @@ def launch(self):
183183 Path (self .job [1 ]).rename (Path (self .params ['output' ]))
184184 else :
185185 print ("none of our files found in the error message!" )
186- else :
186+ elif self . job [ 2 ] :
187187 for one_file in [self .job [0 ], self .job [1 ]]:
188188 print ('cleaning up' )
189189 cleanup_file = Path (one_file )
@@ -196,6 +196,9 @@ def launch(self):
196196 print ('file gone' )
197197 else :
198198 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 ]} " )
199202 print (f"launch(): returning { ret } " )
200203 return ret
201204
@@ -279,14 +282,16 @@ def combine_coverage_dirs_multi(cfg,
279282 if len (sub_jobs ) == 1 :
280283 print (sub_jobs )
281284 return sub_jobs [0 ]
285+ layer = 0
282286 while len (sub_jobs ) > 1 :
283287 next_jobs = []
284288 jobs .append ([])
285289 while len (sub_jobs ) > 1 :
286290 last_output = combined_dir / f'{ jobcount } '
287291 this_subjob = [str (sub_jobs .pop ()),
288292 str (sub_jobs .pop ()),
289- str (last_output )]
293+ str (last_output ),
294+ count < 5 ]
290295 jobs [count ].append (this_subjob )
291296 next_jobs .append (this_subjob [2 ])
292297 jobcount += 1
@@ -346,39 +351,8 @@ def convert_lcov_to_cobertura(cfg, lcov_file, source_dir, binary, cobertura_xml,
346351 cov = LcovCobertura (cfg )
347352 cov .launch (lcov_file , source_dir , binary , cobertura_xml , excludes )
348353
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 """
382356 for copy_dir in [
383357 Path ('lib' ),
384358 Path ('arangosh' ),
@@ -401,7 +375,36 @@ def main():
401375 for filename in files :
402376 source = os .path .join (root , filename )
403377 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 )
404383
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 )
405408 print ('copy the gcno files from the build directory' )
406409 buildir = sourcedir / 'build'
407410 baselen = len (str (buildir ))
@@ -413,12 +416,6 @@ def main():
413416 source = os .path .join (root , filename )
414417 shutil .copy2 (source , path / filename )
415418
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-
422419 cobertura_xml = coverage_dir / 'coverage.xml'
423420 print ('converting to cobertura report' )
424421 convert_lcov_to_cobertura (cfg , lcov_file ,
0 commit comments