Fix settings.yml write on bind mounts and skip capture specs in CI

This commit is contained in:
Anthony Stirling
2026-08-25 10:26:42 +01:00
parent 3bb513c9b7
commit 59286b04a2
3 changed files with 8 additions and 0 deletions
@@ -3,6 +3,7 @@ package stirling.software.common.util;
import java.io.IOException;
import java.io.StringWriter;
import java.nio.file.AtomicMoveNotSupportedException;
import java.nio.file.FileSystemException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
@@ -377,6 +378,9 @@ public class YamlHelper {
StandardCopyOption.ATOMIC_MOVE);
} catch (AtomicMoveNotSupportedException e) {
Files.move(tmp, target, StandardCopyOption.REPLACE_EXISTING);
} catch (FileSystemException e) {
// Bind-mounted files (docker) reject rename with EBUSY; write in place
Files.writeString(target, content);
}
} finally {
Files.deleteIfExists(tmp);
@@ -6,6 +6,8 @@ import fs from "node:fs";
/** Walkthrough capture for the Auto Form Detection feature. Not for CI. */
test.skip(!!process.env.CI, "capture-only spec; not for CI");
const SHOT_DIR =
process.env.SHOT_DIR ??
path.join(import.meta.dirname, "../../../../screenshots/auto-form-detection");
@@ -9,6 +9,8 @@ import fs from "node:fs";
* Dumps PNGs of every tool/admin state into SHOT_DIR (env). Not for CI.
*/
test.skip(!!process.env.CI, "capture-only spec; not for CI");
const SHOT_DIR =
process.env.SHOT_DIR ??
path.join(import.meta.dirname, "../../../../screenshots/ui-review");