mirror of https://github.com/nicolargo/glances.git
Improve unittest for InfluxDB plugin #3149
This commit is contained in:
parent
3016717208
commit
3cdededa78
3
Makefile
3
Makefile
|
|
@ -114,6 +114,9 @@ test-min: ## Run core unit tests in minimal environment
|
|||
test-min-with-upgrade: venv-min-upgrade ## Upgrade deps and run unit tests in minimal environment
|
||||
$(venv_min)/python -m pytest tests/test_core.py
|
||||
|
||||
test-influxdb: ## Run interface tests with InfluxDB
|
||||
/bin/bash ./tests/test_influxdb.sh
|
||||
|
||||
# ===================================================================
|
||||
# Linters, profilers and cyber security
|
||||
# ===================================================================
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class GlancesExport:
|
|||
"""Return the list of plugins last exported."""
|
||||
return self._last_exported_list
|
||||
|
||||
def init(self, stats):
|
||||
def init_fields(self, stats):
|
||||
"""Return fields description in order to init stats in a server."""
|
||||
if not self.export_enable:
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ class GlancesStats:
|
|||
for e in self.getExportsList():
|
||||
logger.debug(f"Init exported stats using the {e} module")
|
||||
# @TODO: is it a good idea to thread this call ?
|
||||
self._exports[e].init(input_stats)
|
||||
self._exports[e].init_fields(input_stats)
|
||||
# In this first loop, data are not exported because some information are missing (rate for example)
|
||||
logger.debug("Do not export stats during the first iteration because some information are missing")
|
||||
self.first_export = False
|
||||
|
|
|
|||
Loading…
Reference in New Issue