Skip to content

Commit

Permalink
Don't rely on vert.x for CT tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Aug 31, 2021
1 parent 25ab926 commit 48d582b
Show file tree
Hide file tree
Showing 33 changed files with 466 additions and 345 deletions.
7 changes: 0 additions & 7 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1540,13 +1540,6 @@
<artifactId>quarkus-vertx-http-deployment</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-http-deployment</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
package io.quarkus.dev.testing;

import java.util.concurrent.CopyOnWriteArraySet;
import java.util.function.Consumer;

public class ContinuousTestingSharedStateManager {

private static final CopyOnWriteArraySet<Consumer<State>> stateListeners = new CopyOnWriteArraySet<>();
private static volatile State lastState = new State(-1, false, false, 0, 0, 0, 0, 0, 0, 0, false, false, false, true);

public static void addStateListener(Consumer<State> stateListener) {
stateListeners.add(stateListener);
if (lastState != null) {
stateListener.accept(lastState);
}
}

public static void removeStateListener(Consumer<State> stateListener) {
stateListeners.remove(stateListener);
}

public static void setLastState(State state) {
lastState = state;
for (var sl : stateListeners) {
sl.accept(state);
}
}

public static State getLastState() {
return lastState;
}

public static void setInProgress(boolean inProgress) {
State state = lastState;
if (state != null) {
setLastState(
new State(state.lastRun, state.running, inProgress, state.run, state.passed, state.failed, state.skipped,
state.currentPassed, state.currentFailed, state.currentSkipped, state.isBrokenOnly,
state.isTestOutput, state.isInstrumentationBasedReload, state.isLiveReload));
}
}

public static void setRunning(boolean running) {
State state = lastState;
if (state != null) {
setLastState(new State(state.lastRun, running, running && state.inProgress, state.run, state.passed, state.failed,
state.skipped,
state.currentPassed, state.currentFailed, state.currentSkipped, state.isBrokenOnly, state.isTestOutput,
state.isInstrumentationBasedReload, state.isLiveReload));
}
}

public static void setBrokenOnly(boolean brokenOnly) {
State state = lastState;
if (state != null) {
setLastState(new State(state.lastRun, state.running, state.inProgress, state.run, state.passed, state.failed,
state.skipped,
state.currentPassed, state.currentFailed, state.currentSkipped, brokenOnly, state.isTestOutput,
state.isInstrumentationBasedReload, state.isLiveReload));
}
}

public static void setTestOutput(boolean testOutput) {
State state = lastState;
if (state != null) {
setLastState(new State(state.lastRun, state.running, state.inProgress, state.run, state.passed, state.failed,
state.skipped,
state.currentPassed, state.currentFailed, state.currentSkipped, state.isBrokenOnly, testOutput,
state.isInstrumentationBasedReload, state.isLiveReload));
}
}

public static void setInstrumentationBasedReload(boolean instrumentationBasedReload) {
State state = lastState;
if (state != null) {
setLastState(new State(state.lastRun, state.running, state.inProgress, state.run, state.passed, state.failed,
state.skipped,
state.currentPassed, state.currentFailed, state.currentSkipped, state.isBrokenOnly, state.isTestOutput,
instrumentationBasedReload, state.isLiveReload));
}
}

public static void setLiveReloadEnabled(boolean liveReload) {
State state = lastState;
if (state != null) {
setLastState(new State(state.lastRun, state.running, state.inProgress, state.run, state.passed, state.failed,
state.skipped,
state.currentPassed, state.currentFailed, state.currentSkipped, state.isBrokenOnly, state.isTestOutput,
state.isInstrumentationBasedReload, liveReload));
}
}

public static class State {
public final long lastRun;
public final boolean running;
public final boolean inProgress;
public final long run;
public final long passed;
public final long failed;
public final long skipped;
public final long currentPassed;
public final long currentFailed;
public final long currentSkipped;
public final boolean isBrokenOnly;
public final boolean isTestOutput;
public final boolean isInstrumentationBasedReload;
public final boolean isLiveReload;

public State(long lastRun, boolean running, boolean inProgress, long run, long passed, long failed, long skipped,
long currentPassed, long currentFailed, long currentSkipped, boolean isBrokenOnly, boolean isTestOutput,
boolean isInstrumentationBasedReload, boolean isLiveReload) {
this.lastRun = lastRun;
this.running = running;
this.inProgress = inProgress;
this.run = run;
this.passed = passed;
this.failed = failed;
this.skipped = skipped;
this.currentPassed = currentPassed;
this.currentFailed = currentFailed;
this.currentSkipped = currentSkipped;
this.isBrokenOnly = isBrokenOnly;
this.isTestOutput = isTestOutput;
this.isInstrumentationBasedReload = isInstrumentationBasedReload;
this.isLiveReload = isLiveReload;
}

@Override
public String toString() {
return "State{" +
"lastRun=" + lastRun +
", running=" + running +
", inProgress=" + inProgress +
", run=" + run +
", passed=" + passed +
", failed=" + failed +
", skipped=" + skipped +
", isBrokenOnly=" + isBrokenOnly +
", isTestOutput=" + isTestOutput +
", isInstrumentationBasedReload=" + isInstrumentationBasedReload +
", isLiveReload=" + isLiveReload +
'}';
}
}
}

This file was deleted.

6 changes: 0 additions & 6 deletions extensions/elytron-security-jdbc/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
<artifactId>quarkus-resteasy-deployment</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-http-deployment</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-internal</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.deployment.util.FileUtil;
import io.quarkus.test.ContinuousTestingTestUtils;
import io.quarkus.test.ContinuousTestingTestUtils.TestStatus;
import io.quarkus.test.QuarkusDevModeTest;
import io.quarkus.vertx.http.deployment.devmode.tests.TestStatus;
import io.quarkus.vertx.http.testrunner.ContinuousTestingTestUtils;
import io.restassured.RestAssured;

//see https://github.com/quarkusio/quarkus/issues/9296
Expand Down
6 changes: 0 additions & 6 deletions extensions/hibernate-orm/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@
<artifactId>quarkus-smallrye-metrics-deployment</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-http-deployment</artifactId>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.ContinuousTestingTestUtils;
import io.quarkus.test.ContinuousTestingTestUtils.TestStatus;
import io.quarkus.test.QuarkusDevModeTest;
import io.quarkus.vertx.http.deployment.devmode.tests.TestStatus;
import io.quarkus.vertx.http.testrunner.ContinuousTestingTestUtils;
import io.restassured.RestAssured;

public class HibernateHotReloadTestCase {
Expand Down
6 changes: 0 additions & 6 deletions extensions/opentelemetry/opentelemetry/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@
<artifactId>quarkus-resteasy-deployment</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-http-deployment</artifactId>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health-deployment</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.ContinuousTestingTestUtils;
import io.quarkus.test.ContinuousTestingTestUtils.TestStatus;
import io.quarkus.test.QuarkusDevModeTest;
import io.quarkus.vertx.http.deployment.devmode.tests.TestStatus;
import io.quarkus.vertx.http.testrunner.ContinuousTestingTestUtils;

public class OpenTelemetryContinuousTestingTest {
@RegisterExtension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.ContinuousTestingTestUtils;
import io.quarkus.test.QuarkusDevModeTest;
import io.quarkus.vertx.http.testrunner.ContinuousTestingTestUtils;
import io.restassured.RestAssured;

public class OpenTelemetryDevModeTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx-http-deployment</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.ContinuousTestingTestUtils;
import io.quarkus.test.QuarkusDevModeTest;
import io.quarkus.vertx.http.testrunner.ContinuousTestingTestUtils;

public class KafkaDevServicesContinuousTestingTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.ContinuousTestingTestUtils;
import io.quarkus.test.QuarkusDevModeTest;
import io.quarkus.vertx.http.testrunner.ContinuousTestingTestUtils;

public class KafkaDevServicesContinuousTestingWorkingAppPropsTestCase {

Expand Down
Loading

0 comments on commit 48d582b

Please sign in to comment.