Skip to content

Commit c09a1ef

Browse files
committed
remove logs from console
1 parent c60550d commit c09a1ef

2 files changed

Lines changed: 19 additions & 24 deletions

File tree

sdm/src/test/java/integration/com/sap/cds/sdm/utils/ShellScriptRunner.java

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,31 @@ public static int run(String scriptPath, String... args)
2929
pb.redirectErrorStream(false);
3030
Process process = pb.start();
3131

32-
// Stream stdout
32+
// Drain stdout (suppress console output)
3333
Thread stdoutThread =
3434
new Thread(
3535
() -> {
3636
try (BufferedReader reader =
3737
new BufferedReader(new InputStreamReader(process.getInputStream()))) {
38-
String line;
39-
while ((line = reader.readLine()) != null) {
40-
System.out.println("[script] " + line);
38+
while (reader.readLine() != null) {
39+
// discard
4140
}
4241
} catch (IOException e) {
43-
System.err.println("Error reading script stdout: " + e.getMessage());
42+
// ignore
4443
}
4544
});
4645

47-
// Stream stderr
46+
// Drain stderr (suppress console output)
4847
Thread stderrThread =
4948
new Thread(
5049
() -> {
5150
try (BufferedReader reader =
5251
new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
53-
String line;
54-
while ((line = reader.readLine()) != null) {
55-
System.err.println("[script-err] " + line);
52+
while (reader.readLine() != null) {
53+
// discard
5654
}
5755
} catch (IOException e) {
58-
System.err.println("Error reading script stderr: " + e.getMessage());
56+
// ignore
5957
}
6058
});
6159

@@ -107,12 +105,11 @@ public static String runAndCaptureOutput(String scriptPath, String... args)
107105
() -> {
108106
try (BufferedReader reader =
109107
new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
110-
String line;
111-
while ((line = reader.readLine()) != null) {
112-
System.err.println("[script-err] " + line);
108+
while (reader.readLine() != null) {
109+
// discard
113110
}
114111
} catch (IOException e) {
115-
System.err.println("Error reading script stderr: " + e.getMessage());
112+
// ignore
116113
}
117114
});
118115

@@ -156,11 +153,10 @@ public static Result runAndCaptureAll(String scriptPath, String... args)
156153
new BufferedReader(new InputStreamReader(process.getInputStream()))) {
157154
String line;
158155
while ((line = reader.readLine()) != null) {
159-
System.out.println("[script] " + line);
160156
stdoutLines.add(line);
161157
}
162158
} catch (IOException e) {
163-
System.err.println("Error reading script stdout: " + e.getMessage());
159+
// ignore
164160
}
165161
});
166162

@@ -169,12 +165,11 @@ public static Result runAndCaptureAll(String scriptPath, String... args)
169165
() -> {
170166
try (BufferedReader reader =
171167
new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
172-
String line;
173-
while ((line = reader.readLine()) != null) {
174-
System.err.println("[script-err] " + line);
168+
while (reader.readLine() != null) {
169+
// discard
175170
}
176171
} catch (IOException e) {
177-
System.err.println("Error reading script stderr: " + e.getMessage());
172+
// ignore
178173
}
179174
});
180175

sdm/src/test/java/integration/com/sap/cds/sdm/utils/cf-subscribe.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ IFS=',' read -ra _emails_raw <<< "${ROLE_ASSIGNMENT_EMAILS:-}"
105105
IFS=',' read -ra _colls_raw <<< "${ROLE_COLLECTION_NAME:-}"
106106

107107
EMAILS_ARRAY=()
108-
for _e in "${_emails_raw[@]}"; do
109-
_e="${_e#"${_e%%[![:space:]]*}"}"; _e="${_e%"${_e##*[![:space:]]}"}"
108+
for _e in ${_emails_raw[@]+"${_emails_raw[@]}"}; do
109+
_e="${_e#"${_e%%[![:space:]]*}"}"; _e="${_e%"${_e##*[![:space:]]}"}"
110110
[[ -n "$_e" ]] && EMAILS_ARRAY+=("$_e")
111111
done
112112

113113
COLLECTIONS_ARRAY=()
114-
for _c in "${_colls_raw[@]}"; do
115-
_c="${_c#"${_c%%[![:space:]]*}"}"; _c="${_c%"${_c##*[![:space:]]}"}"
114+
for _c in ${_colls_raw[@]+"${_colls_raw[@]}"}; do
115+
_c="${_c#"${_c%%[![:space:]]*}"}"; _c="${_c%"${_c##*[![:space:]]}"}"
116116
[[ -n "$_c" ]] && COLLECTIONS_ARRAY+=("$_c")
117117
done
118118

0 commit comments

Comments
 (0)