Refstack-client should use stestr for tempest testing
Tempest has changed to use stestr instead of testr and testrepository starting from 18.0.0,and the testr.conf was removed: https://review.openstack.org/#/c/504345/ refstack-client will not able to run for tempest 18.0.0 as some commands need the testr.conf in the path: root@defcore:/home/defcore/refstack-client/refstack_client# /home/defcore/refstack-client/.tempest/tools/with_venv.sh testr list-tests No .testr.conf config file Tempest Commit SHA: 8316f962c52b01edc5be466b18e54904e2a1248a pointing to tempest 19.0.0 Install tempest from master Updated Guidelines to match 2018.02 Change-Id: Ic796cc7ad48037e64a4437d4834051c7fa7cbda1 Closes-Bug: #1765609
This commit is contained in:
parent
e1744ea1e4
commit
74b6ac1c3f
@ -36,7 +36,7 @@ We've created an "easy button" for Ubuntu, Centos, RHEL and openSUSE.
|
|||||||
For example: execute ``./setup_env -t tags/3`` to install Tempest tag-3.
|
For example: execute ``./setup_env -t tags/3`` to install Tempest tag-3.
|
||||||
|
|
||||||
c. By default, Tempest will be installed from commit
|
c. By default, Tempest will be installed from commit
|
||||||
cc255bbbf431e114a4fc0ef587cd3d72333f750a (October, 2017).
|
8316f962c52b01edc5be466b18e54904e2a1248a (Sept, 2018).
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
#####
|
#####
|
||||||
@ -88,9 +88,9 @@ Usage
|
|||||||
|
|
||||||
For example::
|
For example::
|
||||||
|
|
||||||
refstack-client test -c ~/tempest.conf -v --test-list "https://refstack.openstack.org/api/v1/guidelines/2017.09/tests?target=platform&type=required&alias=true&flag=false"
|
refstack-client test -c ~/tempest.conf -v --test-list "https://refstack.openstack.org/api/v1/guidelines/2018.02/tests?target=platform&type=required&alias=true&flag=false"
|
||||||
|
|
||||||
This will run only the test cases required by the 2017.09 guidelines
|
This will run only the test cases required by the 2018.02 guidelines
|
||||||
that have not been flagged.
|
that have not been flagged.
|
||||||
|
|
||||||
**Note:**
|
**Note:**
|
||||||
|
@ -41,12 +41,21 @@ class TestListParser(object):
|
|||||||
self.insecure = insecure
|
self.insecure = insecure
|
||||||
|
|
||||||
def _get_tempest_test_ids(self):
|
def _get_tempest_test_ids(self):
|
||||||
"""This does a 'testr list-tests' on the Tempest directory in order to
|
"""This does a 'testr list-tests' or 'stestr list' according to
|
||||||
get a list of full test IDs for the current Tempest environment. Test
|
Tempest version on the Tempest directory in order to get a list
|
||||||
ID mappings are then formed for these tests.
|
of full test IDs for the current Tempest environment. Test ID
|
||||||
|
mappings are then formed for these tests.
|
||||||
"""
|
"""
|
||||||
cmd = (os.path.join(self.tempest_dir, 'tools/with_venv.sh'),
|
if os.path.exists(os.path.join(self.tempest_dir, '.stestr.conf')):
|
||||||
'testr', 'list-tests')
|
init_cmd = (os.path.join(self.tempest_dir, 'tools/with_venv.sh'),
|
||||||
|
'stestr', 'init')
|
||||||
|
subprocess.Popen(init_cmd, stdout=subprocess.PIPE,
|
||||||
|
cwd=self.tempest_dir)
|
||||||
|
cmd = (os.path.join(self.tempest_dir, 'tools/with_venv.sh'),
|
||||||
|
'stestr', 'list')
|
||||||
|
else:
|
||||||
|
cmd = (os.path.join(self.tempest_dir, 'tools/with_venv.sh'),
|
||||||
|
'testr', 'list-tests')
|
||||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||||
cwd=self.tempest_dir)
|
cwd=self.tempest_dir)
|
||||||
(stdout, stderr) = process.communicate()
|
(stdout, stderr) = process.communicate()
|
||||||
|
@ -134,22 +134,26 @@ class RefstackClient:
|
|||||||
|
|
||||||
def _get_next_stream_subunit_output_file(self, tempest_dir):
|
def _get_next_stream_subunit_output_file(self, tempest_dir):
|
||||||
'''This method reads from the next-stream file in the .testrepository
|
'''This method reads from the next-stream file in the .testrepository
|
||||||
directory of the given Tempest path. The integer here is the name
|
or .stestr directory according to Tempest version of the given
|
||||||
of the file where subunit output will be saved to.'''
|
Tempest path. The integer here is the name of the file where subunit
|
||||||
|
output will be saved to.'''
|
||||||
|
if os.path.exists(os.path.join(self.tempest_dir, '.stestr.conf')):
|
||||||
|
sub_dir = '.stestr'
|
||||||
|
else:
|
||||||
|
sub_dir = '.testrepository'
|
||||||
try:
|
try:
|
||||||
subunit_file = open(os.path.join(
|
subunit_file = open(os.path.join(
|
||||||
tempest_dir, '.testrepository',
|
tempest_dir, sub_dir,
|
||||||
'next-stream'), 'r').read().rstrip()
|
'next-stream'), 'r').read().rstrip()
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
self.logger.debug('The .testrepository/next-stream file was not '
|
self.logger.debug('The ' + sub_dir + '/next-stream file was not '
|
||||||
'found. Assuming subunit results will be stored '
|
'found. Assuming subunit results will be stored '
|
||||||
'in file 0.')
|
'in file 0.')
|
||||||
|
|
||||||
# Testr saves the first test stream to .testrepository/0 when
|
# First test stream is saved into $sub_dir/0
|
||||||
# there is a newly generated .testrepository directory.
|
|
||||||
subunit_file = "0"
|
subunit_file = "0"
|
||||||
|
|
||||||
return os.path.join(tempest_dir, '.testrepository', subunit_file)
|
return os.path.join(tempest_dir, sub_dir, subunit_file)
|
||||||
|
|
||||||
def _get_keystone_config(self, conf_file):
|
def _get_keystone_config(self, conf_file):
|
||||||
'''This will get and return the keystone configs from config file.'''
|
'''This will get and return the keystone configs from config file.'''
|
||||||
@ -575,7 +579,7 @@ class RefstackClient:
|
|||||||
sign_with=self.args.priv_key)
|
sign_with=self.args.priv_key)
|
||||||
else:
|
else:
|
||||||
msg1 = ("tempest run command did not generate a results file "
|
msg1 = ("tempest run command did not generate a results file "
|
||||||
"under the Refstack .tempest/.testrepository "
|
"under the Refstack os.path.dirname(results_file) "
|
||||||
"directory. Review command and try again.")
|
"directory. Review command and try again.")
|
||||||
msg2 = ("Problem executing tempest run command. Results file "
|
msg2 = ("Problem executing tempest run command. Results file "
|
||||||
"not generated hence no file to upload. Review "
|
"not generated hence no file to upload. Review "
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
shell: |
|
shell: |
|
||||||
set -ex
|
set -ex
|
||||||
export PATH=$PATH:/usr/local/sbin:/usr/sbin
|
export PATH=$PATH:/usr/local/sbin:/usr/sbin
|
||||||
./setup_env
|
./setup_env -c master
|
||||||
args:
|
args:
|
||||||
chdir: "{{ refstack_client_src_relative_path }}"
|
chdir: "{{ refstack_client_src_relative_path }}"
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
@ -39,7 +39,7 @@
|
|||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
printenv
|
printenv
|
||||||
refstack-client test -c /tmp/tempest.conf \
|
refstack-client test -c /tmp/tempest.conf \
|
||||||
-v --test-list "https://refstack.openstack.org/api/v1/guidelines/2017.09/tests?target=platform&type=required&alias=true&flag=false"
|
-v --test-list "https://refstack.openstack.org/api/v1/guidelines/2018.02/tests?target=platform&type=required&alias=true&flag=false"
|
||||||
args:
|
args:
|
||||||
chdir: "{{ refstack_client_src_relative_path }}"
|
chdir: "{{ refstack_client_src_relative_path }}"
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash -x
|
#!/bin/bash -x
|
||||||
|
|
||||||
#Default Tempest commit: SHA cc255bbbf431e114a4fc0ef587cd3d72333f750a (October 2017)
|
#Default Tempest commit: SHA 8316f962c52b01edc5be466b18e54904e2a1248a (Sept 2018)
|
||||||
CHECKOUT_POINT=cc255bbbf431e114a4fc0ef587cd3d72333f750a
|
CHECKOUT_POINT=8316f962c52b01edc5be466b18e54904e2a1248a
|
||||||
PY_VERSION="2.7.8"
|
PY_VERSION="2.7.8"
|
||||||
|
|
||||||
# Prints help
|
# Prints help
|
||||||
|
Loading…
x
Reference in New Issue
Block a user