Skip to content

Commit

Permalink
Make two tests also working on windows
Browse files Browse the repository at this point in the history
I wanted to add a windows ci pipeline. At the moment not possible
because some tests are killing an Axon Ivy Engine with SIGKILL. This
prevents the Axon Ivy Engine from stoping the bundled Elasticsearch
Service, which than makes it impossible to clean the engine directory.

Seems that it is not possible with commons.cli to gracefully stop
a service. I will need first to use the new Java Process API to manage
the Axon Ivy Engine Process. This will also eliminate some maven warnings
because the process is killed with SIGKILL.
  • Loading branch information
alexsuter committed Jul 29, 2024
1 parent 4a38990 commit 339deaa
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/test/java/ch/ivyteam/ivy/maven/test/TestStartEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public void canStartEngine() throws Exception {
Executor startedProcess = null;
try {
startedProcess = mojo.startEngine();
assertThat(getProperty(EngineControl.Property.TEST_ENGINE_URL)).startsWith("http://")
assertThat(getProperty(EngineControl.Property.TEST_ENGINE_URL))
.startsWith("http://")
.endsWith("/");
assertThat(Path.of(getProperty(EngineControl.Property.TEST_ENGINE_LOG))).exists();
} finally {
Expand Down Expand Up @@ -150,9 +151,10 @@ public void startEngine_copyEngineToTarget() throws Exception {
try {
mojo.testEngine = TestEngineLocation.COPY_FROM_TEMPLATE;
var engineDirTarget = mojo.getEngineDir(mojo.project);
assertThat(engineDirTarget.toString()).contains("/target/ivyEngine");
assertThat(engineDirTarget)
.endsWith(Path.of("target").resolve("ivyEngine"))
.doesNotExist();

assertThat(engineDirTarget).doesNotExist();
startedProcess = mojo.startEngine();
assertThat(engineDirTarget).exists();
} finally {
Expand All @@ -169,9 +171,9 @@ public void startEngine_targetDirectoryNotClean() throws Exception {
Executor startedProcess = null;
try {
var engineDirTarget = mojo.getEngineDir(mojo.project);
assertThat(engineDirTarget.toString()).contains("/target/ivyEngine");

assertThat(engineDirTarget).doesNotExist();
assertThat(engineDirTarget)
.endsWith(Path.of("/target/ivyEngine"))
.doesNotExist();
assertThat(log.getWarnings().toString()).doesNotContain("Skipping copy");

startedProcess = mojo.startEngine();
Expand Down

0 comments on commit 339deaa

Please sign in to comment.