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
9c177d23
Commit
9c177d23
authored
Dec 07, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the Plan seed entirely and add factories to create them on-demand
parent
bbcaf4ae
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
33 additions
and
16 deletions
+33
-16
db/fixtures/test/01_plan.rb
db/fixtures/test/01_plan.rb
+0
-8
spec/ee/spec/lib/ee/gitlab/ci/pipeline/chain/limit/activity_spec.rb
...ec/lib/ee/gitlab/ci/pipeline/chain/limit/activity_spec.rb
+1
-1
spec/ee/spec/lib/ee/gitlab/ci/pipeline/chain/limit/size_spec.rb
...e/spec/lib/ee/gitlab/ci/pipeline/chain/limit/size_spec.rb
+1
-1
spec/ee/spec/lib/ee/gitlab/ci/pipeline/quota/size_spec.rb
spec/ee/spec/lib/ee/gitlab/ci/pipeline/quota/size_spec.rb
+1
-1
spec/ee/spec/services/ci/create_pipeline_service_spec.rb
spec/ee/spec/services/ci/create_pipeline_service_spec.rb
+1
-1
spec/factories/namespaces.rb
spec/factories/namespaces.rb
+11
-0
spec/factories/plans.rb
spec/factories/plans.rb
+16
-0
spec/spec_helper.rb
spec/spec_helper.rb
+0
-2
spec/support/db_cleaner.rb
spec/support/db_cleaner.rb
+2
-2
No files found.
db/fixtures/test/01_plan.rb
deleted
100644 → 0
View file @
bbcaf4ae
require
'./spec/support/sidekiq'
Plan
.
seed
(
name:
EE
::
Namespace
::
FREE_PLAN
,
title:
EE
::
Namespace
::
FREE_PLAN
.
titleize
)
EE
::
Namespace
::
NAMESPACE_PLANS_TO_LICENSE_PLANS
.
each_key
do
|
plan
|
Plan
.
seed
(
name:
plan
,
title:
plan
.
titleize
)
end
spec/ee/spec/lib/ee/gitlab/ci/pipeline/chain/limit/activity_spec.rb
View file @
9c177d23
require
'spec_helper'
describe
EE
::
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Limit
::
Activity
do
set
(
:namespace
)
{
create
(
:namespace
,
plan:
Namespace
::
GOLD_PLAN
)
}
set
(
:namespace
)
{
create
(
:namespace
,
plan:
:gold_plan
)
}
set
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
set
(
:user
)
{
create
(
:user
)
}
...
...
spec/ee/spec/lib/ee/gitlab/ci/pipeline/chain/limit/size_spec.rb
View file @
9c177d23
require
'spec_helper'
describe
EE
::
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Limit
::
Size
do
set
(
:namespace
)
{
create
(
:namespace
,
plan:
Namespace
::
GOLD_PLAN
)
}
set
(
:namespace
)
{
create
(
:namespace
,
plan:
:gold_plan
)
}
set
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
set
(
:user
)
{
create
(
:user
)
}
...
...
spec/ee/spec/lib/ee/gitlab/ci/pipeline/quota/size_spec.rb
View file @
9c177d23
require
'spec_helper'
describe
EE
::
Gitlab
::
Ci
::
Pipeline
::
Quota
::
Size
do
set
(
:namespace
)
{
create
(
:namespace
,
plan:
EE
::
Namespace
::
GOLD_PLAN
)
}
set
(
:namespace
)
{
create
(
:namespace
,
plan:
:gold_plan
)
}
set
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
let
(
:pipeline
)
{
build_stubbed
(
:ci_pipeline
,
project:
project
)
}
...
...
spec/ee/spec/services/ci/create_pipeline_service_spec.rb
View file @
9c177d23
require
'spec_helper'
describe
Ci
::
CreatePipelineService
,
'#execute'
do
set
(
:namespace
)
{
create
(
:namespace
,
plan:
EE
::
Namespace
::
GOLD_PLAN
)
}
set
(
:namespace
)
{
create
(
:namespace
,
plan:
:gold_plan
)
}
set
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
namespace
)
}
set
(
:user
)
{
create
(
:user
)
}
...
...
spec/factories/namespaces.rb
View file @
9c177d23
...
...
@@ -21,5 +21,16 @@ FactoryGirl.define do
namespace_statistics
factory: :namespace_statistics
,
shared_runners_seconds:
1000
.
minutes
.
to_i
shared_runners_minutes_limit
500
end
# EE-only
transient
do
plan
nil
end
before
:create
do
|
namespace
,
evaluator
|
if
evaluator
.
plan
namespace
.
plan
=
create
(
evaluator
.
plan
)
end
end
end
end
spec/factories/plans.rb
0 → 100644
View file @
9c177d23
# EE-only
FactoryGirl
.
define
do
factory
:plan
do
factory
:free_plan
do
name
EE
::
Namespace
::
FREE_PLAN
title
{
name
.
titleize
}
end
EE
::
Namespace
::
PLANS
.
each
do
|
plan
|
factory
:"
#{
plan
}
_plan"
do
name
plan
title
{
name
.
titleize
}
end
end
end
end
spec/spec_helper.rb
View file @
9c177d23
...
...
@@ -107,8 +107,6 @@ RSpec.configure do |config|
config
.
before
(
:all
)
do
License
.
destroy_all
TestLicense
.
init
SeedFu
.
seed
end
config
.
after
(
:suite
)
do
...
...
spec/support/db_cleaner.rb
View file @
9c177d23
...
...
@@ -14,11 +14,11 @@ RSpec.configure do |config|
end
config
.
before
(
:each
,
:js
)
do
DatabaseCleaner
.
strategy
=
:truncation
,
{
except:
%w[licenses
plans
]
}
DatabaseCleaner
.
strategy
=
:truncation
,
{
except:
%w[licenses]
}
end
config
.
before
(
:each
,
:truncate
)
do
DatabaseCleaner
.
strategy
=
:truncation
,
{
except:
%w[licenses
plans
]
}
DatabaseCleaner
.
strategy
=
:truncation
,
{
except:
%w[licenses]
}
end
config
.
before
(
:each
,
:migration
)
do
...
...
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