Skip to content

Commit

Permalink
Refactor Quarkus CLI tests and its Docker requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik authored and fedinskiy committed Sep 5, 2023
1 parent a90fe6c commit 32e576a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@
import io.quarkus.test.bootstrap.QuarkusCliDefaultService;
import io.quarkus.test.bootstrap.QuarkusCliRestService;
import io.quarkus.test.scenarios.QuarkusScenario;
import io.quarkus.test.scenarios.annotations.DisabledOnQuarkusVersion;

@Tag("quarkus-cli")
@QuarkusScenario
@DisabledOnQuarkusVersion(version = "1\\..*", reason = "Quarkus CLI has been reworked in 2.x")
public class QuarkusCliClientIT {

static final String RESTEASY_REACTIVE_EXTENSION = "quarkus-resteasy-reactive";
static final String SMALLRYE_HEALTH_EXTENSION = "quarkus-smallrye-health";
static final int CMD_DELAY_SEC = 3;
// TODO: we only specify stream till first Quarkus 3 final is released to avoid javax/jakarta conflicts
private static final String STREAM_VERSION = "3.0";

@Inject
static QuarkusCliClient cliClient;
Expand All @@ -39,7 +35,7 @@ public class QuarkusCliClientIT {
public void shouldCreateApplicationOnJvm() {
// Create application
QuarkusCliRestService app = cliClient.createApplication("app",
QuarkusCliClient.CreateApplicationRequest.defaults().withStream(STREAM_VERSION));
QuarkusCliClient.CreateApplicationRequest.defaults());

// Should build on Jvm
QuarkusCliClient.Result result = app.buildOnJvm();
Expand All @@ -54,7 +50,7 @@ public void shouldCreateApplicationOnJvm() {
public void shouldCreateExtension() {
// Create extension
QuarkusCliDefaultService app = cliClient.createExtension("extension-abc",
QuarkusCliClient.CreateExtensionRequest.defaults().withStream(STREAM_VERSION));
QuarkusCliClient.CreateExtensionRequest.defaults());

// Should build on Jvm
QuarkusCliClient.Result result = app.buildOnJvm();
Expand All @@ -64,7 +60,7 @@ public void shouldCreateExtension() {
@Test
public void shouldCreateApplicationUsingArtifactId() {
QuarkusCliRestService app = cliClient.createApplication("com.mycompany:my-app",
QuarkusCliClient.CreateApplicationRequest.defaults().withStream(STREAM_VERSION));
QuarkusCliClient.CreateApplicationRequest.defaults());
assertEquals("my-app", app.getServiceFolder().getFileName().toString(), "The application directory differs.");

QuarkusCliClient.Result result = app.buildOnJvm();
Expand All @@ -75,7 +71,7 @@ public void shouldCreateApplicationUsingArtifactId() {
public void shouldAddAndRemoveExtensions() throws InterruptedException {
// Create application
QuarkusCliRestService app = cliClient.createApplication("app",
QuarkusCliClient.CreateApplicationRequest.defaults().withStream(STREAM_VERSION));
QuarkusCliClient.CreateApplicationRequest.defaults());

// By default, it installs only "quarkus-resteasy-reactive"
assertInstalledExtensions(app, RESTEASY_REACTIVE_EXTENSION);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,18 @@
import io.quarkus.test.bootstrap.QuarkusCliClient;
import io.quarkus.test.bootstrap.QuarkusCliRestService;
import io.quarkus.test.scenarios.QuarkusScenario;
import io.quarkus.test.scenarios.annotations.DisabledOnQuarkusVersion;
import io.quarkus.test.scenarios.annotations.EnabledOnNative;
import io.quarkus.test.services.quarkus.model.QuarkusProperties;

@Tag("quarkus-cli")
@QuarkusScenario
@DisabledOnQuarkusVersion(version = "1\\..*", reason = "Quarkus CLI has been reworked in 2.x")
public class QuarkusCliClientIT {

static final String RESTEASY_SPRING_WEB_EXTENSION = "quarkus-spring-web";
static final String RESTEASY_REACTIVE_EXTENSION = "quarkus-resteasy-reactive";
static final String RESTEASY_REACTIVE_JACKSON_EXTENSION = "quarkus-resteasy-reactive-jackson";
static final String SMALLRYE_HEALTH_EXTENSION = "quarkus-smallrye-health";
static final int CMD_DELAY_SEC = 3;
// TODO: we only specify stream till first Quarkus 3 final is released to avoid javax/jakarta conflicts
private static final String STREAM_VERSION = "3.0";

@Inject
static QuarkusCliClient cliClient;
Expand All @@ -52,7 +48,7 @@ public void shouldVersionMatchQuarkusVersion() {
@Test
public void shouldCreateApplicationOnJvm() {
// Create application
QuarkusCliRestService app = cliClient.createApplication("app", defaults().withStream(STREAM_VERSION));
QuarkusCliRestService app = cliClient.createApplication("app", defaults());

// Should build on Jvm
QuarkusCliClient.Result result = app.buildOnJvm();
Expand All @@ -67,7 +63,7 @@ public void shouldCreateApplicationOnJvm() {
@EnabledOnNative
public void shouldBuildApplicationOnNativeUsingDocker() {
// Create application
QuarkusCliRestService app = cliClient.createApplication("app", defaults().withStream(STREAM_VERSION));
QuarkusCliRestService app = cliClient.createApplication("app", defaults());

// Should build on Native
QuarkusCliClient.Result result = app.buildOnNative();
Expand All @@ -79,7 +75,7 @@ public void shouldCreateApplicationWithCodeStarter() {
// Create application with Resteasy Jackson
QuarkusCliRestService app = cliClient.createApplication("app",
defaults().withExtensions(RESTEASY_SPRING_WEB_EXTENSION,
RESTEASY_REACTIVE_JACKSON_EXTENSION).withStream(STREAM_VERSION));
RESTEASY_REACTIVE_JACKSON_EXTENSION));

// Verify By default, it installs only "quarkus-resteasy"
assertInstalledExtensions(app, RESTEASY_SPRING_WEB_EXTENSION, RESTEASY_REACTIVE_JACKSON_EXTENSION);
Expand All @@ -91,7 +87,7 @@ public void shouldCreateApplicationWithCodeStarter() {

@Test
public void shouldCreateApplicationUsingArtifactId() {
QuarkusCliRestService app = cliClient.createApplication("com.mycompany:my-app", defaults().withStream(STREAM_VERSION));
QuarkusCliRestService app = cliClient.createApplication("com.mycompany:my-app", defaults());
assertEquals("my-app", app.getServiceFolder().getFileName().toString(), "The application directory differs.");

QuarkusCliClient.Result result = app.buildOnJvm();
Expand All @@ -101,7 +97,7 @@ public void shouldCreateApplicationUsingArtifactId() {
@Test
public void shouldAddAndRemoveExtensions() throws InterruptedException {
// Create application
QuarkusCliRestService app = cliClient.createApplication("app", defaults().withStream(STREAM_VERSION));
QuarkusCliRestService app = cliClient.createApplication("app", defaults());

// By default, it installs only "quarkus-resteasy-reactive"
assertInstalledExtensions(app, RESTEASY_REACTIVE_EXTENSION);
Expand Down

0 comments on commit 32e576a

Please sign in to comment.