Possible issue with launcher, color formatting, Jenkins, and Sauce Connect #1131
Description
Overview
This issue could be caused by many things but starting here. I am attempting to run protractor on Jenkins with Sauce Connect. I am outputting the sauce id and job name like so:
onComplete: function(runner, log) {
browser.getSession().then(function(session) {
console.log("SauceOnDemandSessionID=" + session.getId() + " job-name=Jenkins");
});
},
All tests pass, but Jenkins has trouble parsing the test results. The log is below, but specifically the line in question is:
java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence near index 16
\b(Jenkins)\b
Although you can't see it, the Regex parsing is failing because of symbols added for coloring the console output. Specially [0m
is causing the error.
Previously this Jenkins job worked fine. You can see the job name being parsed before and after below:
It's worth noting the last successful test ran on June 13th. This would have been using protractor version 0.24.1. I pulled a diff for all changes since: 24248d6...master
Possible Cause
I think this line is the culprit. It's new since version 0.24.1 and does appear in the above diff: 24248d6...master#diff-ff5050d3c7f51fca90c4691a4599e852R317
Full Stack For Reference
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome35 #1 passed
[launcher] firefox29 #2 passed
[launcher] safari6 #3 passed
[launcher] chrome35 #4 passed
[launcher] firefox30 #5 passed
[launcher] internet explorer11 #6 passed
[launcher] internet explorer11 #7 passed
[launcher] internet explorer10 #8 passed
Done, without errors.
Execution Time (2014-07-30 18:59:12 UTC)
protractor:sauce 301.7s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100%
Total 302s
Shutting down Sauce Connect
Decremented process count for spmatt, now 0
Flushing Sauce Connect Input Stream
Flushing Sauce Connect Error Stream
Closing Sauce Connect process
Sauce Connect stopped for: spmatt
Recording test results
ERROR: Publisher hudson.tasks.junit.JUnitResultArchiver aborted due to exception
java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence near index 16
\b(Jenkins)\b
^
at java.util.regex.Pattern.error(Pattern.java:1924)
at java.util.regex.Pattern.escape(Pattern.java:2416)
at java.util.regex.Pattern.range(Pattern.java:2577)
at java.util.regex.Pattern.clazz(Pattern.java:2507)
at java.util.regex.Pattern.sequence(Pattern.java:2030)
at java.util.regex.Pattern.expr(Pattern.java:1964)
at java.util.regex.Pattern.group0(Pattern.java:2854)
at java.util.regex.Pattern.sequence(Pattern.java:2018)
at java.util.regex.Pattern.expr(Pattern.java:1964)
at java.util.regex.Pattern.compile(Pattern.java:1665)
at java.util.regex.Pattern.<init>(Pattern.java:1337)
at java.util.regex.Pattern.compile(Pattern.java:1022)
at hudson.plugins.sauce_ondemand.SauceOnDemandReportPublisher.hasTestPassed(SauceOnDemandReportPublisher.java:167)
at hudson.plugins.sauce_ondemand.SauceOnDemandReportPublisher.processBuildOutput(SauceOnDemandReportPublisher.java:128)
at hudson.plugins.sauce_ondemand.SauceOnDemandReportPublisher.getTestData(SauceOnDemandReportPublisher.java:89)
at hudson.plugins.sauce_ondemand.SauceOnDemandReportPublisher.getTestData(SauceOnDemandReportPublisher.java:55)
at hudson.tasks.junit.JUnitResultArchiver.perform(JUnitResultArchiver.java:147)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:736)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:685)
at hudson.model.Run.execute(Run.java:1757)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:234)
Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered