Merge "[ci] Split legacy-rally-dsvm-cli job"
This commit is contained in:
commit
ac5121edf9
@ -19,12 +19,17 @@ import traceback
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import rally as rally_m
|
import rally as rally_m
|
||||||
from tests.functional import utils
|
from tests.check_samples import utils
|
||||||
|
|
||||||
|
|
||||||
class TestPreCreatedTasks(unittest.TestCase):
|
class TestPreCreatedTasks(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_check_success(self):
|
||||||
|
rally = utils.Rally()
|
||||||
|
rally("deployment check")
|
||||||
|
|
||||||
def test_task_samples_is_valid(self):
|
def test_task_samples_is_valid(self):
|
||||||
|
|
||||||
rally = utils.Rally()
|
rally = utils.Rally()
|
||||||
full_path = os.path.join(
|
full_path = os.path.join(
|
||||||
os.path.dirname(rally_m.__file__), os.pardir, "tasks", "openstack")
|
os.path.dirname(rally_m.__file__), os.pardir, "tasks", "openstack")
|
||||||
|
@ -30,7 +30,7 @@ from rally.common import broker
|
|||||||
from rally.common import yamlutils as yaml
|
from rally.common import yamlutils as yaml
|
||||||
from rally import plugins
|
from rally import plugins
|
||||||
from rally.plugins.openstack.context.keystone import users
|
from rally.plugins.openstack.context.keystone import users
|
||||||
from tests.functional import utils
|
from tests.check_samples import utils
|
||||||
|
|
||||||
|
|
||||||
class TestTaskSamples(unittest.TestCase):
|
class TestTaskSamples(unittest.TestCase):
|
||||||
|
32
tests/check_samples/utils.py
Normal file
32
tests/check_samples/utils.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from tests.functional import utils
|
||||||
|
|
||||||
|
|
||||||
|
DEPLOYMENT_FILE = "/tmp/rally_functests_main_deployment.json"
|
||||||
|
|
||||||
|
|
||||||
|
class Rally(utils.Rally):
|
||||||
|
|
||||||
|
def __init__(self, force_new_db=False):
|
||||||
|
self._DEPLOYMENT_CREATE_ARGS = " --file %s" % DEPLOYMENT_FILE
|
||||||
|
if not os.path.exists(DEPLOYMENT_FILE):
|
||||||
|
subprocess.call(["rally", "--log-file", "/dev/null",
|
||||||
|
"deployment", "config"],
|
||||||
|
stdout=open(DEPLOYMENT_FILE, "w"))
|
||||||
|
super(Rally, self).__init__(force_new_db=force_new_db)
|
@ -67,7 +67,7 @@ class DeploymentTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
def test_check_success(self):
|
def test_check_success(self):
|
||||||
rally = utils.Rally()
|
rally = utils.Rally()
|
||||||
self.assertTrue(rally("deployment check"))
|
rally("deployment check")
|
||||||
|
|
||||||
def test_check_fail(self):
|
def test_check_fail(self):
|
||||||
rally = utils.Rally()
|
rally = utils.Rally()
|
||||||
|
@ -26,8 +26,6 @@ import tempfile
|
|||||||
from oslo_utils import encodeutils
|
from oslo_utils import encodeutils
|
||||||
from six.moves import configparser
|
from six.moves import configparser
|
||||||
|
|
||||||
DEPLOYMENT_FILE = "/tmp/rally_functests_main_deployment.json"
|
|
||||||
|
|
||||||
|
|
||||||
class RallyCliError(Exception):
|
class RallyCliError(Exception):
|
||||||
|
|
||||||
@ -72,12 +70,9 @@ class Rally(object):
|
|||||||
output = rally("deployment list")
|
output = rally("deployment list")
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
_DEPLOYMENT_CREATE_ARGS = ""
|
||||||
|
|
||||||
def __init__(self, fake=False, force_new_db=False):
|
def __init__(self, force_new_db=False):
|
||||||
if not os.path.exists(DEPLOYMENT_FILE):
|
|
||||||
subprocess.call(["rally", "--log-file", "/dev/null",
|
|
||||||
"deployment", "config"],
|
|
||||||
stdout=open(DEPLOYMENT_FILE, "w"))
|
|
||||||
|
|
||||||
# NOTE(sskripnick): we should change home dir to avoid races
|
# NOTE(sskripnick): we should change home dir to avoid races
|
||||||
# and do not touch any user files in ~/.rally
|
# and do not touch any user files in ~/.rally
|
||||||
@ -119,7 +114,7 @@ class Rally(object):
|
|||||||
self.reports_root = os.environ.get("REPORTS_ROOT",
|
self.reports_root = os.environ.get("REPORTS_ROOT",
|
||||||
"rally-cli-output-files")
|
"rally-cli-output-files")
|
||||||
self._created_files = []
|
self._created_files = []
|
||||||
self("deployment create --file %s --name MAIN" % DEPLOYMENT_FILE,
|
self("deployment create --name MAIN%s" % self._DEPLOYMENT_CREATE_ARGS,
|
||||||
write_report=False)
|
write_report=False)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
2
tox.ini
2
tox.ini
@ -57,7 +57,7 @@ commands = oslo_debug_helper -t tests {posargs}
|
|||||||
sitepackages = True
|
sitepackages = True
|
||||||
commands =
|
commands =
|
||||||
find . -type f -name "*.pyc" -delete
|
find . -type f -name "*.pyc" -delete
|
||||||
{toxinidir}/tests/ci/rally_cli_job.sh
|
python {toxinidir}/tests/ci/pytest_launcher.py tests/check_samples --posargs={posargs}
|
||||||
|
|
||||||
[testenv:functional]
|
[testenv:functional]
|
||||||
sitepackages = True
|
sitepackages = True
|
||||||
|
Loading…
Reference in New Issue
Block a user