Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TFS
controller
Commits
3ca856bb
Commit
3ca856bb
authored
2 years ago
by
Javier Moreno
Browse files
Options
Downloads
Patches
Plain Diff
Updated last commit
parent
0148f285
No related branches found
No related tags found
1 merge request
!5
Feat/monitoring subscriptions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/monitoring/tests/Messages.py
+5
-0
5 additions, 0 deletions
src/monitoring/tests/Messages.py
src/monitoring/tests/test_unitary.py
+11
-3
11 additions, 3 deletions
src/monitoring/tests/test_unitary.py
with
16 additions
and
3 deletions
src/monitoring/tests/Messages.py
+
5
−
0
View file @
3ca856bb
...
...
@@ -64,6 +64,11 @@ def include_kpi_request(kpi_id):
_include_kpi_request
.
kpi_value
.
int32Val
=
500
# pylint: disable=maybe-no-member
return
_include_kpi_request
def
kpi_descriptor_list
():
_kpi_descriptor_list
=
monitoring_pb2
.
KpiDescriptorList
()
return
_kpi_descriptor_list
def
kpi_query
():
_kpi_query
=
monitoring_pb2
.
KpiQuery
()
...
...
This diff is collapsed.
Click to expand it.
src/monitoring/tests/test_unitary.py
+
11
−
3
View file @
3ca856bb
...
...
@@ -28,7 +28,7 @@ from common.message_broker.Factory import get_messagebroker_backend, BackendEnum
from
common.message_broker.MessageBroker
import
MessageBroker
from
common.proto
import
monitoring_pb2
from
common.proto.monitoring_pb2
import
KpiId
,
KpiDescriptor
,
KpiList
,
SubsDescriptor
,
SubsIDList
,
AlarmID
,
\
AlarmDescriptor
,
AlarmIDList
,
Kpi
AlarmDescriptor
,
AlarmIDList
,
Kpi
,
KpiDescriptorList
from
context.client.ContextClient
import
ContextClient
from
context.service.grpc_server.ContextService
import
ContextService
...
...
@@ -46,7 +46,8 @@ from monitoring.service import SqliteTools, MetricsDBTools
from
monitoring.service.MonitoringService
import
MonitoringService
from
monitoring.service.EventTools
import
EventsDeviceCollector
from
monitoring.tests.Messages
import
create_kpi_request
,
include_kpi_request
,
monitor_kpi_request
,
\
create_kpi_request_b
,
create_kpi_request_c
,
kpi_query
,
subs_descriptor
,
subs_id
,
alarm_descriptor
,
alarm_id
,
kpi_id
create_kpi_request_b
,
create_kpi_request_c
,
kpi_query
,
subs_descriptor
,
subs_id
,
alarm_descriptor
,
alarm_id
,
kpi_id
,
\
kpi_descriptor_list
from
monitoring.tests.Objects
import
DEVICE_DEV1
,
DEVICE_DEV1_CONNECT_RULES
,
DEVICE_DEV1_UUID
from
monitoring.service.MonitoringServiceServicerImpl
import
LOGGER
...
...
@@ -189,7 +190,7 @@ def test_delete_kpi(monitoring_client): # pylint: disable=redefined-outer-name
LOGGER
.
debug
(
str
(
response
))
assert
isinstance
(
response
,
Empty
)
# Test case that makes use of client fixture to test server's Get
InstantKpi
method
# Test case that makes use of client fixture to test server's Get
KpiDescriptor
method
def
test_get_kpidescritor
(
monitoring_client
):
# pylint: disable=redefined-outer-name
LOGGER
.
warning
(
'
test_getkpidescritor_kpi begin
'
)
response
=
monitoring_client
.
SetKpi
(
create_kpi_request_c
())
...
...
@@ -198,6 +199,13 @@ def test_get_kpidescritor(monitoring_client): # pylint: disable=redefined-outer-
# LOGGER.debug(str(response))
assert
isinstance
(
response
,
KpiDescriptor
)
# Test case that makes use of client fixture to test server's GetKpiDescriptor method
def
test_get_kpi_descriptor_list
(
monitoring_client
):
# pylint: disable=redefined-outer-name
LOGGER
.
warning
(
'
test_getkpidescritor_kpi begin
'
)
response
=
monitoring_client
.
GetKpiDescriptorList
(
kpi_descriptor_list
())
# LOGGER.debug(str(response))
assert
isinstance
(
response
,
KpiDescriptorList
)
# Test case that makes use of client fixture to test server's IncludeKpi method
def
test_include_kpi
(
monitoring_client
):
# pylint: disable=redefined-outer-name
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment