Skip to content

Commit

Permalink
Allow to not delete the service folder using property
Browse files Browse the repository at this point in the history
Using `-Dts.global.delete.folder.on.exit=false`
  • Loading branch information
Sgitario committed Sep 27, 2021
1 parent c7f67a8 commit af31615
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class BaseService<T extends Service> implements Service {

public static final String SERVICE_STARTUP_TIMEOUT = "startup.timeout";
public static final Duration SERVICE_STARTUP_TIMEOUT_DEFAULT = Duration.ofMinutes(5);
public static final String DELETE_FOLDER_ON_EXIT = "delete.folder.on.exit";

private static final String SERVICE_STARTUP_CHECK_POLL_INTERVAL = "startup.check-poll-interval";
private static final Duration SERVICE_STARTUP_CHECK_POLL_INTERVAL_DEFAULT = Duration.ofSeconds(2);
Expand Down Expand Up @@ -210,10 +211,12 @@ public void stop() {
@Override
public void close() {
stop();
try {
FileUtils.deletePath(getServiceFolder());
} catch (Exception ex) {
Log.warn(this, "Could not delete service folder. Caused by " + ex.getMessage());
if (getConfiguration().isTrue(DELETE_FOLDER_ON_EXIT)) {
try {
FileUtils.deletePath(getServiceFolder());
} catch (Exception ex) {
Log.warn(this, "Could not delete service folder. Caused by " + ex.getMessage());
}
}
}

Expand Down
18 changes: 17 additions & 1 deletion quarkus-test-core/src/main/resources/global.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Logging
#############
## Logging ##
#############
ts.global.log.enable=true
# Possible values are: INFO, FINE, WARNING, SEVERE
ts.global.log.level=INFO
ts.global.log.format=%d{HH:mm:ss,SSS} %-5p %s%e%n
ts.global.log.file.output=target/logs/tests.log

##############
## Timeouts ##
##############
# Default startup timeout for services is 5 minutes
ts.global.startup.timeout=5m
# Default startup check poll interval is every 2 seconds
Expand All @@ -14,12 +20,22 @@ ts.global.operator.install.timeout=10m
ts.global.imagestream.install.timeout=5m
# Default timeout factor for all checks
ts.global.factor.timeout=1

##############
## Services ##
##############
# Create default Quarkus application if no other services are defined within the scenario
ts.global.generated-service.enabled=true
# Delete /target/{service name} folder on service close
ts.global.delete.folder.on.exit=true
# Port resolution
ts.global.port.range.min=1100
ts.global.port.range.max=49151
## incremental (default) or random
ts.global.port.resolution.strategy=incremental

###############
### Quarkus ###
###############
# Default Quarkus expected successful output
ts.global.quarkus.expected.log=Installed features

0 comments on commit af31615

Please sign in to comment.