Escape test output

If we test testrunner, and its output contains ##teamcity, then it is processed with Idea instead of testcase.
This commit is contained in:
Ilya.Kazakevich
2016-07-07 19:06:07 +03:00
parent c57d0747d1
commit 19434d4c74
3 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ public class PyEnvTaskRunner {
// Exception is thrown anyway, so we escape message before logging
if (e.getMessage().contains("enteredTheMatrix")) {
// .error( may lead to new exception with out of stacktrace.
logger.warn(e.getMessage().replace("##", "from test: \\##"));
logger.warn(PyEnvTestCase.escapeTestMessage(e.getMessage()));
}
else {
logger.error(e);
+7
View File
@@ -79,6 +79,13 @@ public abstract class PyEnvTestCase {
}
};
/**
* Escape test output to prevent python test be processed as test result
*/
public static String escapeTestMessage(@NotNull final String message) {
return message.replace("##", "from test: \\##");
}
protected boolean isStaging(Description description) {
try {
if (description.getTestClass().getMethod(description.getMethodName()).isAnnotationPresent(Staging.class)) {
+1 -1
View File
@@ -267,7 +267,7 @@ public final class PyToxTest extends PyEnvTestCase {
if (!stderr.isEmpty()) {
Logger.getInstance(PyToxTest.class).warn(stderr);
Logger.getInstance(PyToxTest.class).warn(PyEnvTestCase.escapeTestMessage(stderr));
}