diff options
Diffstat (limited to 'spec/factories/clusters')
-rw-r--r-- | spec/factories/clusters/applications/helm.rb | 9 | ||||
-rw-r--r-- | spec/factories/clusters/clusters.rb | 20 | ||||
-rw-r--r-- | spec/factories/clusters/platforms/kubernetes.rb | 2 | ||||
-rw-r--r-- | spec/factories/clusters/providers/aws.rb | 3 | ||||
-rw-r--r-- | spec/factories/clusters/providers/gcp.rb | 2 |
5 files changed, 32 insertions, 4 deletions
diff --git a/spec/factories/clusters/applications/helm.rb b/spec/factories/clusters/applications/helm.rb index c7ec7c11743..0e59f8cb9ec 100644 --- a/spec/factories/clusters/applications/helm.rb +++ b/spec/factories/clusters/applications/helm.rb @@ -79,6 +79,15 @@ FactoryBot.define do cluster factory: %i(cluster with_installed_helm provided_by_gcp) end + factory :clusters_applications_elastic_stack, class: Clusters::Applications::ElasticStack do + cluster factory: %i(cluster with_installed_helm provided_by_gcp) + end + + factory :clusters_applications_crossplane, class: Clusters::Applications::Crossplane do + stack { 'gcp' } + cluster factory: %i(cluster with_installed_helm provided_by_gcp) + end + factory :clusters_applications_prometheus, class: Clusters::Applications::Prometheus do cluster factory: %i(cluster with_installed_helm provided_by_gcp) end diff --git a/spec/factories/clusters/clusters.rb b/spec/factories/clusters/clusters.rb index 63f33633a3c..609e7e20187 100644 --- a/spec/factories/clusters/clusters.rb +++ b/spec/factories/clusters/clusters.rb @@ -93,5 +93,25 @@ FactoryBot.define do trait :not_managed do managed { false } end + + trait :cleanup_not_started do + cleanup_status { 1 } + end + + trait :cleanup_uninstalling_applications do + cleanup_status { 2 } + end + + trait :cleanup_removing_project_namespaces do + cleanup_status { 3 } + end + + trait :cleanup_removing_service_account do + cleanup_status { 4 } + end + + trait :cleanup_errored do + cleanup_status { 5 } + end end end diff --git a/spec/factories/clusters/platforms/kubernetes.rb b/spec/factories/clusters/platforms/kubernetes.rb index 2757498e36b..dbcb838e9da 100644 --- a/spec/factories/clusters/platforms/kubernetes.rb +++ b/spec/factories/clusters/platforms/kubernetes.rb @@ -2,7 +2,7 @@ FactoryBot.define do factory :cluster_platform_kubernetes, class: Clusters::Platforms::Kubernetes do - cluster + association :cluster, platform_type: :kubernetes, provider_type: :user namespace { nil } api_url { 'https://kubernetes.example.com' } token { 'a' * 40 } diff --git a/spec/factories/clusters/providers/aws.rb b/spec/factories/clusters/providers/aws.rb index f4bc61455c5..e4b10aa5f33 100644 --- a/spec/factories/clusters/providers/aws.rb +++ b/spec/factories/clusters/providers/aws.rb @@ -2,8 +2,7 @@ FactoryBot.define do factory :cluster_provider_aws, class: Clusters::Providers::Aws do - cluster - created_by_user factory: :user + association :cluster, platform_type: :kubernetes, provider_type: :aws role_arn { 'arn:aws:iam::123456789012:role/role-name' } vpc_id { 'vpc-00000000000000000' } diff --git a/spec/factories/clusters/providers/gcp.rb b/spec/factories/clusters/providers/gcp.rb index 83b65dc8087..216c4d4fa31 100644 --- a/spec/factories/clusters/providers/gcp.rb +++ b/spec/factories/clusters/providers/gcp.rb @@ -2,7 +2,7 @@ FactoryBot.define do factory :cluster_provider_gcp, class: Clusters::Providers::Gcp do - cluster + association :cluster, platform_type: :kubernetes, provider_type: :gcp gcp_project_id { 'test-gcp-project' } trait :scheduled do |