Skip to content

Commit

Permalink
attempt to fix incremental-repack test
Browse files Browse the repository at this point in the history
Signed-off-by: Hrushi20 <[email protected]>
  • Loading branch information
Hrushi20 committed Oct 27, 2023
1 parent c47bc18 commit 340aace
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class TaskExecutorTest extends AbstractGitRepository {
private Task gitTask;


public TaskExecutorTest(TaskType taskType) {
public TaskExecutorTest(TaskType taskType){
this.gitTask = new Task(taskType);
this.gitTask.setCronSyntax("* * * * *");
this.gitTask.setIsTaskConfigured(true);
Expand All @@ -65,7 +65,6 @@ public void testGitClient(){
assertTrue(taskExecutor.getCaches().size() > 0);
GitMaintenanceSCM.Cache cache = taskExecutor.getCaches().get(0);
File cacheFile = cache.getCacheFile();

assertNotNull(taskExecutor.getGitClient(cacheFile));
assertThat(taskExecutor.getGitClient(cacheFile),instanceOf(GitClient.class));
}
Expand All @@ -83,7 +82,11 @@ public void testGetCaches(){
}

@Test
public void testExecuteGitMaintenance() throws InterruptedException {
public void testExecuteGitMaintenance() throws Exception {

// This will create a pack file, incremental repack will then start to work.
repo.git("repack");

TaskExecutor taskExecutor = new TestTaskExecutorHelper(gitTask,testGitDir);
GitMaintenanceSCM.Cache cache = taskExecutor.getCaches().get(0);
File cacheFile = cache.getCacheFile();
Expand All @@ -96,7 +99,11 @@ public void testExecuteGitMaintenance() throws InterruptedException {
}

@Test
public void testRunnable() {
public void testRunnable() throws Exception {

// This will create a pack file, incremental repack will then start to work.
repo.git("repack");

MaintenanceTaskConfiguration config = GlobalConfiguration.all().get(MaintenanceTaskConfiguration.class);
config.setIsGitMaintenanceRunning(true);
config.setCronSyntax(gitTask.getTaskType(),"* * * * *");
Expand Down

0 comments on commit 340aace

Please sign in to comment.