BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
97633d56
Unverified
Commit
97633d56
authored
Apr 28, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed specs
parent
0e8afe13
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
18 deletions
+24
-18
raven_config.js
app/assets/javascripts/raven/raven_config.js
+1
-1
_head.html.haml
app/views/layouts/_head.html.haml
+4
-1
application.rb
config/application.rb
+1
-0
gon_helper.rb
lib/gitlab/gon_helper.rb
+1
-1
raven_js_spec.rb
spec/features/raven_js_spec.rb
+2
-2
raven_config_spec.js
spec/javascripts/raven/raven_config_spec.js
+15
-13
No files found.
app/assets/javascripts/raven/raven_config.js
View file @
97633d56
...
@@ -61,7 +61,7 @@ const RavenConfig = {
...
@@ -61,7 +61,7 @@ const RavenConfig = {
environment
:
this
.
options
.
isProduction
?
'production'
:
'development'
,
environment
:
this
.
options
.
isProduction
?
'production'
:
'development'
,
ignoreErrors
:
this
.
IGNORE_ERRORS
,
ignoreErrors
:
this
.
IGNORE_ERRORS
,
ignoreUrls
:
this
.
IGNORE_URLS
,
ignoreUrls
:
this
.
IGNORE_URLS
,
shouldSendCallback
:
this
.
shouldSendSample
,
shouldSendCallback
:
this
.
shouldSendSample
.
bind
(
this
)
,
}).
install
();
}).
install
();
},
},
...
...
app/views/layouts/_head.html.haml
View file @
97633d56
...
@@ -33,7 +33,10 @@
...
@@ -33,7 +33,10 @@
=
webpack_bundle_tag
"runtime"
=
webpack_bundle_tag
"runtime"
=
webpack_bundle_tag
"common"
=
webpack_bundle_tag
"common"
=
webpack_bundle_tag
"main"
=
webpack_bundle_tag
"main"
=
webpack_bundle_tag
"raven"
if
Gitlab
.
config
.
clientside_sentry_enabled
=
webpack_bundle_tag
"raven"
if
current_application_settings
.
clientside_sentry_enabled
=
'LUKETEST'
=
current_application_settings
.
clientside_sentry_enabled
-
if
content_for?
(
:page_specific_javascripts
)
-
if
content_for?
(
:page_specific_javascripts
)
=
yield
:page_specific_javascripts
=
yield
:page_specific_javascripts
...
...
config/application.rb
View file @
97633d56
...
@@ -72,6 +72,7 @@ module Gitlab
...
@@ -72,6 +72,7 @@ module Gitlab
runners_token
runners_token
secret_token
secret_token
sentry_dsn
sentry_dsn
clientside_sentry_enabled
clientside_sentry_dsn
clientside_sentry_dsn
variables
variables
)
)
...
...
lib/gitlab/gon_helper.rb
View file @
97633d56
...
@@ -10,7 +10,7 @@ module Gitlab
...
@@ -10,7 +10,7 @@ module Gitlab
gon
.
user_color_scheme
=
Gitlab
::
ColorSchemes
.
for_user
(
current_user
).
css_class
gon
.
user_color_scheme
=
Gitlab
::
ColorSchemes
.
for_user
(
current_user
).
css_class
gon
.
katex_css_url
=
ActionController
::
Base
.
helpers
.
asset_path
(
'katex.css'
)
gon
.
katex_css_url
=
ActionController
::
Base
.
helpers
.
asset_path
(
'katex.css'
)
gon
.
katex_js_url
=
ActionController
::
Base
.
helpers
.
asset_path
(
'katex.js'
)
gon
.
katex_js_url
=
ActionController
::
Base
.
helpers
.
asset_path
(
'katex.js'
)
gon
.
sentry_dsn
=
Gitlab
.
config
.
clientside_sentry_dsn
if
Gitlab
.
config
.
clientside_sentry_enabled
gon
.
sentry_dsn
=
current_application_settings
.
clientside_sentry_dsn
if
current_application_settings
.
clientside_sentry_enabled
gon
.
gitlab_url
=
Gitlab
.
config
.
gitlab
.
url
gon
.
gitlab_url
=
Gitlab
.
config
.
gitlab
.
url
gon
.
is_production
=
Rails
.
env
.
production?
gon
.
is_production
=
Rails
.
env
.
production?
...
...
spec/features/raven_js_spec.rb
View file @
97633d56
...
@@ -10,8 +10,7 @@ feature 'RavenJS', :feature, :js do
...
@@ -10,8 +10,7 @@ feature 'RavenJS', :feature, :js do
end
end
it
'should load raven if sentry is enabled'
do
it
'should load raven if sentry is enabled'
do
allow_any_instance_of
(
SentryHelper
).
to
receive_messages
(
sentry_dsn_public:
'https://key@domain.com/id'
,
stub_application_setting
(
clientside_sentry_dsn:
'https://key@domain.com/id'
,
clientside_sentry_enabled:
true
)
sentry_enabled?:
true
)
visit
new_user_session_path
visit
new_user_session_path
...
@@ -19,6 +18,7 @@ feature 'RavenJS', :feature, :js do
...
@@ -19,6 +18,7 @@ feature 'RavenJS', :feature, :js do
end
end
def
has_requested_raven
def
has_requested_raven
p
page
.
driver
.
network_traffic
page
.
driver
.
network_traffic
.
one?
{
|
request
|
request
.
url
.
end_with?
(
raven_path
)}
page
.
driver
.
network_traffic
.
one?
{
|
request
|
request
.
url
.
end_with?
(
raven_path
)}
end
end
end
end
spec/javascripts/raven/raven_config_spec.js
View file @
97633d56
...
@@ -77,6 +77,7 @@ describe('RavenConfig', () => {
...
@@ -77,6 +77,7 @@ describe('RavenConfig', () => {
describe
(
'configure'
,
()
=>
{
describe
(
'configure'
,
()
=>
{
let
options
;
let
options
;
let
raven
;
let
raven
;
let
ravenConfig
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
options
=
{
options
=
{
...
@@ -85,22 +86,25 @@ describe('RavenConfig', () => {
...
@@ -85,22 +86,25 @@ describe('RavenConfig', () => {
isProduction
:
true
,
isProduction
:
true
,
};
};
ravenConfig
=
jasmine
.
createSpyObj
(
'ravenConfig'
,
[
'shouldSendSample'
]);
raven
=
jasmine
.
createSpyObj
(
'raven'
,
[
'install'
]);
raven
=
jasmine
.
createSpyObj
(
'raven'
,
[
'install'
]);
spyOn
(
Raven
,
'config'
).
and
.
returnValue
(
raven
);
spyOn
(
Raven
,
'config'
).
and
.
returnValue
(
raven
);
RavenConfig
.
configure
.
call
({
ravenConfig
.
options
=
options
;
options
,
ravenConfig
.
IGNORE_ERRORS
=
'ignore_errors'
;
});
ravenConfig
.
IGNORE_URLS
=
'ignore_urls'
;
RavenConfig
.
configure
.
call
(
ravenConfig
);
});
});
it
(
'should call Raven.config'
,
()
=>
{
it
(
'should call Raven.config'
,
()
=>
{
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
whitelistUrls
:
options
.
whitelistUrls
,
whitelistUrls
:
options
.
whitelistUrls
,
environment
:
'production'
,
environment
:
'production'
,
ignoreErrors
:
Raven
.
IGNORE_ERRORS
,
ignoreErrors
:
ravenConfig
.
IGNORE_ERRORS
,
ignoreUrls
:
Raven
.
IGNORE_URLS
,
ignoreUrls
:
ravenConfig
.
IGNORE_URLS
,
shouldSendCallback
:
Raven
.
shouldSendSample
,
shouldSendCallback
:
jasmine
.
any
(
Function
)
,
});
});
});
});
...
@@ -109,18 +113,16 @@ describe('RavenConfig', () => {
...
@@ -109,18 +113,16 @@ describe('RavenConfig', () => {
});
});
it
(
'should set .environment to development if isProduction is false'
,
()
=>
{
it
(
'should set .environment to development if isProduction is false'
,
()
=>
{
options
.
isProduction
=
false
;
ravenConfig
.
options
.
isProduction
=
false
;
RavenConfig
.
configure
.
call
({
RavenConfig
.
configure
.
call
(
ravenConfig
);
options
,
});
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
expect
(
Raven
.
config
).
toHaveBeenCalledWith
(
options
.
sentryDsn
,
{
whitelistUrls
:
options
.
whitelistUrls
,
whitelistUrls
:
options
.
whitelistUrls
,
environment
:
'development'
,
environment
:
'development'
,
ignoreErrors
:
Raven
.
IGNORE_ERRORS
,
ignoreErrors
:
ravenConfig
.
IGNORE_ERRORS
,
ignoreUrls
:
Raven
.
IGNORE_URLS
,
ignoreUrls
:
ravenConfig
.
IGNORE_URLS
,
shouldSendCallback
:
Raven
.
shouldSendSample
,
shouldSendCallback
:
jasmine
.
any
(
Function
)
,
});
});
});
});
});
});
...
...
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