@@ -26,7 +26,8 @@ def file_log_parser(file:str) -> dict:
2626 elif index :
2727 test_logs_results [index ] += line + "\n "
2828 return test_logs_results
29-
29+
30+ # For each test we generate a testCase parsing the output file
3031for file in TESTS_FILE .split ("\n " ):
3132 file_log = "test_log_" + "_" .join (file .split ("_" )[2 :])
3233 test = file_log_parser (file_log )
@@ -42,16 +43,13 @@ def file_log_parser(file:str) -> dict:
4243 continue
4344 else :
4445 duration = duration [:- 1 ]
45- tc = TestCase ( name = test_name , elapsed_sec = int ( duration ), status = status )
46- if status != "PASSED++++" :
47- print ( len ( test [ test_name ]))
48- tc . add_failure_info ( output = test [ test_name ] )
46+ if test_name in test :
47+ tc = TestCase ( name = test_name , elapsed_sec = int ( duration ), status = status , stdout = test [ test_name ])
48+ else :
49+ tc = TestCase ( name = test_name , elapsed_sec = int ( duration ), status = status )
4950 tests .append (tc )
51+
52+ # We create a TestSUite and we write them in a XML File
5053t = TestSuite (name = args .test_suite_name ,test_cases = tests )
5154with open ('output.xml' , 'w' ) as f :
52- TestSuite .to_file (f , [t ], prettyprint = False )
53-
54- from junitparser import JUnitXml
55-
56- xml1 = JUnitXml .fromfile ('output.xml' )
57- print (xml1 )
55+ TestSuite .to_file (f , [t ], prettyprint = False )
0 commit comments