Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public void tryOpenBrowser() {
try {
if (Desktop.isDesktopSupported()) {
Desktop desktop = Desktop.getDesktop();
URI meshManagerUri = new URI("http://localhost:" + devConfig.dashboardPort());
String entryUrl = "http://localhost:%d/overview".formatted(devConfig.dashboardPort());
URI meshManagerUri = new URI(entryUrl);
desktop.browse(meshManagerUri);
} else {
logger.warn("Opening browser is not supported");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,13 @@ public void startStreamxDashboard(String meshPath, String meshDirectory,
meshPath,
meshDirectory,
projectDirectory
).withStartupTimeout(Duration.ofSeconds(CONTAINER_TIMEOUT_IN_SECS))
.withNetwork(network);
)
.withNetwork(network)
.waitingFor(Wait.forHttp("/q/health")
.forPort(8080)
)
.withStartupTimeout(Duration.ofSeconds(CONTAINER_TIMEOUT_IN_SECS));

dashboardContainer.start();

print("StreamX Dashboard started on http://localhost:" + devConfig.dashboardPort());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.streamx.cli.command.dev;

import static dev.streamx.cli.command.util.MeshTestsUtils.cleanUpMesh;
import static org.assertj.core.api.Assertions.assertThat;

import com.github.dockerjava.api.DockerClient;
Expand All @@ -9,8 +10,6 @@
import dev.streamx.cli.command.dev.event.DevReady;
import dev.streamx.runner.event.MeshReloadUpdate;
import dev.streamx.runner.event.MeshStarted;
import dev.streamx.runner.validation.DockerContainerValidator;
import dev.streamx.runner.validation.DockerEnvironmentValidator;
import io.quarkus.arc.properties.IfBuildProperty;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
Expand Down Expand Up @@ -70,8 +69,7 @@ void awaitDockerResourcesAreRemoved() {
Set<String> cleanedUpContainers =
Set.of("pulsar", "pulsar-init", "streamx-dashboard",
"rest-ingestion", "relay", "web-delivery-service");
DockerClient client = new DockerEnvironmentValidator().validateDockerClient();
new DockerContainerValidator().verifyExistingContainers(client, cleanedUpContainers);
cleanUpMesh(cleanedUpContainers);

return true;
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package dev.streamx.cli.command.run;

import static dev.streamx.cli.command.util.MeshTestsUtils.cleanUpMesh;
import static org.assertj.core.api.Assertions.assertThat;

import com.github.dockerjava.api.DockerClient;
import dev.streamx.cli.command.MeshStopper;
import dev.streamx.cli.command.run.RunCommandTest.RunCommandProfile;
import dev.streamx.runner.event.MeshStarted;
import dev.streamx.runner.validation.DockerContainerValidator;
import dev.streamx.runner.validation.DockerEnvironmentValidator;
import io.quarkus.arc.properties.IfBuildProperty;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
Expand Down Expand Up @@ -38,8 +36,7 @@ void awaitDockerResourcesAreRemoved() {
Set<String> cleanedUpContainers =
Set.of("pulsar", "pulsar-init",
"rest-ingestion", "relay", "web-delivery-service");
DockerClient client = new DockerEnvironmentValidator().validateDockerClient();
new DockerContainerValidator().verifyExistingContainers(client, cleanedUpContainers);
cleanUpMesh(cleanedUpContainers);

return true;
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package dev.streamx.cli.command.util;

import com.github.dockerjava.api.DockerClient;
import dev.streamx.runner.validation.DockerContainerValidator;
import dev.streamx.runner.validation.DockerEnvironmentValidator;
import java.util.Set;

public class MeshTestsUtils {
public static void cleanUpMesh(Set<String> cleanedUpContainers) {
DockerClient client = new DockerEnvironmentValidator().validateDockerClient();
for (String container : cleanedUpContainers) {
try {
client.removeContainerCmd(container)
.withForce(true)
.exec();
} catch (Exception ignored) {
// Ignore
}
}
new DockerContainerValidator().verifyExistingContainers(client, cleanedUpContainers);
}
}