From 11091b70007a02ffcd48c02a833cd8fa918a9b1d Mon Sep 17 00:00:00 2001 From: Julien Duraj Date: Tue, 31 Jan 2017 13:28:11 +0000 Subject: ART: Update postbuild groovy scripts - Cleanup the out of date inline groovy code in some of the jjb's. - Rename the postbuild.groovy script to tests.groovy as it relates particularly to host and target tests. - Add another groovy file: global.groovy that applies to all linaro-art builds. Change-Id: Icb624357f5b26a8fc999e00b71fe061297650097 --- linaro-art-stable-build-ARTHostTest.yaml | 5 +- linaro-art-stable-build-ARTTargetTest.yaml | 5 +- linaro-art-stable-build-ARTVixlTest.yaml | 22 +------- linaro-art-stable-build-MicroBenchmarks.yaml | 35 +----------- linaro-art-testing-presubmit-test.yaml | 4 ++ linaro-art-tip-build-ARTHostTest.yaml | 5 +- linaro-art-tip-build-ARTTargetTest.yaml | 5 +- linaro-art-tip-build-ARTVIXL32HostTest.yaml | 5 +- linaro-art-tip-build-ARTVIXL32TargetTest.yaml | 5 +- linaro-art-tip-build-ARTVixlTest.yaml | 22 +------- ...t-tip-build-MicroBenchmarks-Baseline-intel.yaml | 35 +----------- linaro-art-tip-build-MicroBenchmarks-Baseline.yaml | 35 +----------- linaro-art-tip-build-MicroBenchmarks.yaml | 35 +----------- linaro-art-vixl-art-host-test.yaml | 5 +- linaro-art-vixl-art-target-test.yaml | 5 +- linaro-art-vixl-test.yaml | 4 ++ linaro-art-vixlpresubmit-macos.yaml | 4 ++ linaro-art-vixlpresubmit-native-armv8.yaml | 4 ++ linaro-art-vixlpresubmit.yaml | 4 ++ linaro-art/global.groovy | 4 ++ linaro-art/postbuild.groovy | 65 ---------------------- linaro-art/tests.groovy | 65 ++++++++++++++++++++++ 22 files changed, 139 insertions(+), 239 deletions(-) create mode 100644 linaro-art/global.groovy delete mode 100644 linaro-art/postbuild.groovy create mode 100644 linaro-art/tests.groovy diff --git a/linaro-art-stable-build-ARTHostTest.yaml b/linaro-art-stable-build-ARTHostTest.yaml index cc06224fd4..08abaa3724 100644 --- a/linaro-art-stable-build-ARTHostTest.yaml +++ b/linaro-art-stable-build-ARTHostTest.yaml @@ -152,4 +152,7 @@ unstable-on-warning: false fail-on-error: false - groovy-postbuild: - script: !include-raw: linaro-art/postbuild.groovy + script: + !include-raw: + - linaro-art/tests.groovy + - linaro-art/global.groovy diff --git a/linaro-art-stable-build-ARTTargetTest.yaml b/linaro-art-stable-build-ARTTargetTest.yaml index bcccffcd81..945f62aa1e 100644 --- a/linaro-art-stable-build-ARTTargetTest.yaml +++ b/linaro-art-stable-build-ARTTargetTest.yaml @@ -159,4 +159,7 @@ unstable-on-warning: false fail-on-error: false - groovy-postbuild: - script: !include-raw: linaro-art/postbuild.groovy + script: + !include-raw: + - linaro-art/tests.groovy + - linaro-art/global.groovy diff --git a/linaro-art-stable-build-ARTVixlTest.yaml b/linaro-art-stable-build-ARTVixlTest.yaml index aee0a91701..e412531258 100644 --- a/linaro-art-stable-build-ARTVixlTest.yaml +++ b/linaro-art-stable-build-ARTVixlTest.yaml @@ -159,25 +159,9 @@ unstable-on-warning: false fail-on-error: false - groovy-postbuild: - script: | - import hudson.model.* - - def matcher = manager.getLogMatcher(".*repo sync failed.*") - if ( matcher?.matches()) { - manager.addShortText("repo sync failed") - } - matcher = manager.getLogMatcher(".*patch merge failed.*") - if ( matcher?.matches()) { - manager.addShortText("merge failed") - } - matcher = manager.getLogMatcher(".*make failed.*") - if ( matcher?.matches()) { - manager.addShortText("make failed") - } - matcher = manager.getLogMatcher(".*images failed to boot.*") - if ( matcher?.matches()) { - manager.addShortText("Boot test failed") - } + script: + !include-raw: + - linaro-art/global.groovy - plot: - title: 'Sync Time' group: 'Time Measurements' diff --git a/linaro-art-stable-build-MicroBenchmarks.yaml b/linaro-art-stable-build-MicroBenchmarks.yaml index 156e6fee1b..1a81717f77 100644 --- a/linaro-art-stable-build-MicroBenchmarks.yaml +++ b/linaro-art-stable-build-MicroBenchmarks.yaml @@ -165,38 +165,9 @@ unstable-on-warning: false fail-on-error: false - groovy-postbuild: - script: | - import hudson.model.* - def currentBuild = Thread.currentThread().executable - def description = "" - def matcher = manager.getLogMatcher(".*repo sync failed.*") - if ( matcher?.matches()) { - manager.addShortText("repo sync failed") - } - matcher = manager.getLogMatcher(".*patch merge failed.*") - if ( matcher?.matches()) { - manager.addShortText("merge failed") - } - matcher = manager.getLogMatcher(".*error: no devices/emulators found.*") - if ( matcher?.matches()) { - manager.addShortText("No Device Found") - } - matcher = manager.getLogMatcher(".*buildbot-build setup failed.*") - if ( matcher?.matches()) { - manager.addShortText("buildbot-build setup failed.") - } - matcher = manager.getLogMatcher(".* tests have failed") - if (matcher?.matches()) { - def test = matcher.group(0).split(" ") - manager.listener.logger.println test.length - i=0 - while( i - if (currentLineIsFailedTest) { - matcher = testPattern.matcher(line) - if (matcher?.matches()) { - testFailedList << matcher.group(1) - } else { - currentLineIsFailedTest = false - } - } - - matcher = errorSectionPattern.matcher(line) - if (matcher?.matches()) { - errorList << matcher.group(1) - } - - matcher = testFailedPattern.matcher(line) - if (matcher?.matches()) { - currentLineIsFailedTest = true - testsFailed = true - } -} - -if (manager.logContains(".*Unable to determine architecture.*")) { - manager.addWarningBadge("Unable to determine architecture bug was triggered.") -} - -errorList.each { - manager.addShortText(it, "white", "red", "1px", "grey") -} - -if (testFailedList.size() <= MAX_TEST_FAILURES_DISPLAY) { - testFailedList.each { - manager.addShortText(it) - } -} else { - manager.addShortText("More than " + MAX_TEST_FAILURES_DISPLAY + " test failures") -} - -if (!testsFailed) { - def matcher = manager.getLogMatcher(makeErrorPattern) - if ( matcher?.matches()) { - manager.addShortText(matcher.group(1), "black", "silver", "1px", "grey") - } - matcher = manager.getLogMatcher(failedCommandPattern) - if (matcher?.matches()) { - manager.addShortText(matcher.group(1), "black", "orange", "1px", "red") - } -} diff --git a/linaro-art/tests.groovy b/linaro-art/tests.groovy new file mode 100644 index 0000000000..d0e0613db6 --- /dev/null +++ b/linaro-art/tests.groovy @@ -0,0 +1,65 @@ +import java.util.regex.Pattern + +def MAX_TEST_FAILURES_DISPLAY = 5 + +def testFailedPattern = Pattern.compile("FAILING TESTS") +def errorSectionPattern = Pattern.compile("ERROR: Section: (.*) FAILED.*") +def testPattern = Pattern.compile(".*debuggable-(.*)") + +def makeErrorPattern = ".*" + Pattern.quote("make: *** [") + "(.*)" + Pattern.quote("]") + ".*" +def failedCommandPattern = "ERROR: Failed command: (.*)" + +def currentLineIsFailedTest = false +def testsFailed = false + +def errorList = [] +def testFailedList = [] + +manager.build.logFile.eachLine { line -> + if (currentLineIsFailedTest) { + matcher = testPattern.matcher(line) + if (matcher?.matches()) { + testFailedList << matcher.group(1) + } else { + currentLineIsFailedTest = false + } + } + + matcher = errorSectionPattern.matcher(line) + if (matcher?.matches()) { + errorList << matcher.group(1) + } + + matcher = testFailedPattern.matcher(line) + if (matcher?.matches()) { + currentLineIsFailedTest = true + testsFailed = true + } +} + +if (manager.logContains(".*Unable to determine architecture.*")) { + manager.addWarningBadge("Unable to determine architecture bug was triggered.") +} + +errorList.each { + manager.addShortText(it, "white", "red", "1px", "grey") +} + +if (testFailedList.size() <= MAX_TEST_FAILURES_DISPLAY) { + testFailedList.each { + manager.addShortText(it) + } +} else { + manager.addShortText("More than " + MAX_TEST_FAILURES_DISPLAY + " test failures") +} + +if (!testsFailed) { + def matcher = manager.getLogMatcher(makeErrorPattern) + if ( matcher?.matches()) { + manager.addShortText(matcher.group(1), "black", "silver", "1px", "grey") + } + matcher = manager.getLogMatcher(failedCommandPattern) + if (matcher?.matches()) { + manager.addShortText(matcher.group(1), "black", "orange", "1px", "red") + } +} -- cgit v1.2.3