tempest plugin: save package in temporary dir

This allows tempest tests to run in parallel. The tempest concurrency by
default is set to 3 as the default number of replicas in a deployment to
avoid more than 'replica' number of tests running at the same time that
some of them may fail because of no available pods.

Change-Id: I6e2731ca36376d28573138d4d404c3918801142c
This commit is contained in:
Hunt Xu 2018-03-14 16:41:06 +08:00
parent 88cd7d0a74
commit 2ad25a3260
2 changed files with 6 additions and 2 deletions

View File

@ -52,7 +52,9 @@
TEMPEST_PLUGINS: '/opt/stack/qinling'
tox_envlist: all-plugin
tempest_test_regex: '^(qinling_tempest_plugin.)'
tempest_concurrency: 1
# Set tempest concurrency to qinling's default number of replicas in a
# deployment to avoid tests failing of no avaliable pod.
tempest_concurrency: 3
- project:
check:

View File

@ -102,7 +102,8 @@ class BaseQinlingTest(test.BaseTestCase):
)
base_name, extention = os.path.splitext(file_path)
module_name = os.path.basename(base_name)
zip_file = os.path.join(tempfile.gettempdir(), '%s.zip' % module_name)
temp_dir = tempfile.mkdtemp()
zip_file = os.path.join(temp_dir, '%s.zip' % module_name)
if not os.path.isfile(zip_file):
zf = zipfile.ZipFile(zip_file, mode='w')
@ -111,6 +112,7 @@ class BaseQinlingTest(test.BaseTestCase):
finally:
zf.close()
self.addCleanup(os.rmdir, temp_dir)
self.addCleanup(os.remove, zip_file)
return zip_file