Skip to content

Commit

Permalink
Added integration test stages
Browse files Browse the repository at this point in the history
  • Loading branch information
moonraker595 committed Sep 5, 2024
1 parent b1b9931 commit 5e34276
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,28 @@ You can run this application locally in dev mode that enables live coding using:
The application can be packaged using:

```shell script
./mvnw package
./mvnw clean package -DskipTests
```

It produces the `.jar` file in the `target/` directory.
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.

## Testing

The application uses integration tests to fully verify the api endpoints. The package needs to be built above first.

A database is needed with some test data in it.

```shell script
# this will start a local db with some dummy data in it to tests against
docker compose up
```
then the tests can be run:

```shell script
./mvnw failsafe:integration-test
```

The application can be run using:

```shell script
Expand All @@ -41,7 +57,7 @@ java -jar target/quarkus-app/quarkus-run.jar
If you want to build an [_über-jar_](https://blog.payara.fish/what-is-a-java-uber-jar), execute the following command:

```shell script
./mvnw package -Dquarkus.package.jar.type=uber-jar
./mvnw package -DskipTests -Dquarkus.package.jar.type=uber-jar
```

The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.
Expand All @@ -51,7 +67,7 @@ The application, packaged as an _über-jar_, is now runnable using `java -jar ta
You can create a [native](https://quarkus.io/guides/building-native-image#producing-a-native-executable) executable using docker by:

```shell script
./mvnw package -Dnative -Dquarkus.native.container-build=true
./mvnw package -DskipTests -Dnative -Dquarkus.native.container-build=true
```

You can then execute the native executable with: `./target/*-runner`
Expand Down
18 changes: 17 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,23 @@
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<skipITs>false</skipITs>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
Expand Down

0 comments on commit 5e34276

Please sign in to comment.