[CI] Speed up Tempest jobs
Manila CI jobs fail very often exceeding timeout. So, do several changes to speed up Tempest jobs: 1) Separate NFS and CIFS tests between jobs. Run NFS jobs on MySQL ones and CIFS on PostgreSQL. 2) Refactor couple of tests removing creation of redundant shares testing the same things. 3) Increase amount of threads, to minimize probability of running heavy test suites in one thread. Change-Id: I6b60db039a96b47386f8ff538d1cb74559691ccc
This commit is contained in:
parent
30eaf80506
commit
fde99c896f
@ -95,12 +95,18 @@ fi
|
||||
set +o errexit
|
||||
cd $BASE/new/tempest
|
||||
|
||||
export MANILA_TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-12}
|
||||
export MANILA_TEMPEST_CONCURRENCY=${MANILA_TEMPEST_CONCURRENCY:-20}
|
||||
export MANILA_TESTS=${MANILA_TESTS:-'manila_tempest_tests.tests.api'}
|
||||
|
||||
# Run only NFS tests on MySQL backend to reduce amount of tests per job
|
||||
iniset $BASE/new/tempest/etc/tempest.conf share enable_protocols nfs
|
||||
if [[ "$JOB_NAME" =~ "scenario" ]]; then
|
||||
echo "Set test set to scenario only"
|
||||
MANILA_TESTS='manila_tempest_tests.tests.scenario'
|
||||
iniset $BASE/new/tempest/etc/tempest.conf share enable_protocols nfs,cifs
|
||||
elif [[ "$JOB_NAME" =~ "postgres" ]]; then
|
||||
# Run only CIFS tests on PostgreSQL backend to reduce amount of tests per job
|
||||
iniset $BASE/new/tempest/etc/tempest.conf share enable_protocols cifs
|
||||
elif [[ "$JOB_NAME" =~ "no-share-servers" ]]; then
|
||||
# Using approach without handling of share servers we have bigger load for
|
||||
# volume creation in Cinder using Generic driver. So, reduce amount of
|
||||
|
@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import six
|
||||
from tempest import config # noqa
|
||||
from tempest import test # noqa
|
||||
from tempest_lib import exceptions as lib_exc # noqa
|
||||
@ -36,41 +35,42 @@ class SharesNFSTest(base.BaseSharesTest):
|
||||
raise cls.skipException(message)
|
||||
cls.share = cls.create_share(cls.protocol)
|
||||
|
||||
def _create_delete_share(self, version):
|
||||
@test.attr(type=["gate", ])
|
||||
def test_create_get_delete_share(self):
|
||||
|
||||
# create share
|
||||
share = self.create_share(
|
||||
self.protocol, version=six.text_type(version))
|
||||
share = self.create_share(self.protocol)
|
||||
detailed_elements = {'name', 'id', 'availability_zone',
|
||||
'description', 'export_location', 'project_id',
|
||||
'host', 'created_at', 'share_proto', 'metadata',
|
||||
'size', 'snapshot_id', 'share_network_id',
|
||||
'status', 'share_type', 'volume_type', 'links',
|
||||
'is_public'}
|
||||
if version > 2.2:
|
||||
detailed_elements.add('snapshot_support')
|
||||
self.assertTrue(detailed_elements.issubset(share.keys()),
|
||||
'At least one expected element missing from share '
|
||||
'response. Expected %(expected)s, got %(actual)s.' % {
|
||||
"expected": detailed_elements,
|
||||
"actual": share.keys()})
|
||||
msg = (
|
||||
"At least one expected element missing from share "
|
||||
"response. Expected %(expected)s, got %(actual)s." % {
|
||||
"expected": detailed_elements,
|
||||
"actual": share.keys(),
|
||||
}
|
||||
)
|
||||
self.assertTrue(detailed_elements.issubset(share.keys()), msg)
|
||||
self.assertFalse(share['is_public'])
|
||||
|
||||
# delete share
|
||||
self.shares_client.delete_share(share['id'])
|
||||
self.shares_client.wait_for_resource_deletion(share_id=share['id'])
|
||||
# Get share using v 2.1 - we expect key 'snapshot_support' to be absent
|
||||
share_get = self.shares_v2_client.get_share(share['id'], version='2.1')
|
||||
self.assertTrue(detailed_elements.issubset(share_get.keys()), msg)
|
||||
|
||||
# Get share using v 2.2 - we expect key 'snapshot_support' to exist
|
||||
share_get = self.shares_v2_client.get_share(share['id'], version='2.2')
|
||||
detailed_elements.add('snapshot_support')
|
||||
self.assertTrue(detailed_elements.issubset(share_get.keys()), msg)
|
||||
|
||||
# Delete share
|
||||
self.shares_v2_client.delete_share(share['id'])
|
||||
self.shares_v2_client.wait_for_resource_deletion(share_id=share['id'])
|
||||
self.assertRaises(lib_exc.NotFound,
|
||||
self.shares_client.get_share,
|
||||
self.shares_v2_client.get_share,
|
||||
share['id'])
|
||||
|
||||
@test.attr(type=["gate", ])
|
||||
def test_create_delete_share_without_snapshot_support_feature(self):
|
||||
self._create_delete_share(2.1)
|
||||
|
||||
@test.attr(type=["gate", ])
|
||||
def test_create_delete_share_with_snapshot_support_feature(self):
|
||||
self._create_delete_share(2.2)
|
||||
|
||||
@test.attr(type=["gate", ])
|
||||
@testtools.skipUnless(CONF.share.run_snapshot_tests,
|
||||
"Snapshot tests are disabled.")
|
||||
|
Loading…
Reference in New Issue
Block a user