Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flame-clmc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
flame
flame-clmc
Commits
4d2f244c
Commit
4d2f244c
authored
6 years ago
by
Nikolay Stanchev
Browse files
Options
Downloads
Patches
Plain Diff
Adds a test for the response of the execute pipeline endpoint
parent
72b7b635
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/service/clmcservice/graphapi/tests.py
+17
-15
17 additions, 15 deletions
src/service/clmcservice/graphapi/tests.py
with
17 additions
and
15 deletions
src/service/clmcservice/graphapi/tests.py
+
17
−
15
View file @
4d2f244c
...
...
@@ -123,19 +123,6 @@ class TestGraphAPI(object):
switch_nodes
=
set
([
node
[
"
name
"
]
for
node
in
graph_db
.
nodes
.
match
(
"
Switch
"
)])
assert
switch_nodes
==
set
(
"
127.0.0.
"
+
str
(
i
)
for
i
in
range
(
1
,
7
)),
"
Switch nodes must have been created by the db_testing_data fixture
"
# test with invalid body - missing 'from' and 'to' parameters
service_functions
=
dict
(
nginx
=
{
"
measurement_name
"
:
"
nginx
"
,
"
response_time_field
"
:
"
mean(avg_processing_time)
"
,
"
request_size_field
"
:
"
mean(avg_request_size)
"
,
"
response_size_field
"
:
"
mean(avg_response_size)
"
},
minio
=
{
"
measurement_name
"
:
"
minio_http
"
,
"
response_time_field
"
:
"
mean(total_processing_time)/mean(total_requests_count)
"
,
"
request_size_field
"
:
"
mean(total_requests_size)/mean(total_requests_count)
"
,
"
response_size_field
"
:
"
mean(total_response_size)/mean(total_requests_count)
"
},
apache
=
{
"
measurement_name
"
:
"
apache
"
,
"
response_time_field
"
:
"
mean(avg_processing_time)
"
,
"
request_size_field
"
:
"
mean(avg_request_size)
"
,
"
response_size_field
"
:
"
mean(avg_response_size)
"
})
body
=
dumps
(
dict
(
service_function_chain
=
"
sfc
"
,
service_function_chain_instance
=
"
sfc_1
"
,
service_functions
=
service_functions
))
request
=
testing
.
DummyRequest
()
request
.
body
=
body
.
encode
(
request
.
charset
)
with
pytest
.
raises
(
HTTPBadRequest
):
GraphAPI
(
request
).
build_temporal_graph
()
# Create a valid build request and send it to the API endpoint
uuid_mock
.
return_value
=
self
.
graph_1_test_id
service_functions
=
dict
(
nginx
=
{
"
measurement_name
"
:
"
nginx
"
,
"
response_time_field
"
:
"
mean(avg_processing_time)
"
,
...
...
@@ -508,12 +495,27 @@ class TestGraphAPI(object):
error_raised
=
True
assert
error_raised
,
error_msg
def
test_execute_pipeline_graph
(
self
):
@patch
(
'
clmcservice.graphapi.views.uuid4
'
)
def
test_execute_pipeline_graph
(
self
,
uuid_mock
):
"""
Tests the functionality to start a pipeline script executing the graph API workflow - build, query, delete
"""
assert
False
,
"
Not implemented
"
uuid_mock
.
return_value
=
"
monitor_test_uuid1
"
service_functions
=
dict
(
nginx
=
{
"
measurement_name
"
:
"
nginx
"
,
"
response_time_field
"
:
"
mean(avg_processing_time)
"
,
"
request_size_field
"
:
"
mean(avg_request_size)
"
,
"
response_size_field
"
:
"
mean(avg_response_size)
"
},
minio
=
{
"
measurement_name
"
:
"
minio_http
"
,
"
response_time_field
"
:
"
mean(total_processing_time)/mean(total_requests_count)
"
,
"
request_size_field
"
:
"
mean(total_requests_size)/mean(total_requests_count)
"
,
"
response_size_field
"
:
"
mean(total_response_size)/mean(total_requests_count)
"
})
monitor_json_body
=
dict
(
service_function_chain
=
"
test_sfc
"
,
service_function_chain_instance
=
"
test_sfc_premium
"
,
service_functions
=
service_functions
)
monitor_json_body
[
"
query_period
"
]
=
30
monitor_json_body
[
"
results_measurement_name
"
]
=
"
graph_measurements
"
body
=
dumps
(
monitor_json_body
)
request
=
testing
.
DummyRequest
()
request
.
body
=
body
.
encode
(
request
.
charset
)
response
=
GraphAPI
(
request
).
execute_graph_pipeline
()
assert
response
==
{
"
uuid
"
:
uuid_mock
.
return_value
,
"
database
"
:
"
test_sfc
"
}
assert
False
,
"
Implement tests for checking that an actual process is started.
"
@staticmethod
def
check_exist_relationship
(
relationships_tuple
,
graph
,
uuid
):
...
...
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