Pylint: add fuel_tests
1. Add fuel_tests target 2. Fix failures of Pylint(it's voting for now) Change-Id: I6c7f560e70bc555d22ab342d48723642c9df8e25
This commit is contained in:
@@ -12,6 +12,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
# pylint: disable=redefined-builtin
|
||||||
|
from six.moves import xrange
|
||||||
|
# pylint: enable=redefined-builtin
|
||||||
|
|
||||||
from fuelweb_test import logger
|
from fuelweb_test import logger
|
||||||
from fuelweb_test import settings
|
from fuelweb_test import settings
|
||||||
from fuelweb_test.helpers.decorators import create_diagnostic_snapshot
|
from fuelweb_test.helpers.decorators import create_diagnostic_snapshot
|
||||||
@@ -36,6 +40,7 @@ class Manager(Basic):
|
|||||||
if config_file:
|
if config_file:
|
||||||
self._load_config()
|
self._load_config()
|
||||||
self._context = cls
|
self._context = cls
|
||||||
|
self.assigned_slaves = set()
|
||||||
|
|
||||||
def _cluster_from_template(self):
|
def _cluster_from_template(self):
|
||||||
"""Create cluster from template file."""
|
"""Create cluster from template file."""
|
||||||
@@ -241,12 +246,10 @@ class Manager(Basic):
|
|||||||
self.env.make_snapshot(snapshot_name, is_make=True)
|
self.env.make_snapshot(snapshot_name, is_make=True)
|
||||||
self.env.resume_environment()
|
self.env.resume_environment()
|
||||||
return True
|
return True
|
||||||
else:
|
logger.error(
|
||||||
logger.error("Can't bootstrap nodes because release "
|
"Can't bootstrap nodes because release snapshot didn't revert")
|
||||||
"snapshot didn't revert")
|
raise RuntimeError(
|
||||||
return False
|
"Can't bootstrap nodes because release snapshot didn't revert")
|
||||||
raise RuntimeError("Can't bootstrap nodes because release "
|
|
||||||
"snapshot didn't revert")
|
|
||||||
|
|
||||||
def get_ready_cluster(self, config=None):
|
def get_ready_cluster(self, config=None):
|
||||||
"""Create and deploy cluster."""
|
"""Create and deploy cluster."""
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
from __future__ import division
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@@ -24,6 +25,9 @@ from fuelweb_test import settings
|
|||||||
from system_test.core.discover import config_filter
|
from system_test.core.discover import config_filter
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=no-member
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='session')
|
@pytest.fixture(scope='session')
|
||||||
def config_file(request):
|
def config_file(request):
|
||||||
"""Fixture which provide config for test."""
|
"""Fixture which provide config for test."""
|
||||||
@@ -126,7 +130,9 @@ def pytest_runtest_teardown(item):
|
|||||||
step_name = item.function.__name__
|
step_name = item.function.__name__
|
||||||
spent_time = time.time() - item._start_time
|
spent_time = time.time() - item._start_time
|
||||||
minutes = spent_time // 60
|
minutes = spent_time // 60
|
||||||
|
# pylint: disable=round-builtin
|
||||||
seconds = int(round(spent_time)) % 60
|
seconds = int(round(spent_time)) % 60
|
||||||
|
# pylint: enable=round-builtin
|
||||||
finish_step = "FINISH {} STEP TOOK {} min {} sec".format(
|
finish_step = "FINISH {} STEP TOOK {} min {} sec".format(
|
||||||
step_name, minutes, seconds)
|
step_name, minutes, seconds)
|
||||||
foot = "\n" + "<" * 5 + "#" * 30 + "[ {} ]" + "#" * 30 + ">" * 5
|
foot = "\n" + "<" * 5 + "#" * 30 + "[ {} ]" + "#" * 30 + ">" * 5
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ from fuelweb_test.helpers import checkers
|
|||||||
from fuelweb_test.helpers.ssh_manager import SSHManager
|
from fuelweb_test.helpers.ssh_manager import SSHManager
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=no-member
|
||||||
|
|
||||||
|
|
||||||
ssh_manager = SSHManager()
|
ssh_manager = SSHManager()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ from fuelweb_test.helpers import os_actions
|
|||||||
from fuelweb_test.helpers.ssh_manager import SSHManager
|
from fuelweb_test.helpers.ssh_manager import SSHManager
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=no-member
|
||||||
|
|
||||||
|
|
||||||
ssh_manager = SSHManager()
|
ssh_manager = SSHManager()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
11
tox.ini
11
tox.ini
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
[tox]
|
[tox]
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
envlist = pep8, py27, pylint, docs, pep8-py{34,35}, pylint-py{27}-{fuelweb,system,gates}
|
envlist = pep8, py27, pylint, docs, pep8-py{34,35}, pylint-py{27}-{fuelweb,system,gates,fuel}
|
||||||
skip_missing_interpreters = True
|
skip_missing_interpreters = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
@@ -47,7 +47,7 @@ deps=
|
|||||||
-r{toxinidir}/fuelweb_test/requirements.txt
|
-r{toxinidir}/fuelweb_test/requirements.txt
|
||||||
pylint
|
pylint
|
||||||
commands=
|
commands=
|
||||||
pylint --rcfile=.pylintrc_gerrit fuelweb_test system_test gates_tests
|
pylint --rcfile=.pylintrc_gerrit fuelweb_test system_test gates_tests fuel_tests
|
||||||
|
|
||||||
|
|
||||||
[testenv:pylint-py27-fuelweb]
|
[testenv:pylint-py27-fuelweb]
|
||||||
@@ -68,6 +68,13 @@ deps=
|
|||||||
pylint
|
pylint
|
||||||
commands=pylint gates_tests
|
commands=pylint gates_tests
|
||||||
|
|
||||||
|
[testenv:pylint-py27-fuel]
|
||||||
|
deps=
|
||||||
|
-r{toxinidir}/fuelweb_test/requirements.txt
|
||||||
|
pylint
|
||||||
|
commands=pylint fuel_tests
|
||||||
|
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
changedir = doc
|
changedir = doc
|
||||||
deps =
|
deps =
|
||||||
|
|||||||
Reference in New Issue
Block a user