tests: test CR SCW cuts

This commit is contained in:
Benjamin Chastanier
2022-01-25 12:02:32 +01:00
parent 36e5618256
commit 8c8a2b360d
5 changed files with 15 additions and 17 deletions

View File

@@ -2,6 +2,7 @@ extern crate scaleway_api_rs;
use crate::cloud_provider::scaleway::application::ScwZone;
use self::scaleway_api_rs::models::scaleway_registry_v1_namespace::Status;
use crate::build_platform::Image;
use crate::container_registry::docker::{docker_login, docker_manifest_inspect, docker_tag_and_push_image};
use crate::container_registry::{ContainerRegistry, Kind, PushResult};
@@ -90,9 +91,13 @@ impl ScalewayCR {
};
// We consider every registry namespace names are unique
if let Some(registry) = scaleway_registry_namespaces {
if !registry.is_empty() {
return Some(registry.into_iter().next().unwrap());
if let Some(registries) = scaleway_registry_namespaces {
if let Some(registry) = registries
.into_iter()
.filter(|r| r.status == Some(Status::Ready))
.next()
{
return Some(registry);
}
}

View File

@@ -1226,14 +1226,7 @@ pub fn get_environment_test_kubernetes<'a>(
uuid::Uuid::new_v4(),
format!("qovery-{}", context.cluster_id()),
SCW_KUBERNETES_VERSION.to_string(),
ScwZone::from_str(
secrets
.clone()
.SCALEWAY_DEFAULT_REGION
.expect("SCALEWAY_DEFAULT_REGION is not set")
.as_str(),
)
.unwrap(),
ScwZone::Warsaw1,
cloud_provider,
dns_provider,
Scaleway::kubernetes_nodes(),

View File

@@ -19,7 +19,7 @@ use qovery_engine::cloud_provider::qovery::EngineLocation;
use qovery_engine::logger::Logger;
use tracing::error;
pub const SCW_TEST_ZONE: ScwZone = ScwZone::Paris2;
pub const SCW_TEST_ZONE: ScwZone = ScwZone::Warsaw1;
pub const SCW_KUBERNETES_MAJOR_VERSION: u8 = 1;
pub const SCW_KUBERNETES_MINOR_VERSION: u8 = 19;
pub const SCW_KUBERNETES_VERSION: &'static str =

View File

@@ -343,7 +343,7 @@ impl FuncTestsSecrets {
"SCALEWAY_TEST_ORGANIZATION_ID",
secrets.SCALEWAY_TEST_ORGANIZATION_ID,
),
SCALEWAY_TEST_CLUSTER_ID: Self::select_secret("SCALEWAY_TEST_CLUSTER_ID", secrets.SCALEWAY_TEST_CLUSTER_ID),
SCALEWAY_TEST_CLUSTER_ID: Some("zd8eb3905".to_string()), //Self::select_secret("SCALEWAY_TEST_CLUSTER_ID", secrets.SCALEWAY_TEST_CLUSTER_ID),
TERRAFORM_AWS_ACCESS_KEY_ID: Self::select_secret(
"TERRAFORM_AWS_ACCESS_KEY_ID",
secrets.TERRAFORM_AWS_ACCESS_KEY_ID,

View File

@@ -31,10 +31,10 @@ fn create_scaleway_kubernetes_kapsule_test_cluster() {
.SCALEWAY_TEST_ORGANIZATION_ID
.as_ref()
.expect("SCALEWAY_TEST_ORGANIZATION_ID");
let cluster_id = secrets
.SCALEWAY_TEST_CLUSTER_ID
.as_ref()
.expect("SCALEWAY_TEST_CLUSTER_ID");
let cluster_id = "zd8eb3905".to_string(); /*secrets
.SCALEWAY_TEST_CLUSTER_ID
.as_ref()
.expect("SCALEWAY_TEST_CLUSTER_ID");*/
let logger = logger();
let context = context(organization_id.as_str(), cluster_id.as_str());