Skip to content

Commit

Permalink
Merge branch 'master' into cost-dashboard-impl
Browse files Browse the repository at this point in the history
  • Loading branch information
armstrongmsg authored Apr 30, 2020
2 parents f11bbf3 + 237327e commit 7a9b376
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ pipeline {
sh 'tox -epep8'
}
}
stage('Coverage') {
agent any
steps {
sh 'tox -e coverage'
}
}
stage('Integration') {
agent any
steps {
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ mock
six
python-monascaclient==1.5.0
pytest
pytest-cov
requests_mock
kubernetes==8.0.0
flake8
urllib3==1.22
urllib3==1.24.2

9 changes: 8 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
# and then run "tox" from this directory.

[tox]
envlist = py37, pep8
envlist = py37,pep8,coverage

[testenv]
usedevelop = True
commands = py.test
deps =
-r{toxinidir}/requirements.txt

[testenv:coverage]
basepython = python3.7
usedevelop = True
commands = py.test --cov=visualizer --cov=k8s-grafana --cov-report=term-missing visualizer/ k8s-grafana/
deps =
-r{toxinidir}/requirements.txt

[testenv:pep8]
commands =
flake8 {posargs}
Expand Down
4 changes: 3 additions & 1 deletion visualizer/service/api/v10.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def stop_visualization(data, app_id):
raise exceptions.BadRequestException()

plugin = data['plugin']
if plugin == 'kubejobs' or plugin == 'kubejobs_cost':

# TODO We need to think in a better design for this
if plugin == 'kubejobs' or plugin == 'kubejobs_cost' or plugin == 'stream_kubejobs':
# Call the executor by app_id and stop the visualization.
visualized_apps[app_id].stop_visualization()

Expand Down
4 changes: 3 additions & 1 deletion visualizer/utils/datasources/datasource_influx.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def __init__(self, monitor_plugin, database_data, app_id):
self.datasource_url = database_data['url']
self.datasource_port = database_data['port']
self.database_name = database_data['name']
if(monitor_plugin == 'kubejobs'):
# TODO We need to think in a better design for this
if(monitor_plugin == 'kubejobs' or
monitor_plugin == 'stream_kubejobs'):
self.dashboard_path = K8S_TEMPLATE_PATH

elif(monitor_plugin == 'kubejobs_cost'):
Expand Down
2 changes: 2 additions & 0 deletions visualizer/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class Log:
def __init__(self, name, output_file_path):
self._verify_existing_paths()
self.logger = logging.getLogger(name)
self.logger.propagate = False

if not len(self.logger.handlers):
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
Expand Down

0 comments on commit 7a9b376

Please sign in to comment.