Skip to content

Commit 68ee168

Browse files
committed
add project-less based test for history based reindex
1 parent c54bd05 commit 68ee168

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,5 +735,23 @@ void testInitialReindexWithHistoryBased() throws Exception {
735735
checkIndexDown(false, idb);
736736
}
737737

738-
// TODO: test project-less configuration with history based reindex
738+
/**
739+
* project-less configuration should lead to file-system based reindex.
740+
*/
741+
@Test
742+
void testProjectLessReindexVsHistoryBased() throws Exception {
743+
env.setProjectsEnabled(false);
744+
745+
// Make a change in the git repository.
746+
File repositoryRoot = new File(repository.getSourceRoot(), "git");
747+
assertTrue(repositoryRoot.isDirectory());
748+
changeGitRepository(repositoryRoot);
749+
750+
IndexDatabase idbOrig = new IndexDatabase();
751+
assertNotNull(idbOrig);
752+
IndexDatabase idb = spy(idbOrig);
753+
idb.update();
754+
755+
checkIndexDown(false, idb);
756+
}
739757
}

0 commit comments

Comments
 (0)