debian-mirror-gitlab/spec/factories/clusters/providers/gcp.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
889 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
FactoryBot.define do
2020-03-13 15:44:24 +05:30
factory :cluster_provider_gcp, class: 'Clusters::Providers::Gcp' do
2019-12-26 22:10:19 +05:30
association :cluster, platform_type: :kubernetes, provider_type: :gcp
2019-12-21 20:55:43 +05:30
gcp_project_id { 'test-gcp-project' }
2018-03-17 18:26:18 +05:30
trait :scheduled do
2019-12-21 20:55:43 +05:30
access_token { 'access_token_123' }
2018-03-17 18:26:18 +05:30
end
trait :creating do
2019-12-21 20:55:43 +05:30
access_token { 'access_token_123' }
2018-03-17 18:26:18 +05:30
after(:build) do |gcp, evaluator|
gcp.make_creating('operation-123')
end
end
trait :created do
2019-12-21 20:55:43 +05:30
endpoint { '111.111.111.111' }
2018-03-17 18:26:18 +05:30
after(:build) do |gcp, evaluator|
gcp.make_created
end
end
trait :errored do
after(:build) do |gcp, evaluator|
gcp.make_errored('Something wrong')
end
end
2019-07-07 11:18:12 +05:30
trait :abac_enabled do
2019-12-21 20:55:43 +05:30
legacy_abac { true }
end
trait :cloud_run_enabled do
cloud_run { true }
2019-07-07 11:18:12 +05:30
end
2018-03-17 18:26:18 +05:30
end
end