ssa test ci cd

This commit is contained in:
P4T12ICK
2021-11-24 15:14:31 +01:00
parent 704e469362
commit 1fa6e25756
+19 -19
View File
@@ -71,27 +71,27 @@ def main(args):
# if not test_result_passed:
# sys.exit(1)
# # test SSA detections
# test_results = []
# test_passed = True
# for test_file in test_files_ssa:
# test_obj, attack_data_folder = prepare_test(test_file)
# test_result = ssa_detection_testing.test_ssa_detections(test_obj)
# test_results.append(test_result.copy())
# remove_attack_data(attack_data_folder)
# test SSA detections
test_results = []
test_passed = True
for test_file in test_files_ssa:
test_obj, attack_data_folder = prepare_test(test_file)
test_result = ssa_detection_testing.test_ssa_detections(test_obj)
test_results.append(test_result.copy())
remove_attack_data(attack_data_folder)
# LOGGER.info('-----------------------------------')
# LOGGER.info('------- test SSA detections -------')
# LOGGER.info('-----------------------------------')
# for test_result in test_results:
# test_passed = test_passed and test_result['result']
# LOGGER.info(test_result['msg'])
# LOGGER.info('-----------------------------------')
LOGGER.info('-----------------------------------')
LOGGER.info('------- test SSA detections -------')
LOGGER.info('-----------------------------------')
for test_result in test_results:
test_passed = test_passed and test_result['result']
LOGGER.info(test_result['msg'])
LOGGER.info('-----------------------------------')
# if github_service.created_repo:
# remove_security_content()
# exit_code = not test_passed
# sys.exit(exit_code)
if github_service.created_repo:
remove_security_content()
exit_code = not test_passed
sys.exit(exit_code)