From 22c93cc39ffd8998ef4432c086758bdd59dc9f65 Mon Sep 17 00:00:00 2001 From: Joan Edwards Date: Mon, 12 Oct 2020 16:02:51 +0100 Subject: [PATCH 1/2] Remove test result combination script --- devops/scripts/combine-junit-test-results.sh | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100755 devops/scripts/combine-junit-test-results.sh diff --git a/devops/scripts/combine-junit-test-results.sh b/devops/scripts/combine-junit-test-results.sh deleted file mode 100755 index 1571307c37..0000000000 --- a/devops/scripts/combine-junit-test-results.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -u -set -e - - -# Directory should already exist, from the CI Molecule scenario, -# but let's be certain. -mkdir -p junit - -# Combine tests for export as artifacts. There are at least two XML files, -# one from the application tests, and another from the config tests. -./devops/scripts/combine-junit.py ./*results.xml > ./junit/junit.xml From 9e088017d339d6abdccee919cc335b9a03b6d6ef Mon Sep 17 00:00:00 2001 From: Joan Edwards Date: Thu, 15 Oct 2020 17:34:36 +0100 Subject: [PATCH 2/2] Remove combine-junit --- devops/scripts/combine-junit.py | 68 --------------------------------- 1 file changed, 68 deletions(-) delete mode 100755 devops/scripts/combine-junit.py diff --git a/devops/scripts/combine-junit.py b/devops/scripts/combine-junit.py deleted file mode 100755 index b97fdb7d29..0000000000 --- a/devops/scripts/combine-junit.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python -# -# Corey Goldberg, Dec 2012 -# Original source from gist.github.com/cgoldberg/4320815 - -import os -import sys -import xml.etree.ElementTree as ET - - -"""Merge multiple JUnit XML files into a single results file. - -Output dumps to sdtdout. - -example usage: - $ python merge_junit_results.py results1.xml results2.xml > results.xml -""" - - -def main(): - args = sys.argv[1:] - if not args: - usage() - sys.exit(2) - if '-h' in args or '--help' in args: - usage() - sys.exit(2) - merge_results(args[:]) - - -def merge_results(xml_files): - failures = 0 - tests = 0 - errors = 0 - time = 0.0 - cases = [] - - for file_name in xml_files: - # We disable bandit checking to permit B314, which recommends use - # of defusedxml to protect against malicious XML files. This code - # path only runs in CI, not on developer workstations, and the XML - # output is generated by testinfra on staging machines. - tree = ET.parse(file_name) # nosec - test_suite = tree.getroot() - failures += int(test_suite.attrib['failures']) - tests += int(test_suite.attrib['tests']) - errors += int(test_suite.attrib['errors']) - time += float(test_suite.attrib['time']) - cases.append(test_suite.getchildren()) - - new_root = ET.Element('testsuite') - new_root.attrib['failures'] = '%s' % failures - new_root.attrib['tests'] = '%s' % tests - new_root.attrib['errors'] = '%s' % errors - new_root.attrib['time'] = '%s' % time - for case in cases: - new_root.extend(case) - new_tree = ET.ElementTree(new_root) - ET.dump(new_tree) - - -def usage(): - this_file = os.path.basename(__file__) - print('Usage: %s results1.xml results2.xml' % this_file) - - -if __name__ == '__main__': - main()