Skip to content

Commit b63f1f5

Browse files
committed
On GitHub CI on Windows, the cloned repository is on a different volume
than the Java temporary directory. - This means we cannot use the source file directly as the target of a link. - Copy the text fixture to the destination directory to make sure it is on the same volume.
1 parent d817d88 commit b63f1f5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/test/java/org/apache/commons/io/file/FilesUncheckTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ class FilesUncheckTest {
7474

7575
private static final Path FILE_PATH_A = Paths.get("src/test/resources/org/apache/commons/io/dirs-1-file-size-1/file-size-1.bin");
7676

77-
private static final Path FILE_PATH_EMPTY = Paths.get("src/test/resources/org/apache/commons/io/test-file-empty.bin");
77+
private static final Path FILE_PATH_EMPTY_SRC = Paths.get("src/test/resources/org/apache/commons/io/test-file-empty.bin");
78+
79+
private static Path FILE_PATH_EMPTY;
7880

7981
private static Path NEW_DIR_PATH;
8082

@@ -94,6 +96,10 @@ public static void beforeAll() throws IOException {
9496
NEW_DIR_PATH = DEST_PATH.resolve("newdir");
9597
NEW_FILE_PATH = DEST_PATH.resolve("file.txt");
9698
NEW_FILE_PATH_LINK = DEST_PATH.resolve("to_another_file.txt");
99+
// On GitHub CI on Windows, the cloned repository is on a different volume than the Java temporary directory.
100+
// This means we cannot use the source file directly as the target of a link.
101+
// Copy the text fixture to the destination directory to make sure it is on the same volume.
102+
FILE_PATH_EMPTY = Files.copy(FILE_PATH_EMPTY_SRC, DEST_PATH.resolve(FILE_PATH_EMPTY_SRC.getFileName()));
97103
}
98104

99105
@BeforeEach

0 commit comments

Comments
 (0)