Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
DOCKERFILE_HADOLINT_DISABLE_ERRORS: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINTER_RULES_PATH: ./tools/pr-checker/linters/
FILTER_REGEX_EXCLUDE: mvnw*
DEFAULT_BRANCH: prod
- name: Summary
if: "! github.event.pull_request.head.repo.fork"
Expand Down
55 changes: 34 additions & 21 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,14 @@ The `finish` directory in the root of this guide contains the finished applicati
To try out the test, first go to the `finish` directory and run the following Maven goal that builds the application, starts the containers, runs the tests, and then stops the containers:

ifndef::cloud-hosted[]
[.tab_link.windows_link]
`*WINDOWS*`
[.tab_link.mac_link]
`*MAC*`
[.tab_link.linux_link]
`*LINUX*`
include::{common-includes}/os-tabs.adoc[]

[.tab_content.windows_section]
--
[role='command']
```
cd finish
mvn verify
mvnw.cmd verify
```
--
[.tab_content.mac_section]
Expand All @@ -96,7 +92,7 @@ mvn verify
```
export TESTCONTAINERS_RYUK_DISABLED=true
cd finish
mvn verify
./mvnw verify
```
--
[.tab_content.linux_section]
Expand All @@ -105,7 +101,7 @@ mvn verify
```
export TESTCONTAINERS_RYUK_DISABLED=true
cd finish
mvn verify
./mvnw verify
```
--
endif::[]
Expand All @@ -114,7 +110,7 @@ ifdef::cloud-hosted[]
```bash
cd /home/project/guide-testcontainers/finish
export TESTCONTAINERS_RYUK_DISABLED=true
mvn verify
./mvnw verify
```
endif::[]

Expand Down Expand Up @@ -205,10 +201,31 @@ endif::[]

Build and run the container by running the `devc` goal with the PostgreSQL container IP address. If your PostgreSQL container IP address is not `172.17.0.2`, replace the command with the right IP address.

include::{common-includes}/os-tabs.adoc[]

[.tab_content.windows_section]
--
[role='command']
```
mvnw.cmd liberty:devc -DcontainerRunOpts="-e DB_HOSTNAME=172.17.0.2" -DserverStartTimeout=240
```
--

[.tab_content.mac_section]
--
[role='command']
```
./mvnw liberty:devc -DcontainerRunOpts="-e DB_HOSTNAME=172.17.0.2" -DserverStartTimeout=240
```
--

[.tab_content.linux_section]
--
[role='command']
```
mvn liberty:devc -DcontainerRunOpts="-e DB_HOSTNAME=172.17.0.2" -DserverStartTimeout=240
./mvnw liberty:devc -DcontainerRunOpts="-e DB_HOSTNAME=172.17.0.2" -DserverStartTimeout=240
```
--

Wait a moment for dev mode to start. Some error messages are expected as a result of building the docker image. Although these messages are included on the standard error stream, in this case they are not errors, just logs of the docker build progress. After you see the following message, your Liberty instance is ready in dev mode:

Expand Down Expand Up @@ -409,7 +426,7 @@ include::finish/pom.xml[]

Add the required `dependency` for Testcontainers and Log4J libraries with `test` scope. The [hotspot=testcontainers file=0]`testcontainers` dependency offers a general-purpose API for managing container-based test environments. The [hotspot=slf4j file=0]`slf4j-reload4j` and [hotspot=slf4j-api file=0]`slf4j-api` dependencies enable the Simple Logging Facade for Java (SLF4J) API for trace logging during test execution and facilitates debugging and test performance tracking.

Also, add and configure the [hotspot=failsafe file=0]`maven-failsafe-plugin` plugin, so that the integration test can be run by the `mvn verify` command.
Also, add and configure the [hotspot=failsafe file=0]`maven-failsafe-plugin` plugin, so that the integration test can be run by the Maven `verify` goal.

When you started Open Liberty in dev mode, all the changes were automatically picked up. You can run the tests by pressing the `enter/return` key from the command-line session where you started dev mode. You see the following output:

Expand Down Expand Up @@ -448,33 +465,29 @@ docker stop postgres-container

Now, use the following Maven goal to run the tests from a cold start outside of dev mode:

[.tab_link.windows_link]
`*WINDOWS*`
[.tab_link.mac_link]
`*MAC*`
[.tab_link.linux_link]
`*LINUX*`
include::{common-includes}/os-tabs.adoc[]

[.tab_content.windows_section]
--
[role='command']
```
mvn clean verify
mvnw.cmd clean verify
```
--
[.tab_content.mac_section]
--
[role='command']
```
export TESTCONTAINERS_RYUK_DISABLED=true
mvn clean verify
./mvnw clean verify
```
--
[.tab_content.linux_section]
--
[role='command']
```
export TESTCONTAINERS_RYUK_DISABLED=true
mvn clean verify
./mvnw clean verify
```
--

Expand Down
Binary file added finish/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions finish/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
Loading
Loading