From 8a8d308365e071e7d16c7a07eda231567d1c0650 Mon Sep 17 00:00:00 2001 From: Winston Li Date: Thu, 16 Feb 2017 09:16:51 +0000 Subject: [PATCH] Remove old printing from failing test --- .../WLGitBridgeIntegrationTest.java | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeIntegrationTest.java b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeIntegrationTest.java index 6af9e24e44..cc5a726cc6 100644 --- a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeIntegrationTest.java +++ b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeIntegrationTest.java @@ -686,26 +686,10 @@ public class WLGitBridgeIntegrationTest { gitCommit(sub, "sub"); gitAdd(testprojDir); gitCommit(testprojDir, "push"); - Process gitPush = runtime.exec("git push -v --progress", null, testprojDir); - int pushExitCode = gitPush.waitFor(); + Process push = gitPush(testprojDir, 1); wlgb.stop(); - /* TODO: remove this entire conditional, remove -v and --progress flags (:658), remove subList call (:676) */ - if (pushExitCode != 1) { - String stdout = IOUtils.toString(gitPush.getInputStream(), StandardCharsets.UTF_8); - String stderr = IOUtils.toString(gitPush.getErrorStream(), StandardCharsets.UTF_8); - /* Print to stderr to avoid log config */ - System.err.println("===== Git exit code was not 1, it was: " + pushExitCode + " ====="); - System.err.println("===== Failing test ====="); - System.err.println("===== stdout (" + stdout.length() + " chars) ====="); - System.err.println(stdout); - System.err.println("===== stderr: (" + stderr.length() + " chars) ====="); - System.err.println(stderr); - fail(); - return; - } - assertEquals(1, pushExitCode); - List actual = Util.linesFromStream(gitPush.getErrorStream(), 2, "[K"); - assertEquals(EXPECTED_OUT_PUSH_SUBMODULE, actual.subList(actual.size() - 6, actual.size())); + List actual = Util.linesFromStream(push.getErrorStream(), 2, "[K"); + assertEquals(EXPECTED_OUT_PUSH_SUBMODULE, actual); wlgb.stop(); }