forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Isolate testThatNewResourcesAreServed in FlakyDevMojoIT
Also modernize things a bit now that we are using Java 17+.
- Loading branch information
Showing
14 changed files
with
730 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
integration-tests/maven/src/test/java/io/quarkus/maven/it/FlakyDevMojoIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package io.quarkus.maven.it; | ||
|
||
import static org.awaitility.Awaitility.await; | ||
import static org.hamcrest.CoreMatchers.containsString; | ||
import static org.hamcrest.CoreMatchers.equalTo; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.util.UUID; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
import org.apache.maven.shared.invoker.MavenInvocationException; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.devmode.util.DevModeClient; | ||
|
||
/** | ||
* This test has been isolated as it is very flaky and causing issues with Develocity PTS. | ||
*/ | ||
@DisableForNative | ||
public class FlakyDevMojoIT extends RunAndCheckMojoTestBase { | ||
|
||
protected DevModeClient devModeClient = new DevModeClient(getPort()); | ||
|
||
@Test | ||
public void testThatNewResourcesAreServed() throws MavenInvocationException, IOException { | ||
testDir = initProject("projects/classic-with-log", "projects/project-classic-run-resource-change"); | ||
runAndCheck(); | ||
|
||
// Create a new resource | ||
Path source = testDir.toPath().resolve("src/main/resources/META-INF/resources/lorem.txt"); | ||
Files.writeString(source, | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); | ||
await() | ||
.pollDelay(100, TimeUnit.MILLISECONDS) | ||
.atMost(TestUtils.getDefaultTimeout(), TimeUnit.MINUTES) | ||
.until(() -> devModeClient.getHttpResponse("/lorem.txt"), containsString("Lorem ipsum")); | ||
|
||
// Update the resource | ||
String uuid = UUID.randomUUID().toString(); | ||
Files.writeString(source, uuid); | ||
await() | ||
.pollDelay(100, TimeUnit.MILLISECONDS) | ||
.atMost(TestUtils.getDefaultTimeout(), TimeUnit.MINUTES) | ||
.until(() -> devModeClient.getHttpResponse("/lorem.txt"), equalTo(uuid)); | ||
|
||
// Delete the resource | ||
Files.delete(source); | ||
await() | ||
.pollDelay(100, TimeUnit.MILLISECONDS) | ||
.atMost(TestUtils.getDefaultTimeout(), TimeUnit.MINUTES) | ||
.until(() -> devModeClient.getHttpResponse("/lorem.txt", 404)); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
integration-tests/maven/src/test/resources-filtered/projects/classic-with-log/.env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
OTHER_GREETING=Hola |
108 changes: 108 additions & 0 deletions
108
integration-tests/maven/src/test/resources-filtered/projects/classic-with-log/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<?xml version="1.0"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.acme</groupId> | ||
<artifactId>acme</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<properties> | ||
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id> | ||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> | ||
<quarkus.platform.version>@project.version@</quarkus.platform.version> | ||
<quarkus-plugin.version>@project.version@</quarkus-plugin.version> | ||
<compiler-plugin.version>${compiler-plugin.version}</compiler-plugin.version> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>${maven.compiler.source}</maven.compiler.source> | ||
<maven.compiler.target>${maven.compiler.target}</maven.compiler.target> | ||
|
||
<!-- do not update this dependency, it needs to be stable for testing --> | ||
<webjar.jquery-ui.version>1.13.0</webjar.jquery-ui.version> | ||
</properties> | ||
<dependencyManagement> | ||
<dependencies> | ||
<!-- insert managed dependencies here --> | ||
<dependency> | ||
<groupId>\${quarkus.platform.group-id}</groupId> | ||
<artifactId>\${quarkus.platform.artifact-id}</artifactId> | ||
<version>\${quarkus.platform.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
<dependencies> | ||
<!-- insert test dependencies here --> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-resteasy</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-context-propagation</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-websockets</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.smallrye.common</groupId> | ||
<artifactId>smallrye-common-vertx-context</artifactId> | ||
<version>1.13.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.webjars</groupId> | ||
<artifactId>jquery-ui</artifactId> | ||
<version>\${webjar.jquery-ui.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>\${compiler-plugin.version}</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<version>\${quarkus-plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>generate-code</goal> | ||
<goal>generate-code-tests</goal> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<profiles> | ||
<profile> | ||
<id>native</id> | ||
<properties> | ||
<quarkus.native.enabled>true</quarkus.native.enabled> | ||
</properties> | ||
</profile> | ||
<profile> | ||
<id>customOutputDir</id> | ||
<build> | ||
<directory>target-other</directory> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
Oops, something went wrong.