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
Léo-Paul Géneau
gitlab-ce
Commits
9a92c16a
Commit
9a92c16a
authored
Nov 10, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor QA specs runners and improve specs
parent
3abae1a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
10 deletions
+14
-10
qa/qa/scenario/entrypoint.rb
qa/qa/scenario/entrypoint.rb
+3
-5
qa/qa/specs/runner.rb
qa/qa/specs/runner.rb
+9
-1
qa/spec/scenario/entrypoint_spec.rb
qa/spec/scenario/entrypoint_spec.rb
+2
-4
No files found.
qa/qa/scenario/entrypoint.rb
View file @
9a92c16a
...
@@ -16,11 +16,9 @@ module QA
...
@@ -16,11 +16,9 @@ module QA
Runtime
::
Release
.
perform_before_hooks
Runtime
::
Release
.
perform_before_hooks
Specs
::
Runner
.
perform
do
|
specs
|
Specs
::
Runner
.
perform
do
|
specs
|
specs
.
rspec
(
specs
.
tty
=
true
tty:
true
,
specs
.
tags
=
self
.
class
.
get_tags
tags:
self
.
class
.
get_tags
,
specs
.
files
=
files
.
any?
?
files
:
'qa/specs/features'
files:
files
.
any?
?
files
:
'qa/specs/features'
)
end
end
end
end
...
...
qa/qa/specs/runner.rb
View file @
9a92c16a
...
@@ -3,7 +3,15 @@ require 'rspec/core'
...
@@ -3,7 +3,15 @@ require 'rspec/core'
module
QA
module
QA
module
Specs
module
Specs
class
Runner
<
Scenario
::
Template
class
Runner
<
Scenario
::
Template
def
perform
(
tty:
false
,
tags:
[],
files:
[
'qa/specs/features'
])
attr_accessor
:tty
,
:tags
,
:files
def
initialize
@tty
=
false
@tags
=
[]
@files
=
[
'qa/specs/features'
]
end
def
perform
args
=
[]
args
=
[]
args
.
push
(
'--tty'
)
if
tty
args
.
push
(
'--tty'
)
if
tty
tags
.
to_a
.
each
{
|
tag
|
args
.
push
([
'-t'
,
tag
.
to_s
])
}
tags
.
to_a
.
each
{
|
tag
|
args
.
push
([
'-t'
,
tag
.
to_s
])
}
...
...
qa/spec/scenario/entrypoint_spec.rb
View file @
9a92c16a
...
@@ -29,8 +29,7 @@ describe QA::Scenario::Entrypoint do
...
@@ -29,8 +29,7 @@ describe QA::Scenario::Entrypoint do
it
'should call runner with default arguments'
do
it
'should call runner with default arguments'
do
subject
.
perform
(
"test"
)
subject
.
perform
(
"test"
)
expect
(
runner
).
to
have_received
(
:rspec
)
expect
(
runner
).
to
have_received
(
:files
=
).
with
(
'qa/specs/features'
)
.
with
(
hash_including
(
files:
'qa/specs/features'
))
end
end
end
end
...
@@ -38,8 +37,7 @@ describe QA::Scenario::Entrypoint do
...
@@ -38,8 +37,7 @@ describe QA::Scenario::Entrypoint do
it
'should call runner with paths'
do
it
'should call runner with paths'
do
subject
.
perform
(
'test'
,
'path1'
,
'path2'
)
subject
.
perform
(
'test'
,
'path1'
,
'path2'
)
expect
(
runner
).
to
have_received
(
:rspec
)
expect
(
runner
).
to
have_received
(
:files
=
).
with
(
%w[path1 path2]
)
.
with
(
hash_including
(
files:
%w(path1 path2)
))
end
end
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