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
1b0bf5ae
Commit
1b0bf5ae
authored
7 years ago
by
Simon Crowle
Browse files
Options
Downloads
Patches
Plain Diff
Renames influx_db client fixture
get_db_client -> influx_db
parent
f017582c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clmctest/monitoring/conftest.py
+1
-1
1 addition, 1 deletion
clmctest/monitoring/conftest.py
clmctest/monitoring/test_simresults.py
+3
-3
3 additions, 3 deletions
clmctest/monitoring/test_simresults.py
with
4 additions
and
4 deletions
clmctest/monitoring/conftest.py
+
1
−
1
View file @
1b0bf5ae
...
...
@@ -40,7 +40,7 @@ def streaming_sim_params(streaming_sim_config):
@pytest.fixture
(
params
=
[{
'
database
'
:
'
CLMCMetrics
'
}],
scope
=
'
module
'
)
def
get_db_client
(
streaming_sim_config
,
request
):
def
influx_db
(
streaming_sim_config
,
request
):
"""
Creates an Influx DB client for the CLMC metrics database
...
...
This diff is collapsed.
Click to expand it.
clmctest/monitoring/test_simresults.py
+
3
−
3
View file @
1b0bf5ae
...
...
@@ -25,13 +25,13 @@ class TestSimulation(object):
(
'
SELECT count(*) FROM
"
CLMCMetrics
"
.
"
autogen
"
.
"
mpegdash_service_config
"
WHERE ipendpoint=
\'
adaptive_streaming_I1_apache2
\'
'
,
{
"
time
"
:
"
1970-01-01T00:00:00Z
"
,
"
count_avg_running
"
:
3602
,
"
count_avg_starting
"
:
3602
,
"
count_avg_stopped
"
:
3602
,
"
count_avg_stopping
"
:
3602
,
"
count_running
"
:
3602
,
"
count_starting
"
:
3602
,
"
count_stopped
"
:
3602
,
"
count_stopping
"
:
3602
}),
])
def
test_simulation
(
self
,
query
,
expected_result
,
get_db_client
,
run_simulation_fixture
):
def
test_simulation
(
self
,
query
,
expected_result
,
influx_db
,
run_simulation_fixture
):
"""
This is the entry point of the test. This method will be found and executed when the module is ran using pytest
:param query: the query to execute (value obtained from the pytest parameter decorator)
:param expected_result: the result expected from executing the query (value obtained from the pytest parameter decorator)
:param
get_db_client
the import db client fixture - imported from contest.py
:param
influx_db
the import db client fixture - imported from contest.py
:param run_simulation_fixture: the imported fixture to use to generate the testing data - the return value of the fixture is not needed in this case
"""
...
...
@@ -40,7 +40,7 @@ class TestSimulation(object):
print
(
"
\n
"
)
# prints a blank line for formatting purposes
# the raise_errors=False argument is given so that we could actually test that the DB didn't return any errors instead of raising an exception
query_result
=
get_db_client
.
query
(
query
,
raise_errors
=
False
)
query_result
=
influx_db
.
query
(
query
,
raise_errors
=
False
)
# test the error attribute of the result is None, that is no error is returned from executing the DB query
assert
query_result
.
error
is
None
,
"
An error was encountered while executing query {0}.
"
.
format
(
query
)
...
...
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