Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
455fdcff
Commit
455fdcff
authored
Apr 12, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip stubbing so that these factories can be used with let_it_be
parent
3c2c533b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
49 deletions
+26
-49
spec/factories/clusters/applications/helm.rb
spec/factories/clusters/applications/helm.rb
+26
-49
No files found.
spec/factories/clusters/applications/helm.rb
View file @
455fdcff
...
...
@@ -4,18 +4,26 @@ FactoryBot.define do
factory
:clusters_applications_helm
,
class:
'Clusters::Applications::Helm'
do
cluster
factory:
%i(cluster provided_by_gcp)
before
(
:create
)
do
allow
(
Gitlab
::
Kubernetes
::
Helm
::
V2
::
Certificate
).
to
receive
(
:generate_root
)
.
and_return
(
double
(
key_string:
File
.
read
(
Rails
.
root
.
join
(
'spec/fixtures/clusters/sample_key.key'
)),
cert_string:
File
.
read
(
Rails
.
root
.
join
(
'spec/fixtures/clusters/sample_cert.pem'
))
transient
do
helm_installed
{
true
}
end
before
(
:create
)
do
|
_record
,
evaluator
|
if
evaluator
.
helm_installed
allow
(
Gitlab
::
Kubernetes
::
Helm
::
V2
::
Certificate
).
to
receive
(
:generate_root
)
.
and_return
(
double
(
key_string:
File
.
read
(
Rails
.
root
.
join
(
'spec/fixtures/clusters/sample_key.key'
)),
cert_string:
File
.
read
(
Rails
.
root
.
join
(
'spec/fixtures/clusters/sample_cert.pem'
))
)
)
)
end
end
after
(
:create
)
do
allow
(
Gitlab
::
Kubernetes
::
Helm
::
V2
::
Certificate
).
to
receive
(
:generate_root
).
and_call_original
after
(
:create
)
do
|
_record
,
evaluator
|
if
evaluator
.
helm_installed
allow
(
Gitlab
::
Kubernetes
::
Helm
::
V2
::
Certificate
).
to
receive
(
:generate_root
).
and_call_original
end
end
trait
:not_installable
do
...
...
@@ -78,14 +86,19 @@ FactoryBot.define do
updated_at
{
ClusterWaitForAppInstallationWorker
::
TIMEOUT
.
ago
}
end
# Common trait used by the apps below
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
transient
do
helm_installed
{
false
}
end
end
factory
:clusters_applications_ingress
,
class:
'Clusters::Applications::Ingress'
do
modsecurity_enabled
{
false
}
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
end
trait
:modsecurity_blocking
do
modsecurity_enabled
{
true
}
modsecurity_mode
{
:blocking
}
...
...
@@ -108,62 +121,34 @@ FactoryBot.define do
factory
:clusters_applications_cert_manager
,
class:
'Clusters::Applications::CertManager'
do
email
{
'admin@example.com'
}
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
end
end
factory
:clusters_applications_elastic_stack
,
class:
'Clusters::Applications::ElasticStack'
do
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
end
end
factory
:clusters_applications_crossplane
,
class:
'Clusters::Applications::Crossplane'
do
stack
{
'gcp'
}
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
end
end
factory
:clusters_applications_prometheus
,
class:
'Clusters::Applications::Prometheus'
do
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
end
end
factory
:clusters_applications_runner
,
class:
'Clusters::Applications::Runner'
do
runner
factory:
%i(ci_runner)
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
end
end
factory
:clusters_applications_knative
,
class:
'Clusters::Applications::Knative'
do
hostname
{
'example.com'
}
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
end
end
factory
:clusters_applications_jupyter
,
class:
'Clusters::Applications::Jupyter'
do
oauth_application
factory: :oauth_application
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp project)
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
end
end
factory
:clusters_applications_fluentd
,
class:
'Clusters::Applications::Fluentd'
do
...
...
@@ -171,18 +156,10 @@ FactoryBot.define do
waf_log_enabled
{
true
}
cilium_log_enabled
{
true
}
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
end
end
factory
:clusters_applications_cilium
,
class:
'Clusters::Applications::Cilium'
do
cluster
factory:
%i(cluster with_installed_helm provided_by_gcp)
trait
:no_helm_installed
do
cluster
factory:
%i(cluster provided_by_gcp)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment