mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-28 20:47:49 +01:00
Server: fix not being able to delete temp dir in tests
This commit is contained in:
2
.github/workflows/server.yml
vendored
2
.github/workflows/server.yml
vendored
@@ -49,7 +49,7 @@ jobs:
|
||||
cache: maven
|
||||
|
||||
- name: Test with Maven
|
||||
run: cd dhfs-parent && mvn -T $(nproc) --batch-mode --update-snapshots package verify
|
||||
run: cd dhfs-parent && TESTCONTAINERS_USER="$(id -u):$(id -g)" mvn -T $(nproc) --batch-mode --update-snapshots package verify
|
||||
|
||||
# - name: Build with Maven
|
||||
# run: cd dhfs-parent && mvn --batch-mode --update-snapshots package # -Dquarkus.log.category.\"com.usatiuk.dhfs\".min-level=DEBUG
|
||||
|
||||
@@ -43,16 +43,25 @@ public class KillIT {
|
||||
@BeforeEach
|
||||
void setup(TestInfo testInfo) throws IOException, InterruptedException, TimeoutException {
|
||||
Network network = Network.newNetwork();
|
||||
|
||||
String testcontainersUser = System.getenv("TESTCONTAINERS_USER");
|
||||
|
||||
container1 = new GenericContainer<>(DhfsImage.getInstance())
|
||||
.withPrivilegedMode(true)
|
||||
.withCreateContainerCmdModifier(cmd -> Objects.requireNonNull(cmd.getHostConfig()).withDevices(Device.parse("/dev/fuse")))
|
||||
.waitingFor(Wait.forLogMessage(".*Listening.*", 1).withStartupTimeout(Duration.ofSeconds(60))).withNetwork(network)
|
||||
.withFileSystemBind(data1.getAbsolutePath(), "/root/dhfs_default/data");
|
||||
if (testcontainersUser != null) {
|
||||
container1.withCreateContainerCmdModifier(cmd -> cmd.withUser(testcontainersUser));
|
||||
}
|
||||
container2 = new GenericContainer<>(DhfsImage.getInstance())
|
||||
.withPrivilegedMode(true)
|
||||
.withCreateContainerCmdModifier(cmd -> Objects.requireNonNull(cmd.getHostConfig()).withDevices(Device.parse("/dev/fuse")))
|
||||
.waitingFor(Wait.forLogMessage(".*Listening.*", 1).withStartupTimeout(Duration.ofSeconds(60))).withNetwork(network)
|
||||
.withFileSystemBind(data2.getAbsolutePath(), "/root/dhfs_default/data");
|
||||
if (testcontainersUser != null) {
|
||||
container2.withCreateContainerCmdModifier(cmd -> cmd.withUser(testcontainersUser));
|
||||
}
|
||||
|
||||
Stream.of(container1, container2).parallel().forEach(GenericContainer::start);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user