Adding coverage only on full test

Cette révision appartient à :
Dirk Alders 2025-08-31 15:03:14 +02:00
Parent a41c76fcd0
révision 630259881d
2 fichiers modifiés avec 10 ajouts et 4 suppressions

Voir le fichier

@ -8,6 +8,9 @@ release:
cp -v $(OUTDIR)/testrun.json ../smart_brain/_testresults_ cp -v $(OUTDIR)/testrun.json ../smart_brain/_testresults_
cp -v $(OUTDIR)/coverage.xml ../smart_brain/_testresults_ cp -v $(OUTDIR)/coverage.xml ../smart_brain/_testresults_
clean_coverage:
rm -v testresults/coverage.xml
single: test_single pdf view clean single: test_single pdf view clean
@echo FINISHED... @echo FINISHED...
@ -17,7 +20,7 @@ smoke: test_smoke pdf view clean
short: test_short pdf view clean short: test_short pdf view clean
@echo FINISHED... @echo FINISHED...
full: test_full pdf view clean full: clean_coverage test_full pdf view clean
@echo FINISHED... @echo FINISHED...
test_single: test_single:

Voir le fichier

@ -54,7 +54,9 @@ if __name__ == "__main__":
# #
# Testsuite # Testsuite
# #
ts = tests.help.testSession(mc, tcel=tcel.get(args.level)) test_level = tcel.get(args.level)
add_coverage = test_level == report.TCEL_FULL
ts = tests.help.testSession(mc, tcel=test_level)
# Add and run tests # Add and run tests
tests.add_all_testcases(ts, mc, h) tests.add_all_testcases(ts, mc, h)
@ -65,10 +67,11 @@ if __name__ == "__main__":
# #
# Stop smart_brain execution # Stop smart_brain execution
mc.send(STOP_EXECUTION_TOPIC, json.dumps(True)) mc.send(STOP_EXECUTION_TOPIC, json.dumps(True))
if add_coverage:
time.sleep(2) # give smart_brain time to create coverage xml file time.sleep(2) # give smart_brain time to create coverage xml file
# #
coverage_file = os.path.join(BASEPATH, "testresults", "coverage.xml") coverage_file = os.path.join(BASEPATH, "testresults", "coverage.xml")
if os.path.exists(coverage_file): if os.path.exists(coverage_file) and add_coverage:
ts.full_test_data[unittest.jsonlog.MAIN_KEY_COVERAGE_INFO] = unittest.run.coverage_info(coverage_file, None) ts.full_test_data[unittest.jsonlog.MAIN_KEY_COVERAGE_INFO] = unittest.run.coverage_info(coverage_file, None)
# #