Merge "[ci] Split legacy-rally-dsvm-cli job"

This commit is contained in:
Zuul 2017-12-05 02:31:18 +00:00 committed by Gerrit Code Review
commit ac5121edf9
6 changed files with 44 additions and 12 deletions

View File

@ -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")

View File

@ -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):

View 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)

View File

@ -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()

View File

@ -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):

View File

@ -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