Skip to content

Commit 2046944

Browse files
committed
limit the test to Unix systems
1 parent 07af13e commit 2046944

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexCheckTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
import org.junit.jupiter.api.BeforeAll;
4444
import org.junit.jupiter.api.BeforeEach;
4545
import org.junit.jupiter.api.Test;
46+
import org.junit.jupiter.api.condition.EnabledOnOs;
47+
import org.junit.jupiter.api.condition.OS;
4648
import org.junit.jupiter.api.io.TempDir;
4749
import org.opengrok.indexer.configuration.Configuration;
4850
import org.opengrok.indexer.configuration.RuntimeEnvironment;
@@ -152,10 +154,15 @@ void testEmptyDir(@TempDir Path tempDir) throws Exception {
152154

153155
/**
154156
* Check that {@link IOException} thrown during index check is treated as success.
157+
* Runs only on Unix systems because the {@link IOException} is not thrown on Windows
158+
* for non-existent directories.
155159
*/
156160
@Test
161+
@EnabledOnOs({OS.LINUX, OS.MAC})
157162
void testIndexCheckIOException() {
163+
// This is set to simulate IOException in IndexCheck.checkDir().
158164
configuration.setDataRoot("/nonexistent");
165+
159166
configuration.setProjectsEnabled(false);
160167

161168
IndexCheck.IndexCheckMode mode = IndexCheck.IndexCheckMode.VERSION;

0 commit comments

Comments
 (0)