Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vsct-jburet committed Oct 9, 2024
1 parent cdf77b9 commit acfb578
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bot/admin/server/src/test/kotlin/AbstractTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package ai.tock.bot.admin
import ai.tock.bot.admin.answer.AnswerConfigurationType
import ai.tock.bot.admin.bot.BotApplicationConfiguration
import ai.tock.bot.admin.bot.BotApplicationConfigurationDAO
import ai.tock.bot.admin.bot.vectorstore.BotVectorStoreConfigurationDAO
import ai.tock.bot.admin.dialog.DialogReportDAO
import ai.tock.bot.admin.model.BotStoryDefinitionConfiguration
import ai.tock.bot.admin.story.StoryDefinitionConfiguration
Expand All @@ -27,6 +28,7 @@ import ai.tock.bot.admin.user.UserReportDAO
import ai.tock.bot.connector.ConnectorType
import ai.tock.bot.definition.IntentWithoutNamespace
import ai.tock.bot.engine.feature.FeatureDAO
import ai.tock.genai.orchestratorclient.services.VectorStoreProviderService
import ai.tock.nlp.front.service.storage.ApplicationDefinitionDAO
import ai.tock.nlp.front.shared.ApplicationCodec
import ai.tock.nlp.front.shared.ApplicationConfiguration
Expand Down Expand Up @@ -65,6 +67,8 @@ abstract class AbstractTest {
bind<AlexaCodec>() with provider { mockk<AlexaCodec>(relaxed = true) }
bind<ApplicationMonitor>() with provider { mockk<ApplicationMonitor>(relaxed = true) }
bind<ModelTester>() with provider { mockk<ModelTester>(relaxed = true) }
bind<BotVectorStoreConfigurationDAO>() with provider { mockk<BotVectorStoreConfigurationDAO>(relaxed = true) }
bind<VectorStoreProviderService>() with provider { mockk<VectorStoreProviderService>(relaxed = true) }
}
return module
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
package ai.tock.bot.admin.service

import ai.tock.bot.admin.bot.observability.BotObservabilityConfigurationDAO
import ai.tock.bot.admin.bot.vectorstore.BotVectorStoreConfigurationDAO
import ai.tock.bot.admin.model.BotRAGConfigurationDTO
import ai.tock.genai.orchestratorclient.responses.ErrorInfo
import ai.tock.genai.orchestratorclient.responses.ErrorResponse
import ai.tock.genai.orchestratorclient.responses.ProviderSettingStatusResponse
import ai.tock.genai.orchestratorclient.services.EMProviderService
import ai.tock.genai.orchestratorclient.services.LLMProviderService
import ai.tock.genai.orchestratorclient.services.VectorStoreProviderService
import ai.tock.genai.orchestratorcore.models.em.AzureOpenAIEMSettingDTO
import ai.tock.genai.orchestratorcore.models.llm.OpenAILLMSetting
import ai.tock.shared.tockInternalInjector
import com.github.salomonbrys.kodein.Kodein
import com.github.salomonbrys.kodein.KodeinInjector
import com.github.salomonbrys.kodein.bind
import com.github.salomonbrys.kodein.provider
import com.github.salomonbrys.kodein.singleton
import io.mockk.every
import io.mockk.mockk
Expand All @@ -45,6 +48,8 @@ class RAGValidationServiceTest {
bind<LLMProviderService>() with singleton { llmProviderService }
bind<EMProviderService>() with singleton { emProviderService }
bind<BotObservabilityConfigurationDAO>() with singleton { botObservabilityConfigurationDAO }
bind<BotVectorStoreConfigurationDAO>() with provider { mockk<BotVectorStoreConfigurationDAO>(relaxed = true) }
bind<VectorStoreProviderService>() with provider { mockk<VectorStoreProviderService>(relaxed = true) }
}.also {
tockInternalInjector.inject(Kodein {
import(it)
Expand Down Expand Up @@ -144,7 +149,7 @@ class RAGValidationServiceTest {
// WHEN :
// Launch of validation
val errors = RAGValidationService.validate(
ragConfiguration.copy(enabled = false, indexSessionId = null).toBotRAGConfiguration()
ragConfiguration.copy(enabled = false, indexSessionId = "sessionId").toBotRAGConfiguration()
)

// THEN :
Expand Down

0 comments on commit acfb578

Please sign in to comment.