Skip to content

Commit 2c9eafd

Browse files
committed
wip
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent 8df7ed5 commit 2c9eafd

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

  • sample-operators/operations/src/test/java/io/javaoperatorsdk/operator/sample/metrics

sample-operators/operations/src/test/java/io/javaoperatorsdk/operator/sample/metrics/MetricsHandlingE2E.java renamed to sample-operators/operations/src/test/java/io/javaoperatorsdk/operator/sample/metrics/OperationsE2E.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
import static org.awaitility.Awaitility.await;
5252

5353
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
54-
class MetricsHandlingE2E {
54+
class OperationsE2E {
5555

56-
static final Logger log = LoggerFactory.getLogger(MetricsHandlingE2E.class);
56+
static final Logger log = LoggerFactory.getLogger(OperationsE2E.class);
5757
static final String OBSERVABILITY_NAMESPACE = "observability";
5858
static final int PROMETHEUS_PORT = 9090;
5959
static final int OTEL_COLLECTOR_PORT = 4318;
@@ -66,7 +66,7 @@ class MetricsHandlingE2E {
6666

6767
static final KubernetesClient client = new KubernetesClientBuilder().build();
6868

69-
MetricsHandlingE2E() {}
69+
OperationsE2E() {}
7070

7171
@RegisterExtension
7272
AbstractOperatorExtension operator =
@@ -106,7 +106,7 @@ private void helmInstall() {
106106
try {
107107
var chartPath =
108108
findProjectRoot("helm").toPath().resolve("helm/generic-helm-chart").toString();
109-
var valuesUrl = MetricsHandlingE2E.class.getClassLoader().getResource("helm-values.yaml");
109+
var valuesUrl = OperationsE2E.class.getClassLoader().getResource("helm-values.yaml");
110110
if (valuesUrl == null) {
111111
throw new IllegalStateException("helm-values.yaml not found on classpath");
112112
}
@@ -388,12 +388,16 @@ private static File findProjectRoot(String marker) throws IOException {
388388
}
389389

390390
private static void runCommand(String... command) throws IOException, InterruptedException {
391-
var process = new ProcessBuilder(command).redirectErrorStream(true).start();
392-
try (var reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
391+
var process = new ProcessBuilder(command).start();
392+
try (var stdoutReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
393+
var stderrReader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
393394
String line;
394-
while ((line = reader.readLine()) != null) {
395+
while ((line = stdoutReader.readLine()) != null) {
395396
log.info("{}: {}", command[0], line);
396397
}
398+
while ((line = stderrReader.readLine()) != null) {
399+
log.error("{}: {}", command[0], line);
400+
}
397401
}
398402
int exitCode = process.waitFor();
399403
if (exitCode != 0) {

0 commit comments

Comments
 (0)