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
8763f351
Commit
8763f351
authored
Apr 26, 2021
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep `CHROME_HEADLESS` working while displaying a deprecation warning
parent
04ac6b44
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
3 deletions
+15
-3
qa/qa/runtime/env.rb
qa/qa/runtime/env.rb
+6
-1
qa/spec/runtime/env_spec.rb
qa/spec/runtime/env_spec.rb
+5
-0
spec/support/capybara.rb
spec/support/capybara.rb
+1
-1
spec/support/helpers/live_debugger.rb
spec/support/helpers/live_debugger.rb
+3
-1
No files found.
qa/qa/runtime/env.rb
View file @
8763f351
# frozen_string_literal: true
require
'active_support/deprecation'
require
'gitlab/qa'
require
'uri'
...
...
@@ -66,7 +67,11 @@ module QA
# set to 'false' to have the browser run visibly instead of headless
def
webdriver_headless?
enabled?
(
ENV
[
'WEBDRIVER_HEADLESS'
])
if
ENV
.
key?
(
'CHROME_HEADLESS'
)
ActiveSupport
::
Deprecation
.
warn
(
"CHROME_HEADLESS is deprecated. Use WEBDRIVER_HEADLESS instead."
)
end
enabled?
(
ENV
[
'WEBDRIVER_HEADLESS'
])
||
enabled?
(
ENV
[
'CHROME_HEADLESS'
])
end
# set to 'true' to have Chrome use a fixed profile directory
...
...
qa/spec/runtime/env_spec.rb
View file @
8763f351
...
...
@@ -55,6 +55,11 @@ RSpec.describe QA::Runtime::Env do
end
describe
'.webdriver_headless?'
do
before
do
# We need to set this because we have a fallback for CHROME_HEADLESS
stub_env
(
'CHROME_HEADLESS'
,
'false'
)
end
it_behaves_like
'boolean method'
,
method: :webdriver_headless?
,
env_key:
'WEBDRIVER_HEADLESS'
,
...
...
spec/support/capybara.rb
View file @
8763f351
...
...
@@ -61,7 +61,7 @@ Capybara.register_driver :chrome do |app|
options
.
add_argument
(
"no-sandbox"
)
# Run headless by default unless WEBDRIVER_HEADLESS specified
options
.
add_argument
(
"headless"
)
unless
ENV
[
'WEBDRIVER_HEADLESS'
]
=~
/^(false|no|0)$/i
options
.
add_argument
(
"headless"
)
unless
ENV
[
'WEBDRIVER_HEADLESS'
]
=~
/^(false|no|0)$/i
||
ENV
[
'CHROME_HEADLESS'
]
=~
/^(false|no|0)$/i
# Disable /dev/shm use in CI. See https://gitlab.com/gitlab-org/gitlab/issues/4252
options
.
add_argument
(
"disable-dev-shm-usage"
)
if
ENV
[
'CI'
]
||
ENV
[
'CI_SERVER'
]
...
...
spec/support/helpers/live_debugger.rb
View file @
8763f351
...
...
@@ -24,6 +24,8 @@ module LiveDebugger
end
def
is_headless_disabled?
ENV
[
'WEBDRIVER_HEADLESS'
]
=~
/^(false|no|0)$/i
ActiveSupport
::
Deprecation
.
warn
(
"CHROME_HEADLESS is deprecated. Use WEBDRIVER_HEADLESS instead."
)
if
ENV
.
key?
(
'CHROME_HEADLESS'
)
ENV
[
'WEBDRIVER_HEADLESS'
]
=~
/^(false|no|0)$/i
||
ENV
[
'CHROME_HEADLESS'
]
=~
/^(false|no|0)$/i
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