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
8ef22332
Commit
8ef22332
authored
Dec 24, 2020
by
Sarah Yasonik
Committed by
Dmytro Zaporozhets (DZ)
Dec 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove alerts service from tests which don't need it
parent
ff9a62a2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
16 deletions
+40
-16
spec/features/alert_management/user_filters_alerts_by_status_spec.rb
...es/alert_management/user_filters_alerts_by_status_spec.rb
+0
-1
spec/features/alert_management/user_searches_alerts_spec.rb
spec/features/alert_management/user_searches_alerts_spec.rb
+0
-1
spec/features/alert_management/user_updates_alert_status_spec.rb
...atures/alert_management/user_updates_alert_status_spec.rb
+0
-1
spec/graphql/types/projects/service_type_spec.rb
spec/graphql/types/projects/service_type_spec.rb
+1
-1
spec/views/projects/settings/operations/show.html.haml_spec.rb
...views/projects/settings/operations/show.html.haml_spec.rb
+39
-12
No files found.
spec/features/alert_management/user_filters_alerts_by_status_spec.rb
View file @
8ef22332
...
@@ -5,7 +5,6 @@ require 'spec_helper'
...
@@ -5,7 +5,6 @@ require 'spec_helper'
RSpec
.
describe
'User filters Alert Management table by status'
,
:js
do
RSpec
.
describe
'User filters Alert Management table by status'
,
:js
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
let_it_be
(
:alerts_service
)
{
create
(
:alerts_service
,
project:
project
)
}
let_it_be
(
:alert1
,
reload:
true
)
{
create
(
:alert_management_alert
,
:triggered
,
project:
project
)
}
let_it_be
(
:alert1
,
reload:
true
)
{
create
(
:alert_management_alert
,
:triggered
,
project:
project
)
}
let_it_be
(
:alert2
,
reload:
true
)
{
create
(
:alert_management_alert
,
:acknowledged
,
project:
project
)
}
let_it_be
(
:alert2
,
reload:
true
)
{
create
(
:alert_management_alert
,
:acknowledged
,
project:
project
)
}
let_it_be
(
:alert3
,
reload:
true
)
{
create
(
:alert_management_alert
,
:acknowledged
,
project:
project
)
}
let_it_be
(
:alert3
,
reload:
true
)
{
create
(
:alert_management_alert
,
:acknowledged
,
project:
project
)
}
...
...
spec/features/alert_management/user_searches_alerts_spec.rb
View file @
8ef22332
...
@@ -5,7 +5,6 @@ require 'spec_helper'
...
@@ -5,7 +5,6 @@ require 'spec_helper'
RSpec
.
describe
'User searches Alert Management alerts'
,
:js
do
RSpec
.
describe
'User searches Alert Management alerts'
,
:js
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
let_it_be
(
:alerts_service
)
{
create
(
:alerts_service
,
project:
project
)
}
let_it_be
(
:alert
)
{
create
(
:alert_management_alert
,
project:
project
,
status:
'triggered'
)
}
let_it_be
(
:alert
)
{
create
(
:alert_management_alert
,
project:
project
,
status:
'triggered'
)
}
before_all
do
before_all
do
...
...
spec/features/alert_management/user_updates_alert_status_spec.rb
View file @
8ef22332
...
@@ -5,7 +5,6 @@ require 'spec_helper'
...
@@ -5,7 +5,6 @@ require 'spec_helper'
RSpec
.
describe
'User updates Alert Management status'
,
:js
do
RSpec
.
describe
'User updates Alert Management status'
,
:js
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
let_it_be
(
:alerts_service
)
{
create
(
:alerts_service
,
project:
project
)
}
let_it_be
(
:alert
)
{
create
(
:alert_management_alert
,
project:
project
,
status:
'triggered'
)
}
let_it_be
(
:alert
)
{
create
(
:alert_management_alert
,
project:
project
,
status:
'triggered'
)
}
before_all
do
before_all
do
...
...
spec/graphql/types/projects/service_type_spec.rb
View file @
8ef22332
...
@@ -9,7 +9,7 @@ RSpec.describe Types::Projects::ServiceType do
...
@@ -9,7 +9,7 @@ RSpec.describe Types::Projects::ServiceType do
it
'resolves the corresponding type for objects'
do
it
'resolves the corresponding type for objects'
do
expect
(
described_class
.
resolve_type
(
build
(
:jira_service
),
{})).
to
eq
(
Types
::
Projects
::
Services
::
JiraServiceType
)
expect
(
described_class
.
resolve_type
(
build
(
:jira_service
),
{})).
to
eq
(
Types
::
Projects
::
Services
::
JiraServiceType
)
expect
(
described_class
.
resolve_type
(
build
(
:service
),
{})).
to
eq
(
Types
::
Projects
::
Services
::
BaseServiceType
)
expect
(
described_class
.
resolve_type
(
build
(
:service
),
{})).
to
eq
(
Types
::
Projects
::
Services
::
BaseServiceType
)
expect
(
described_class
.
resolve_type
(
build
(
:
alerts
_service
),
{})).
to
eq
(
Types
::
Projects
::
Services
::
BaseServiceType
)
expect
(
described_class
.
resolve_type
(
build
(
:
drone_ci
_service
),
{})).
to
eq
(
Types
::
Projects
::
Services
::
BaseServiceType
)
expect
(
described_class
.
resolve_type
(
build
(
:custom_issue_tracker_service
),
{})).
to
eq
(
Types
::
Projects
::
Services
::
BaseServiceType
)
expect
(
described_class
.
resolve_type
(
build
(
:custom_issue_tracker_service
),
{})).
to
eq
(
Types
::
Projects
::
Services
::
BaseServiceType
)
end
end
end
end
...
...
spec/views/projects/settings/operations/show.html.haml_spec.rb
View file @
8ef22332
...
@@ -15,14 +15,6 @@ RSpec.describe 'projects/settings/operations/show' do
...
@@ -15,14 +15,6 @@ RSpec.describe 'projects/settings/operations/show' do
end
end
let_it_be
(
:prometheus_service
)
{
create
(
:prometheus_service
,
project:
project
)
}
let_it_be
(
:prometheus_service
)
{
create
(
:prometheus_service
,
project:
project
)
}
let_it_be
(
:alerts_service
)
{
create
(
:alerts_service
,
project:
project
)
}
let
(
:operations_show_locals
)
do
{
prometheus_service:
prometheus_service
,
alerts_service:
alerts_service
}
end
before_all
do
before_all
do
project
.
add_maintainer
(
user
)
project
.
add_maintainer
(
user
)
...
@@ -35,13 +27,24 @@ RSpec.describe 'projects/settings/operations/show' do
...
@@ -35,13 +27,24 @@ RSpec.describe 'projects/settings/operations/show' do
.
and_return
(
error_tracking_setting
)
.
and_return
(
error_tracking_setting
)
allow
(
view
).
to
receive
(
:tracing_setting
)
allow
(
view
).
to
receive
(
:tracing_setting
)
.
and_return
(
tracing_setting
)
.
and_return
(
tracing_setting
)
allow
(
view
).
to
receive
(
:prometheus_service
)
.
and_return
(
prometheus_service
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
end
end
describe
'Operations > Alerts'
do
it
'renders the Operations Settings page'
do
render
expect
(
rendered
).
to
have_content
_
(
'Alerts'
)
expect
(
rendered
).
to
have_content
_
(
'Display alerts from all your monitoring tools directly within GitLab.'
)
end
end
describe
'Operations > Error Tracking'
do
describe
'Operations > Error Tracking'
do
context
'Settings page '
do
context
'Settings page '
do
it
'renders the Operations Settings page'
do
it
'renders the Operations Settings page'
do
render
template:
'projects/settings/operations/show'
,
locals:
operations_show_locals
render
expect
(
rendered
).
to
have_content
_
(
'Error tracking'
)
expect
(
rendered
).
to
have_content
_
(
'Error tracking'
)
expect
(
rendered
).
to
have_content
_
(
'To link Sentry to GitLab, enter your Sentry URL and Auth Token'
)
expect
(
rendered
).
to
have_content
_
(
'To link Sentry to GitLab, enter your Sentry URL and Auth Token'
)
...
@@ -49,10 +52,34 @@ RSpec.describe 'projects/settings/operations/show' do
...
@@ -49,10 +52,34 @@ RSpec.describe 'projects/settings/operations/show' do
end
end
end
end
describe
'Operations > Prometheus'
do
context
'when settings_operations_prometheus_service flag is enabled'
do
it
'renders the Operations Settings page'
do
render
expect
(
rendered
).
to
have_content
_
(
'Prometheus'
)
expect
(
rendered
).
to
have_content
_
(
'Link Prometheus monitoring to GitLab.'
)
expect
(
rendered
).
to
have_content
_
(
'To enable the installation of Prometheus on your clusters, deactivate the manual configuration below'
)
end
end
context
'when settings_operations_prometheus_service is disabled'
do
before
do
stub_feature_flags
(
settings_operations_prometheus_service:
false
)
end
it
'renders the Operations Settings page'
do
render
expect
(
rendered
).
not_to
have_content
_
(
'Select the Active checkbox to override the Auto Configuration with custom settings. If unchecked, Auto Configuration settings are used.'
)
end
end
end
describe
'Operations > Tracing'
do
describe
'Operations > Tracing'
do
context
'with project.tracing_external_url'
do
context
'with project.tracing_external_url'
do
it
'links to project.tracing_external_url'
do
it
'links to project.tracing_external_url'
do
render
template:
'projects/settings/operations/show'
,
locals:
operations_show_locals
render
expect
(
rendered
).
to
have_link
(
'Tracing'
,
href:
tracing_setting
.
external_url
)
expect
(
rendered
).
to
have_link
(
'Tracing'
,
href:
tracing_setting
.
external_url
)
end
end
...
@@ -66,7 +93,7 @@ RSpec.describe 'projects/settings/operations/show' do
...
@@ -66,7 +93,7 @@ RSpec.describe 'projects/settings/operations/show' do
end
end
it
'sanitizes external_url'
do
it
'sanitizes external_url'
do
render
template:
'projects/settings/operations/show'
,
locals:
operations_show_locals
render
expect
(
tracing_setting
.
external_url
).
to
eq
(
malicious_tracing_url
)
expect
(
tracing_setting
.
external_url
).
to
eq
(
malicious_tracing_url
)
expect
(
rendered
).
to
have_link
(
'Tracing'
,
href:
cleaned_url
)
expect
(
rendered
).
to
have_link
(
'Tracing'
,
href:
cleaned_url
)
...
@@ -82,7 +109,7 @@ RSpec.describe 'projects/settings/operations/show' do
...
@@ -82,7 +109,7 @@ RSpec.describe 'projects/settings/operations/show' do
end
end
it
'links to Tracing page'
do
it
'links to Tracing page'
do
render
template:
'projects/settings/operations/show'
,
locals:
operations_show_locals
render
expect
(
rendered
).
to
have_link
(
'Tracing'
,
href:
project_tracing_path
(
project
))
expect
(
rendered
).
to
have_link
(
'Tracing'
,
href:
project_tracing_path
(
project
))
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