Skip to content

Commit a318faa

Browse files
authored
Merge branch 'master' into packetcapture_service
2 parents 9c7e6ad + bd521f4 commit a318faa

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ off on commits in the Polycube repository:
33

44
Aasif Shaikh aasif@shaikh.cc
55
Davide Antonino Giorgio davideantonino94@gmail.com
6+
Elis Lulja elis.lulja@gmail.com
67
Francesco Messina francescomessina92@hotmail.com
78
Fulvio Risso fulvio.risso@polito.it
89
Gianluca Scopelliti gianlu.1033@gmail.com

tests/converter/to_junit.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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
3031
for 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
5053
t = TestSuite(name=args.test_suite_name,test_cases=tests)
5154
with 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)

tests/helpers_tests.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ function log_test {
4545
echo "++++TEST $1 FAILED++++" >> $test_results
4646
echo "++++TEST $1 FAILED++++" >> $test_tmp
4747
failed=true
48-
cat $test_tmp >> $test_log
4948
else
5049
test_passed=$(($test_passed+1))
5150
echo "++++TEST $1 PASSED++++"
5251
echo "++++TEST $1 PASSED++++" >> $test_results
5352
echo "++++TEST $1 PASSED++++" >> $test_tmp
5453
fi
54+
cat $test_tmp >> $test_log
5555
return $status
5656
}
5757

0 commit comments

Comments
 (0)