mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
+1
-1
@@ -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);
|
||||
|
||||
@@ -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
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user