Skip to content

Commit

Permalink
Only run integration tests if OPENAI_API_KEY is set
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Apr 5, 2024
1 parent b9e8229 commit fe32392
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
public enum OpenAIModel {

// GPT-4 and GPT-4 Turbo (https://platform.openai.com/docs/models/gpt-3-5-turbo)
// GPT-4 and GPT-4 Turbo (https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo)
GPT_4("gpt-4"),
GPT_4_TURBO_PREVIEW("gpt-4-turbo-preview"),
GPT_4_VISION_PREVIEW("gpt-4-vision-preview"),
Expand Down Expand Up @@ -45,11 +45,11 @@ public enum OpenAIModel {

private final String id;

OpenAIModel(String modelId) {
this.id = modelId;
OpenAIModel(String id) {
this.id = id;
}

public String getId() {
return this.id;
return id;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import java.util.Optional;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;

@EnabledIfEnvironmentVariable(named = "OPENAI_API_KEY", matches = ".*\\S.*")
class OpenAIAssistantsApiIntegrationTest extends OpenAIIntegrationTestBase {

private static final Map<String, String> METADATA = Map.of("modified", "true", "user", "abc123");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
import java.util.stream.Collectors;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.io.TempDir;
import org.mockserver.integration.ClientAndServer;
import org.mockserver.model.*;

@EnabledIfEnvironmentVariable(named = "OPENAI_API_KEY", matches = ".*\\S.*")
class OpenAIIntegrationTest extends OpenAIIntegrationTestBase {

@Test
Expand Down

0 comments on commit fe32392

Please sign in to comment.