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
ddebe939
Commit
ddebe939
authored
Jan 23, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take screenshots upon exception in QA::Runtime::Release#method_missing
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
245e5ded
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
qa/qa/ee/strategy.rb
qa/qa/ee/strategy.rb
+5
-6
qa/qa/runtime/release.rb
qa/qa/runtime/release.rb
+10
-0
qa/spec/support/shared_examples/scenario_shared_examples.rb
qa/spec/support/shared_examples/scenario_shared_examples.rb
+2
-2
No files found.
qa/qa/ee/strategy.rb
View file @
ddebe939
...
...
@@ -6,18 +6,17 @@ module QA
extend
self
def
extend_autoloads!
require
'qa/ce/strategy'
require
'qa/ee'
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
)
#
Without a license, perform the CE before hooks only
.
unless
ENV
[
'EE_LICENSE'
]
QA
::
CE
::
Strategy
.
perform_before_hooks
return
end
return
unless
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'
])
...
...
qa/qa/runtime/release.rb
View file @
ddebe939
# frozen_string_literal: true
require
'capybara/rspec'
require
'capybara-screenshot/rspec'
module
QA
module
Runtime
##
...
...
@@ -24,6 +27,13 @@ module QA
def
self
.
method_missing
(
name
,
*
args
)
self
.
new
.
strategy
.
public_send
(
name
,
*
args
)
rescue
saved
=
Capybara
::
Screenshot
.
screenshot_and_save_page
QA
::
Runtime
::
Logger
.
error
(
"Screenshot:
#{
saved
[
:image
]
}
"
)
if
saved
&
.
key?
(
:image
)
QA
::
Runtime
::
Logger
.
error
(
"HTML capture:
#{
saved
[
:html
]
}
"
)
if
saved
&
.
key?
(
:html
)
raise
end
end
end
...
...
qa/spec/support/shared_examples/scenario_shared_examples.rb
View file @
ddebe939
...
...
@@ -31,10 +31,10 @@ 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
it
'performs before hooks
only once
'
do
subject
.
perform
(
args
)
expect
(
release
).
to
have_received
(
:perform_before_hooks
)
expect
(
release
).
to
have_received
(
:perform_before_hooks
)
.
once
end
it
'sets tags on runner'
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