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
b5ff8929
Commit
b5ff8929
authored
Jan 17, 2020
by
Rémy Coutable
Committed by
Dan Davison
Jan 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 'sign_out_if_signed_in' in 'qa/qa/ee/resource/license.rb'
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
6268ee84
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
47 additions
and
34 deletions
+47
-34
qa/qa/ee/resource/license.rb
qa/qa/ee/resource/license.rb
+1
-1
qa/qa/ee/strategy.rb
qa/qa/ee/strategy.rb
+5
-7
qa/qa/runtime/browser.rb
qa/qa/runtime/browser.rb
+33
-0
qa/qa/runtime/logger.rb
qa/qa/runtime/logger.rb
+3
-5
qa/qa/scenario/template.rb
qa/qa/scenario/template.rb
+0
-5
qa/qa/scenario/test/instance.rb
qa/qa/scenario/test/instance.rb
+0
-5
qa/qa/support/page/logging.rb
qa/qa/support/page/logging.rb
+1
-1
qa/spec/page/base_spec.rb
qa/spec/page/base_spec.rb
+1
-1
qa/spec/spec_helper.rb
qa/spec/spec_helper.rb
+3
-3
qa/spec/support/helpers/stub_env.rb
qa/spec/support/helpers/stub_env.rb
+0
-0
qa/spec/support/shared_examples/scenario_shared_examples.rb
qa/spec/support/shared_examples/scenario_shared_examples.rb
+0
-6
No files found.
qa/qa/ee/resource/license.rb
View file @
b5ff8929
...
...
@@ -13,7 +13,7 @@ module QA
license_page
.
add_new_license
(
license
)
unless
license_page
.
license?
end
QA
::
Page
::
Main
::
Menu
.
perform
(
&
:sign_out
)
QA
::
Page
::
Main
::
Menu
.
perform
(
&
:sign_out
_if_signed_in
)
end
end
end
...
...
qa/qa/ee/strategy.rb
View file @
b5ff8929
...
...
@@ -10,15 +10,13 @@ module QA
end
def
perform_before_hooks
# The login page could take some time to load the first time it is visited.
# We visit the login page and wait for it to properly load only once before the tests.
QA
::
Support
::
Retrier
.
retry_on_exception
do
QA
::
Runtime
::
Browser
.
visit
(
:gitlab
,
QA
::
Page
::
Main
::
Login
)
end
return
unless
ENV
[
'EE_LICENSE'
]
EE
::
Resource
::
License
.
fabricate!
(
ENV
[
'EE_LICENSE'
])
QA
::
Support
::
Retrier
.
retry_on_exception
do
QA
::
Runtime
::
Browser
.
visit
(
:gitlab
,
QA
::
Page
::
Main
::
Login
)
do
EE
::
Resource
::
License
.
fabricate!
(
ENV
[
'EE_LICENSE'
])
end
end
end
end
end
...
...
qa/qa/runtime/browser.rb
View file @
b5ff8929
...
...
@@ -15,6 +15,10 @@ module QA
CAPYBARA_MAX_WAIT_TIME
=
10
class
<<
self
attr_accessor
:rspec_configured
,
:capybara_configured
end
def
initialize
self
.
class
.
configure!
end
...
...
@@ -45,11 +49,40 @@ module QA
end
def
self
.
configure!
configure_rspec!
configure_capybara!
end
def
self
.
configure_rspec!
# We don't want to enter this infinite loop:
# Runtime::Release.perform_before_hooks -> `QA::Runtime::Browser.visit` -> configure! -> configure_rspec! -> Runtime::Release.perform_before_hooks
# So we make sure this method is called only once.
return
if
self
.
rspec_configured
browser
=
self
RSpec
.
configure
do
|
config
|
config
.
define_derived_metadata
(
file_path:
%r{/qa/specs/features/}
)
do
|
metadata
|
metadata
[
:type
]
=
:feature
end
config
.
before
do
unless
browser
.
rspec_configured
browser
.
rspec_configured
=
true
##
# Perform before hooks, which are different for CE and EE
#
Runtime
::
Release
.
perform_before_hooks
end
end
end
end
def
self
.
configure_capybara!
return
if
self
.
capybara_configured
self
.
capybara_configured
=
true
Capybara
.
server_port
=
9887
+
ENV
[
'TEST_ENV_NUMBER'
].
to_i
...
...
qa/qa/runtime/logger.rb
View file @
b5ff8929
...
...
@@ -14,11 +14,9 @@ module QA
attr_writer
:logger
def
logger
return
@logger
if
@logger
@logger
=
::
Logger
.
new
Runtime
::
Env
.
log_destination
@logger
.
level
=
Runtime
::
Env
.
debug?
?
::
Logger
::
DEBUG
:
::
Logger
::
ERROR
@logger
@logger
||=
::
Logger
.
new
(
Runtime
::
Env
.
log_destination
).
tap
do
|
logger
|
logger
.
level
=
Runtime
::
Env
.
debug?
?
::
Logger
::
DEBUG
:
::
Logger
::
ERROR
end
end
end
end
...
...
qa/qa/scenario/template.rb
View file @
b5ff8929
...
...
@@ -23,11 +23,6 @@ module QA
def
perform
(
options
,
*
args
)
extract_address
(
:gitlab_address
,
options
,
args
)
##
# Perform before hooks, which are different for CE and EE
#
Runtime
::
Release
.
perform_before_hooks
Runtime
::
Feature
.
enable
(
options
[
:enable_feature
])
if
options
.
key?
(
:enable_feature
)
Specs
::
Runner
.
perform
do
|
specs
|
...
...
qa/qa/scenario/test/instance.rb
View file @
b5ff8929
...
...
@@ -20,11 +20,6 @@ module QA
def
self
.
do_perform
(
address
,
*
rspec_options
)
Runtime
::
Scenario
.
define
(
:gitlab_address
,
address
)
##
# Perform before hooks, which are different for CE and EE
#
Runtime
::
Release
.
perform_before_hooks
Specs
::
Runner
.
perform
do
|
specs
|
specs
.
tty
=
true
specs
.
options
=
rspec_options
if
rspec_options
.
any?
...
...
qa/qa/support/page/logging.rb
View file @
b5ff8929
...
...
@@ -16,7 +16,7 @@ module QA
super
end
def
wait_until
(
max_duration:
60
,
sleep_interval:
0.1
,
reload:
true
)
def
wait_until
(
max_duration:
60
,
sleep_interval:
0.1
,
reload:
true
,
raise_on_failure:
false
)
log
(
"next wait uses reload:
#{
reload
}
"
)
# Logging of wait start/end/duration is handled by QA::Support::Waiter
...
...
qa/spec/page/base_spec.rb
View file @
b5ff8929
...
...
@@ -62,7 +62,7 @@ describe QA::Page::Base do
end
end
describe
'#wait'
do
describe
'#wait
_until
'
do
subject
{
Class
.
new
(
described_class
).
new
}
context
'when the condition is true'
do
...
...
qa/spec/spec_helper.rb
View file @
b5ff8929
...
...
@@ -12,9 +12,9 @@ QA::Runtime::Browser.configure!
QA
::
Runtime
::
Scenario
.
from_env
(
QA
::
Runtime
::
Env
.
runtime_scenario_attributes
)
if
QA
::
Runtime
::
Env
.
runtime_scenario_attributes
%w[helpers shared_examples]
.
each
do
|
d
|
Dir
[
::
File
.
join
(
__dir__
,
d
,
'**'
,
'*.rb'
)].
each
{
|
f
|
require
f
}
end
Dir
[
::
File
.
join
(
__dir__
,
"support/helpers/*.rb"
)].
each
{
|
f
|
require
f
}
Dir
[
::
File
.
join
(
__dir__
,
"support/shared_contexts/*.rb"
)].
each
{
|
f
|
require
f
}
Dir
[
::
File
.
join
(
__dir__
,
"support/shared_examples/*.rb"
)].
each
{
|
f
|
require
f
}
RSpec
.
configure
do
|
config
|
QA
::
Specs
::
Helpers
::
Quarantine
.
configure_rspec
...
...
qa/spec/helpers/stub_env.rb
→
qa/spec/
support/
helpers/stub_env.rb
View file @
b5ff8929
File moved
qa/spec/shared_examples/scenario_shared_examples.rb
→
qa/spec/s
upport/s
hared_examples/scenario_shared_examples.rb
View file @
b5ff8929
...
...
@@ -31,12 +31,6 @@ shared_examples 'a QA scenario class' do
expect
(
attributes
).
to
have_received
(
:define
).
with
(
:gitlab_address
,
'http://gitlab_address'
).
at_least
(
:once
)
end
it
'performs before hooks'
do
subject
.
perform
(
args
)
expect
(
release
).
to
have_received
(
:perform_before_hooks
)
end
it
'sets tags on runner'
do
subject
.
perform
(
args
)
...
...
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