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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
49d5c35b
Commit
49d5c35b
authored
Feb 17, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix old usages of `ci_runner` factory
parent
acfe25ed
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
17 deletions
+17
-17
spec/features/runners_spec.rb
spec/features/runners_spec.rb
+5
-5
spec/models/build_spec.rb
spec/models/build_spec.rb
+3
-3
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+7
-7
spec/models/project_spec.rb
spec/models/project_spec.rb
+2
-2
No files found.
spec/features/runners_spec.rb
View file @
49d5c35b
...
@@ -17,10 +17,10 @@ describe "Runners" do
...
@@ -17,10 +17,10 @@ describe "Runners" do
@project3
=
FactoryGirl
.
create
:empty_project
@project3
=
FactoryGirl
.
create
:empty_project
@project3
.
team
<<
[
user
,
:developer
]
@project3
.
team
<<
[
user
,
:developer
]
@shared_runner
=
FactoryGirl
.
create
:ci_
shared_runner
@shared_runner
=
FactoryGirl
.
create
:ci_
runner
,
:shared
@specific_runner
=
FactoryGirl
.
create
:ci_
specific_
runner
@specific_runner
=
FactoryGirl
.
create
:ci_runner
@specific_runner2
=
FactoryGirl
.
create
:ci_
specific_
runner
@specific_runner2
=
FactoryGirl
.
create
:ci_runner
@specific_runner3
=
FactoryGirl
.
create
:ci_
specific_
runner
@specific_runner3
=
FactoryGirl
.
create
:ci_runner
@project
.
runners
<<
@specific_runner
@project
.
runners
<<
@specific_runner
@project2
.
runners
<<
@specific_runner2
@project2
.
runners
<<
@specific_runner2
@project3
.
runners
<<
@specific_runner3
@project3
.
runners
<<
@specific_runner3
...
@@ -84,7 +84,7 @@ describe "Runners" do
...
@@ -84,7 +84,7 @@ describe "Runners" do
before
do
before
do
@project
=
FactoryGirl
.
create
:empty_project
@project
=
FactoryGirl
.
create
:empty_project
@project
.
team
<<
[
user
,
:master
]
@project
.
team
<<
[
user
,
:master
]
@specific_runner
=
FactoryGirl
.
create
:ci_
specific_
runner
@specific_runner
=
FactoryGirl
.
create
:ci_runner
@project
.
runners
<<
@specific_runner
@project
.
runners
<<
@specific_runner
end
end
...
...
spec/models/build_spec.rb
View file @
49d5c35b
...
@@ -243,7 +243,7 @@ describe Ci::Build, models: true do
...
@@ -243,7 +243,7 @@ describe Ci::Build, models: true do
end
end
describe
:can_be_served?
do
describe
:can_be_served?
do
let
(
:runner
)
{
FactoryGirl
.
create
:ci_
specific_
runner
}
let
(
:runner
)
{
FactoryGirl
.
create
:ci_runner
}
before
{
build
.
project
.
runners
<<
runner
}
before
{
build
.
project
.
runners
<<
runner
}
...
@@ -285,7 +285,7 @@ describe Ci::Build, models: true do
...
@@ -285,7 +285,7 @@ describe Ci::Build, models: true do
end
end
context
'if there are runner'
do
context
'if there are runner'
do
let
(
:runner
)
{
FactoryGirl
.
create
:ci_
specific_
runner
}
let
(
:runner
)
{
FactoryGirl
.
create
:ci_runner
}
before
do
before
do
build
.
project
.
runners
<<
runner
build
.
project
.
runners
<<
runner
...
@@ -322,7 +322,7 @@ describe Ci::Build, models: true do
...
@@ -322,7 +322,7 @@ describe Ci::Build, models: true do
it
{
is_expected
.
to
be_truthy
}
it
{
is_expected
.
to
be_truthy
}
context
"and there are specific runner"
do
context
"and there are specific runner"
do
let
(
:runner
)
{
FactoryGirl
.
create
:ci_
specific_
runner
,
contacted_at:
1
.
second
.
ago
}
let
(
:runner
)
{
FactoryGirl
.
create
:ci_runner
,
contacted_at:
1
.
second
.
ago
}
before
do
before
do
build
.
project
.
runners
<<
runner
build
.
project
.
runners
<<
runner
...
...
spec/models/ci/runner_spec.rb
View file @
49d5c35b
...
@@ -39,7 +39,7 @@ describe Ci::Runner, models: true do
...
@@ -39,7 +39,7 @@ describe Ci::Runner, models: true do
describe
:assign_to
do
describe
:assign_to
do
let!
(
:project
)
{
FactoryGirl
.
create
:empty_project
}
let!
(
:project
)
{
FactoryGirl
.
create
:empty_project
}
let!
(
:shared_runner
)
{
FactoryGirl
.
create
(
:ci_
shared_runner
)
}
let!
(
:shared_runner
)
{
FactoryGirl
.
create
(
:ci_
runner
,
:shared
)
}
before
{
shared_runner
.
assign_to
(
project
)
}
before
{
shared_runner
.
assign_to
(
project
)
}
...
@@ -52,15 +52,15 @@ describe Ci::Runner, models: true do
...
@@ -52,15 +52,15 @@ describe Ci::Runner, models: true do
subject
{
Ci
::
Runner
.
online
}
subject
{
Ci
::
Runner
.
online
}
before
do
before
do
@runner1
=
FactoryGirl
.
create
(
:ci_
shared_runner
,
contacted_at:
1
.
year
.
ago
)
@runner1
=
FactoryGirl
.
create
(
:ci_
runner
,
:shared
,
contacted_at:
1
.
year
.
ago
)
@runner2
=
FactoryGirl
.
create
(
:ci_
shared_runner
,
contacted_at:
1
.
second
.
ago
)
@runner2
=
FactoryGirl
.
create
(
:ci_
runner
,
:shared
,
contacted_at:
1
.
second
.
ago
)
end
end
it
{
is_expected
.
to
eq
([
@runner2
])}
it
{
is_expected
.
to
eq
([
@runner2
])}
end
end
describe
:online?
do
describe
:online?
do
let
(
:runner
)
{
FactoryGirl
.
create
(
:ci_
shared_runner
)
}
let
(
:runner
)
{
FactoryGirl
.
create
(
:ci_
runner
,
:shared
)
}
subject
{
runner
.
online?
}
subject
{
runner
.
online?
}
...
@@ -84,7 +84,7 @@ describe Ci::Runner, models: true do
...
@@ -84,7 +84,7 @@ describe Ci::Runner, models: true do
end
end
describe
:status
do
describe
:status
do
let
(
:runner
)
{
FactoryGirl
.
create
(
:ci_
shared_runner
,
contacted_at:
1
.
second
.
ago
)
}
let
(
:runner
)
{
FactoryGirl
.
create
(
:ci_
runner
,
:shared
,
contacted_at:
1
.
second
.
ago
)
}
subject
{
runner
.
status
}
subject
{
runner
.
status
}
...
@@ -115,7 +115,7 @@ describe Ci::Runner, models: true do
...
@@ -115,7 +115,7 @@ describe Ci::Runner, models: true do
describe
"belongs_to_one_project?"
do
describe
"belongs_to_one_project?"
do
it
"returns false if there are two projects runner assigned to"
do
it
"returns false if there are two projects runner assigned to"
do
runner
=
FactoryGirl
.
create
(
:ci_
specific_
runner
)
runner
=
FactoryGirl
.
create
(
:ci_runner
)
project
=
FactoryGirl
.
create
(
:empty_project
)
project
=
FactoryGirl
.
create
(
:empty_project
)
project1
=
FactoryGirl
.
create
(
:empty_project
)
project1
=
FactoryGirl
.
create
(
:empty_project
)
project
.
runners
<<
runner
project
.
runners
<<
runner
...
@@ -125,7 +125,7 @@ describe Ci::Runner, models: true do
...
@@ -125,7 +125,7 @@ describe Ci::Runner, models: true do
end
end
it
"returns true"
do
it
"returns true"
do
runner
=
FactoryGirl
.
create
(
:ci_
specific_
runner
)
runner
=
FactoryGirl
.
create
(
:ci_runner
)
project
=
FactoryGirl
.
create
(
:empty_project
)
project
=
FactoryGirl
.
create
(
:empty_project
)
project
.
runners
<<
runner
project
.
runners
<<
runner
...
...
spec/models/project_spec.rb
View file @
49d5c35b
...
@@ -519,8 +519,8 @@ describe Project, models: true do
...
@@ -519,8 +519,8 @@ describe Project, models: true do
describe
:any_runners
do
describe
:any_runners
do
let
(
:project
)
{
create
(
:empty_project
,
shared_runners_enabled:
shared_runners_enabled
)
}
let
(
:project
)
{
create
(
:empty_project
,
shared_runners_enabled:
shared_runners_enabled
)
}
let
(
:specific_runner
)
{
create
(
:ci_
specific_
runner
)
}
let
(
:specific_runner
)
{
create
(
:ci_runner
)
}
let
(
:shared_runner
)
{
create
(
:ci_
shared_runner
)
}
let
(
:shared_runner
)
{
create
(
:ci_
runner
,
:shared
)
}
context
'for shared runners disabled'
do
context
'for shared runners disabled'
do
let
(
:shared_runners_enabled
)
{
false
}
let
(
:shared_runners_enabled
)
{
false
}
...
...
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