Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c151d6bba8 | ||
| 61d7fcef7b | |||
| f34ec5a89d | |||
|
|
244f229af7 | ||
| 0835706738 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,3 +16,4 @@ dist
|
||||
AUTHORS
|
||||
ChangeLog
|
||||
releasenotes/build
|
||||
.idea/
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
host=review.opendev.org
|
||||
port=29418
|
||||
project=openstack/python-cloudkittyclient.git
|
||||
defaultbranch=stable/2023.1
|
||||
defaultbranch=stable/2023.2
|
||||
|
||||
@@ -15,26 +15,57 @@
|
||||
#
|
||||
import json
|
||||
import os
|
||||
import shlex
|
||||
import subprocess
|
||||
|
||||
from cloudkittyclient.tests import utils
|
||||
|
||||
from oslo_log import log
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class BaseFunctionalTest(utils.BaseTestCase):
|
||||
|
||||
# DevStack is using VENV by default. Therefore, to execute the commands,
|
||||
# we need to activate the VENV. And, to do that, we need the VENV path.
|
||||
# This path is hardcoded here because we could not find a variable in this
|
||||
# Python code to retrieve the VENV variable from the test machine.
|
||||
# It seems that because of the stack TOX -> stestr -> this python code, and
|
||||
# so on, we are not able to access the DevStack variables here.
|
||||
#
|
||||
# If somebody finds a solution, we can remove the hardcoded path here.
|
||||
DEV_STACK_VENV_BASE_PATH = "/opt/stack/data/venv"
|
||||
|
||||
BASE_COMMAND_WITH_VENV = "source %s/bin/activate && %s "
|
||||
|
||||
def _run(self, executable, action,
|
||||
flags='', params='', fmt='-f json', stdin=None, has_output=True):
|
||||
if not has_output:
|
||||
fmt = ''
|
||||
|
||||
does_venv_exist = not os.system("ls -lah /opt/stack/data/venv")
|
||||
LOG.info("Test to check if the VENV file exist returned: [%s].",
|
||||
does_venv_exist)
|
||||
|
||||
system_variables = os.environ.copy()
|
||||
LOG.info("System variables [%s] found when executing the tests.",
|
||||
system_variables)
|
||||
|
||||
cmd = ' '.join([executable, flags, action, params, fmt])
|
||||
cmd = shlex.split(cmd)
|
||||
|
||||
actual_command_with_venv = self.BASE_COMMAND_WITH_VENV % (
|
||||
self.DEV_STACK_VENV_BASE_PATH, cmd)
|
||||
|
||||
LOG.info("Command being executed: [%s].", actual_command_with_venv)
|
||||
|
||||
p = subprocess.Popen(
|
||||
cmd, env=os.environ.copy(), shell=False,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
stdin=subprocess.PIPE if stdin else None,
|
||||
["bash", "-c", actual_command_with_venv],
|
||||
env=os.environ.copy(), shell=False, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, stdin=subprocess.PIPE if stdin else None
|
||||
)
|
||||
stdout, stderr = p.communicate(input=stdin)
|
||||
LOG.info("Standard output [%s] and error output [%s] for command "
|
||||
"[%s]. ", stdout, stderr, actual_command_with_venv)
|
||||
if p.returncode != 0:
|
||||
raise RuntimeError('"{cmd}" returned {val}: {msg}'.format(
|
||||
cmd=' '.join(cmd), val=p.returncode, msg=stderr))
|
||||
|
||||
6
releasenotes/source/2023.1.rst
Normal file
6
releasenotes/source/2023.1.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
===========================
|
||||
2023.1 Series Release Notes
|
||||
===========================
|
||||
|
||||
.. release-notes::
|
||||
:branch: stable/2023.1
|
||||
@@ -8,6 +8,7 @@ Contents
|
||||
:maxdepth: 2
|
||||
|
||||
unreleased
|
||||
2023.1
|
||||
zed
|
||||
yoga
|
||||
xena
|
||||
|
||||
37
tox.ini
37
tox.ini
@@ -9,6 +9,7 @@ basepython = python3
|
||||
usedevelop = True
|
||||
install_command = pip install -U {opts} {packages}
|
||||
setenv =
|
||||
DEVSTACK_VENV={env:DEVSTACK_VENV}
|
||||
VIRTUAL_ENV={envdir}
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
@@ -29,12 +30,40 @@ commands =
|
||||
commands = oslo_debug_helper -t cloudkittyclient/tests {posargs}
|
||||
|
||||
[testenv:functional-v1]
|
||||
passenv = OS_CLOUD OS_PROJECT_DOMAIN_ID OS_USER_DOMAIN_ID OS_PROJECT_DOMAIN_NAME OS_USER_DOMAIN_NAME OS_PROJECT_NAME OS_IDENTITY_API_VERSION OS_PASSWORD OS_AUTH_TYPE OS_AUTH_URL OS_USERNAME OS_ENDPOINT
|
||||
passenv =
|
||||
OS_CLOUD
|
||||
OS_PROJECT_DOMAIN_ID
|
||||
OS_USER_DOMAIN_ID
|
||||
OS_PROJECT_DOMAIN_NAME
|
||||
OS_USER_DOMAIN_NAME
|
||||
OS_PROJECT_NAME
|
||||
OS_IDENTITY_API_VERSION
|
||||
OS_PASSWORD
|
||||
OS_AUTH_TYPE
|
||||
OS_AUTH_URL
|
||||
OS_USERNAME
|
||||
OS_ENDPOINT
|
||||
DEVSTACK_VENV
|
||||
VIRTUAL_ENV
|
||||
setenv = OS_RATING_API_VERSION=1
|
||||
commands = stestr run --concurrency=1 --test-path ./cloudkittyclient/tests/functional/v1
|
||||
|
||||
[testenv:functional-v2]
|
||||
passenv = OS_CLOUD OS_PROJECT_DOMAIN_ID OS_USER_DOMAIN_ID OS_PROJECT_DOMAIN_NAME OS_USER_DOMAIN_NAME OS_PROJECT_NAME OS_IDENTITY_API_VERSION OS_PASSWORD OS_AUTH_TYPE OS_AUTH_URL OS_USERNAME OS_ENDPOINT
|
||||
passenv =
|
||||
OS_CLOUD
|
||||
OS_PROJECT_DOMAIN_ID
|
||||
OS_USER_DOMAIN_ID
|
||||
OS_PROJECT_DOMAIN_NAME
|
||||
OS_USER_DOMAIN_NAME
|
||||
OS_PROJECT_NAME
|
||||
OS_IDENTITY_API_VERSION
|
||||
OS_PASSWORD
|
||||
OS_AUTH_TYPE
|
||||
OS_AUTH_URL
|
||||
OS_USERNAME
|
||||
OS_ENDPOINT
|
||||
DEVSTACK_VENV
|
||||
VIRTUAL_ENV
|
||||
setenv = OS_RATING_API_VERSION=2
|
||||
commands = stestr run --concurrency=1 --test-path ./cloudkittyclient/tests/functional/v2
|
||||
|
||||
@@ -46,7 +75,7 @@ commands = {posargs}
|
||||
|
||||
[testenv:docs]
|
||||
deps =
|
||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2023.1}
|
||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2023.2}
|
||||
-r{toxinidir}/doc/requirements.txt
|
||||
commands = sphinx-build --keep-going -b html doc/source doc/build/html
|
||||
|
||||
@@ -72,7 +101,7 @@ import_exceptions = cloudkittyclient.i18n
|
||||
|
||||
[testenv:releasenotes]
|
||||
deps =
|
||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2023.1}
|
||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2023.2}
|
||||
-r{toxinidir}/doc/requirements.txt
|
||||
commands =
|
||||
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
|
||||
|
||||
Reference in New Issue
Block a user