Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(core): add tests to verify the rosco startup with various cloud providers enabled #1073

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rosco-core/rosco-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ dependencies {
implementation "redis.clients:jedis"
testImplementation "org.spockframework:spock-core"
testImplementation "org.objenesis:objenesis"
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.springframework:spring-test"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation project(":rosco-web")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2024 OpsMx, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.netflix.spinnaker.rosco.providers.aws;

import com.netflix.spinnaker.rosco.Main;
import com.netflix.spinnaker.rosco.providers.aws.config.RoscoAWSConfiguration;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {Main.class})
@TestPropertySource(
properties = {
"spring.application.name=rosco",
"aws.enabled=true",
"rosco.config-dir=/some/path",
"bakeAccount=xyz"
})
public class AWSStartupTest {

@Autowired AWSBakeHandler awsBakeHandler;

@Autowired RoscoAWSConfiguration.AWSBakeryDefaults awsBakeryDefaults;

@Test
public void startupTest() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2024 OpsMx, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.netflix.spinnaker.rosco.providers.azure;

import com.netflix.spinnaker.rosco.Main;
import com.netflix.spinnaker.rosco.providers.azure.config.RoscoAzureConfiguration;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {Main.class})
@TestPropertySource(
properties = {
"spring.application.name=rosco",
"azure.enabled=true",
"rosco.config-dir=/some/path"
})
public class AzureStartupTest {

@Autowired AzureBakeHandler azureBakeHandler;

@Autowired RoscoAzureConfiguration.AzureBakeryDefaults azureBakeryDefaults;

@Autowired RoscoAzureConfiguration.AzureConfigurationProperties azureConfigurationProperties;

@Test
public void startupTest() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2024 OpsMx, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.netflix.spinnaker.rosco.providers.docker;

import com.netflix.spinnaker.rosco.Main;
import com.netflix.spinnaker.rosco.providers.docker.config.RoscoDockerConfiguration;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {Main.class})
@TestPropertySource(
properties = {
"spring.application.name=rosco",
"docker.enabled=true",
"rosco.config-dir=/some/path"
})
public class DockerStartupTest {

@Autowired DockerBakeHandler dockerBakeHandler;

@Autowired RoscoDockerConfiguration.DockerBakeryDefaults dockerBakeryDefaults;

@Test
public void startupTest() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright 2024 OpsMx, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.netflix.spinnaker.rosco.providers.google;

import com.netflix.spinnaker.rosco.Main;
import com.netflix.spinnaker.rosco.providers.google.config.RoscoGoogleConfiguration;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {Main.class})
@TestPropertySource(
properties = {
"spring.application.name=rosco",
"google.enabled=true",
"rosco.config-dir=/some/path"
})
public class GCEStartupTest {

@Autowired GCEBakeHandler gceBakeHandler;

@Autowired RoscoGoogleConfiguration.GCEBakeryDefaults gceBakeryDefaults;

@Autowired RoscoGoogleConfiguration.GoogleConfigurationProperties googleConfigurationProperties;

@Test
public void startupTest() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2024 OpsMx, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.netflix.spinnaker.rosco.providers.oracle;

import com.netflix.spinnaker.rosco.Main;
import com.netflix.spinnaker.rosco.providers.oracle.config.OracleBakeryDefaults;
import com.netflix.spinnaker.rosco.providers.oracle.config.OracleConfigurationProperties;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {Main.class})
@TestPropertySource(
properties = {
"spring.application.name=rosco",
"oracle.enabled=true",
"rosco.config-dir=/some/path"
})
public class OracleStartupTest {

@Autowired OCIBakeHandler ociBakeHandler;

@Autowired OracleBakeryDefaults oracleBakeryDefaults;

@Autowired OracleConfigurationProperties oracleConfigurationProperties;

@Test
public void startupTest() {}
}