Skip to content

Commit

Permalink
chore: Add RetryOnExceptionsExtension for test execution exception ha…
Browse files Browse the repository at this point in the history
…ndling
  • Loading branch information
amengus87 committed Jul 26, 2024
1 parent 556d996 commit 996355a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
import ai.dragon.enumeration.IngestorLoaderType;
import ai.dragon.enumeration.LanguageModelType;
import ai.dragon.enumeration.VectorStoreType;
import ai.dragon.junit.AbstractTest;
import ai.dragon.junit.extension.retry.RetryOnExceptions;
import ai.dragon.repository.FarmRepository;
import ai.dragon.repository.SiloRepository;
import ai.dragon.service.IngestorService;
import ai.dragon.test.AbstractTest;
import ai.dragon.test.junit.extension.retry.RetryOnExceptions;
import dev.ai4j.openai4j.OpenAiClient;
import dev.ai4j.openai4j.OpenAiHttpException;
import dev.ai4j.openai4j.chat.ChatCompletionRequest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ai.dragon.test;
package ai.dragon.junit;

public abstract class AbstractTest {
protected boolean canRunOpenAiRelatedTests() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ai.dragon.test.junit.extension.retry;
package ai.dragon.junit.extension.retry;

import org.junit.jupiter.api.extension.ExtendWith;

Expand All @@ -13,4 +13,4 @@
public @interface RetryOnExceptions {
int value() default 3; // Default retry count
Class<? extends Throwable>[] onExceptions() default { Throwable.class }; // Exceptions to retry on
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ai.dragon.test.junit.extension.retry;
package ai.dragon.junit.extension.retry;

import java.lang.reflect.Method;

Expand Down Expand Up @@ -48,4 +48,4 @@ public void beforeEach(ExtensionContext context) throws Exception {
store.put("retries", 0); // Reset retry count before each test
}
}
}
}

0 comments on commit 996355a

Please sign in to comment.