Skip to content

Commit

Permalink
Testing create-bee failures with azureconfig update
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronegrant committed Jun 6, 2024
1 parent 2513dd7 commit c26da47
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ object MockTestSupport extends MockTestSupport {
val googleServicesConfig: GoogleServicesConfig = appConfig.googleConfig.get.googleServicesConfig
val configResourceTypes: Map[ResourceTypeName, ResourceType] = config.as[Map[String, ResourceType]]("resourceTypes").values.map(rt => rt.name -> rt).toMap
val adminConfig: AdminConfig = config.as[AdminConfig]("admin")
val azureServicesConfig: Option[AzureServicesConfig] = appConfig.azureServicesConfig
val databaseEnabled: Boolean = config.getBoolean("db.enabled")
val databaseEnabledClue = "-- skipping tests that talk to a real database"

Expand Down Expand Up @@ -141,7 +142,11 @@ object MockTestSupport extends MockTestSupport {
val mockManagedGroupService =
new ManagedGroupService(mockResourceService, policyEvaluatorService, resourceTypes, policyDAO, directoryDAO, googleExt, "example.com")
val tosService = new TosService(googleExt, directoryDAO, tosConfig)
val azureService = new AzureService(MockCrlService(), directoryDAO, new MockAzureManagedResourceGroupDAO)

val azureService = azureServicesConfig.map { azureConfig =>
new AzureService(azureConfig, MockCrlService(), directoryDAO, new MockAzureManagedResourceGroupDAO)
}

MockSamDependencies(
mockResourceService,
policyEvaluatorService,
Expand All @@ -153,7 +158,7 @@ object MockTestSupport extends MockTestSupport {
policyDAO,
googleExt,
FakeOpenIDConnectConfiguration,
azureService
azureService:Option[AzureService]
)
}

Expand All @@ -173,7 +178,7 @@ object MockTestSupport extends MockTestSupport {
samDependencies.tosService,
LiquibaseConfig("", initWithLiquibase = false),
samDependencies.oauth2Config,
Some(samDependencies.azureService)
samDependencies.azureService
) with MockSamUserDirectives with GoogleExtensionRoutes {
override val cloudExtensions: CloudExtensions = samDependencies.cloudExtensions
override val googleExtensions: GoogleExtensions = samDependencies.cloudExtensions match {
Expand Down Expand Up @@ -287,7 +292,7 @@ final case class MockSamDependencies(
policyDao: AccessPolicyDAO,
cloudExtensions: CloudExtensions,
oauth2Config: OpenIDConnectConfiguration,
azureService: AzureService
azureService: Option[AzureService]
)

object ConnectedTest extends Tag("connected test")
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class SamProviderSpec
accessPolicyDAO,
googleExt,
FakeOpenIDConnectConfiguration,
azureService
Option(azureService)
)

override def beforeAll(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class TestSamTosEnabledRoutes(

object TestSamRoutes {
val defaultUserInfo = Generator.genWorkbenchUserGoogle.sample.get
val config = ConfigFactory.load()
val appConfig = AppConfig.readConfig(config)

object SamResourceActionPatterns {
val config = ConfigFactory.load()
Expand Down Expand Up @@ -237,7 +239,7 @@ object TestSamRoutes {
user,
tosService = mockTosService,
cloudExtensions = cloudXtns,
azureService = Some(azureService)
azureService = Option(azureService)
)
}
}

0 comments on commit c26da47

Please sign in to comment.