diff --git a/test/extended/conformance.sh b/test/extended/conformance.sh index 657bfe3e7c34..dc3397990481 100755 --- a/test/extended/conformance.sh +++ b/test/extended/conformance.sh @@ -17,6 +17,4 @@ TEST_PARALLEL="${PARALLEL_NODES:-5}" TEST_REPORT_FILE_NAME=conformance_parallel os::log::info "Running serial tests" TEST_REPORT_FILE_NAME=conformance_serial os::test::extended::run -- -suite "serial.conformance.openshift.io" -test.timeout 2h ${TEST_EXTENDED_ARGS-} || exitstatus=$? -os::test::extended::merge_junit - exit $exitstatus diff --git a/test/extended/core.sh b/test/extended/core.sh index 57fbdf57d19c..269b8fec53c5 100755 --- a/test/extended/core.sh +++ b/test/extended/core.sh @@ -19,6 +19,4 @@ os::log::info "" os::log::info "Running serial tests" TEST_REPORT_FILE_NAME=core_serial os::test::extended::run -- -suite "serial.conformance.openshift.io" -test.timeout 2h ${TEST_EXTENDED_ARGS-} || exitstatus=$? -os::test::extended::merge_junit - exit $exitstatus diff --git a/test/extended/setup.sh b/test/extended/setup.sh index a4e58827dcbe..f031014f937f 100644 --- a/test/extended/setup.sh +++ b/test/extended/setup.sh @@ -23,8 +23,6 @@ function os::test::extended::focus () { os::log::info "Running serial tests with focus ${FOCUS}" TEST_REPORT_FILE_NAME=core_parallel os::test::extended::run -- -suite "serial.conformance.openshift.io" -test.timeout 6h ${TEST_EXTENDED_ARGS-} || exitstatus=$? - os::test::extended::merge_junit - exit $exitstatus fi } @@ -39,7 +37,6 @@ function os::test::extended::setup () { os::util::ensure::built_binary_exists 'extended.test' 'test/extended/extended.test' os::util::ensure::built_binary_exists 'oadm' os::util::ensure::built_binary_exists 'oc' - os::util::ensure::built_binary_exists 'junitmerge' # ensure proper relative directories are set export KUBE_REPO_ROOT="${OS_ROOT}/vendor/k8s.io/kubernetes" @@ -238,18 +235,3 @@ function os::test::extended::test_list () { export TEST_COUNT=${#selected_tests[@]} } readonly -f os::test::extended::test_list - -# Merge all of the JUnit output files in the TEST_REPORT_DIR into a single file. -# This works around a gap in Jenkins JUnit reporter output that double counts skipped -# files until https://github.com/jenkinsci/junit-plugin/pull/54 is merged. -function os::test::extended::merge_junit () { - if [[ -z "${JUNIT_REPORT:-}" ]]; then - return - fi - local output - output="$( mktemp )" - "$( os::util::find::built_binary junitmerge )" "${TEST_REPORT_DIR}"/*.xml > "${output}" - rm "${TEST_REPORT_DIR}"/*.xml - mv "${output}" "${TEST_REPORT_DIR}/junit.xml" -} -readonly -f os::test::extended::merge_junit diff --git a/tools/junitmerge/OWNERS b/tools/junitmerge/OWNERS deleted file mode 100644 index b0633cb94c86..000000000000 --- a/tools/junitmerge/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -reviewers: - - smarterclayton -approvers: - - smarterclayton diff --git a/tools/junitmerge/junitmerge.go b/tools/junitmerge/junitmerge.go deleted file mode 100644 index 5fe862a5246f..000000000000 --- a/tools/junitmerge/junitmerge.go +++ /dev/null @@ -1,155 +0,0 @@ -package main - -import ( - "encoding/xml" - "log" - "os" - - "fmt" - "github.com/openshift/origin/tools/junitreport/pkg/api" - "sort" -) - -type uniqueSuites map[string]*suiteRuns - -func (s uniqueSuites) Merge(namePrefix string, suite *api.TestSuite) { - name := suite.Name - if len(namePrefix) > 0 { - name = namePrefix + "/" - } - existing, ok := s[name] - if !ok { - existing = newSuiteRuns(suite) - s[name] = existing - } - - existing.Merge(suite.TestCases) - - for _, suite := range suite.Children { - s.Merge(name, suite) - } -} - -type suiteRuns struct { - suite *api.TestSuite - runs map[string]*api.TestCase -} - -func newSuiteRuns(suite *api.TestSuite) *suiteRuns { - return &suiteRuns{ - suite: suite, - runs: make(map[string]*api.TestCase), - } -} - -func (r *suiteRuns) Merge(testCases []*api.TestCase) { - for _, testCase := range testCases { - existing, ok := r.runs[testCase.Name] - if !ok { - r.runs[testCase.Name] = testCase - continue - } - switch { - case testCase.SkipMessage != nil: - // if the new test is a skip, ignore it - case existing.SkipMessage != nil && testCase.SkipMessage == nil: - // always replace a skip with a non-skip - r.runs[testCase.Name] = testCase - case existing.FailureOutput == nil && testCase.FailureOutput != nil: - // replace a passing test with a failing test - r.runs[testCase.Name] = testCase - } - } -} - -func main() { - log.SetFlags(0) - suites := make(uniqueSuites) - - for _, arg := range os.Args[1:] { - f, err := os.Open(arg) - if err != nil { - log.Fatal(err) - } - defer f.Close() - d := xml.NewDecoder(f) - - for { - t, err := d.Token() - if err != nil { - log.Fatal(err) - } - if t == nil { - log.Fatalf("input file %s does not appear to be a JUnit XML file", arg) - } - // Inspect the top level DOM element and perform the appropriate action - switch se := t.(type) { - case xml.StartElement: - switch se.Name.Local { - case "testsuites": - input := &api.TestSuites{} - if err := d.DecodeElement(input, &se); err != nil { - log.Fatal(err) - } - for _, suite := range input.Suites { - suites.Merge("", suite) - } - case "testsuite": - input := &api.TestSuite{} - if err := d.DecodeElement(input, &se); err != nil { - log.Fatal(err) - } - suites.Merge("", input) - default: - log.Fatal(fmt.Errorf("unexpected top level element in %s: %s", arg, se.Name.Local)) - } - default: - continue - } - break - } - } - - var suiteNames []string - for k := range suites { - suiteNames = append(suiteNames, k) - } - sort.Sort(sort.StringSlice(suiteNames)) - output := &api.TestSuites{} - - for _, name := range suiteNames { - suite := suites[name] - - out := &api.TestSuite{ - Name: name, - NumTests: uint(len(suite.runs)), - } - - var keys []string - for k := range suite.runs { - keys = append(keys, k) - } - sort.Sort(sort.StringSlice(keys)) - - for _, k := range keys { - testCase := suite.runs[k] - out.TestCases = append(out.TestCases, testCase) - switch { - case testCase.SkipMessage != nil: - out.NumSkipped++ - case testCase.FailureOutput != nil: - out.NumFailed++ - } - out.Duration += testCase.Duration - } - output.Suites = append(output.Suites, out) - } - - e := xml.NewEncoder(os.Stdout) - e.Indent("", "\t") - if err := e.Encode(output); err != nil { - log.Fatal(err) - } - e.Flush() - fmt.Fprintln(os.Stdout) -}