Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dev UI with the correct state when resuming #19791

Merged
merged 1 commit into from
Sep 1, 2021
Merged
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
@@ -11,7 +11,9 @@
import io.quarkus.deployment.dev.testing.TestRunResults;
import io.quarkus.dev.testing.ContinuousTestingWebsocketListener;

public class ContinuousTestingWebSocketListener implements TestListener {
public class ContinuousTestingWebSocketTestListener implements TestListener {

private volatile ContinuousTestingWebsocketListener.State lastState;

@Override
public void listenerRegistered(TestController testController) {
@@ -20,9 +22,18 @@ public void listenerRegistered(TestController testController) {

@Override
public void testsEnabled() {
ContinuousTestingWebsocketListener
.setLastState(
new ContinuousTestingWebsocketListener.State(true, true, 0L, 0L, 0L, 0L, false, false, false, true));
if (lastState == null) {
ContinuousTestingWebsocketListener
.setLastState(new ContinuousTestingWebsocketListener.State(true, false,
0, 0, 0, 0,
ContinuousTestingWebsocketListener.getLastState().isBrokenOnly,
ContinuousTestingWebsocketListener.getLastState().isTestOutput,
ContinuousTestingWebsocketListener.getLastState().isInstrumentationBasedReload,
ContinuousTestingWebsocketListener.getLastState().isLiveReload));
} else {
ContinuousTestingWebsocketListener
.setLastState(lastState);
}
}

@Override
@@ -46,17 +57,18 @@ public void testComplete(TestResult result) {

@Override
public void runComplete(TestRunResults testRunResults) {
lastState = new ContinuousTestingWebsocketListener.State(true, false,
testRunResults.getPassedCount() +
testRunResults.getFailedCount() +
testRunResults.getSkippedCount(),
testRunResults.getPassedCount(),
testRunResults.getFailedCount(), testRunResults.getSkippedCount(),
ContinuousTestingWebsocketListener.getLastState().isBrokenOnly,
ContinuousTestingWebsocketListener.getLastState().isTestOutput,
ContinuousTestingWebsocketListener.getLastState().isInstrumentationBasedReload,
ContinuousTestingWebsocketListener.getLastState().isLiveReload);
ContinuousTestingWebsocketListener.setLastState(
new ContinuousTestingWebsocketListener.State(true, false,
testRunResults.getPassedCount() +
testRunResults.getFailedCount() +
testRunResults.getSkippedCount(),
testRunResults.getPassedCount(),
testRunResults.getFailedCount(), testRunResults.getSkippedCount(),
ContinuousTestingWebsocketListener.getLastState().isBrokenOnly,
ContinuousTestingWebsocketListener.getLastState().isTestOutput,
ContinuousTestingWebsocketListener.getLastState().isInstrumentationBasedReload,
ContinuousTestingWebsocketListener.getLastState().isLiveReload));
lastState);
}

@Override
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
import io.quarkus.devconsole.spi.DevConsoleTemplateInfoBuildItem;
import io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem;
import io.quarkus.vertx.http.deployment.RouteBuildItem;
import io.quarkus.vertx.http.deployment.devmode.console.ContinuousTestingWebSocketListener;
import io.quarkus.vertx.http.deployment.devmode.console.ContinuousTestingWebSocketTestListener;
import io.quarkus.vertx.http.runtime.devmode.DevConsoleRecorder;
import io.quarkus.vertx.http.runtime.devmode.Json;
import io.vertx.core.Handler;
@@ -61,7 +61,7 @@ public void setupTestRoutes(
.route("dev/test")
.handler(recorder.continousTestHandler(shutdownContextBuildItem))
.build());
testListenerBuildItemBuildProducer.produce(new TestListenerBuildItem(new ContinuousTestingWebSocketListener()));
testListenerBuildItemBuildProducer.produce(new TestListenerBuildItem(new ContinuousTestingWebSocketTestListener()));
}

}