Skip to content
Snippets Groups Projects
Commit dcbfbcd2 authored by Michal Rostecki's avatar Michal Rostecki Committed by Sam Yaple
Browse files

Separate exclusion list for source and binary types

Separate list of excluded images for source and binary unit
tests.

Change-Id: I4b6032db25c898272491c44c7a06f7cddf7a2298
Closes-Bug: #1487252
parent c15df147
No related branches found
No related tags found
No related merge requests found
...@@ -10,24 +10,27 @@ ...@@ -10,24 +10,27 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import abc
import os import os
import sys
from mock import patch from mock import patch
from os import path
from oslo_log import fixture as log_fixture from oslo_log import fixture as log_fixture
from oslo_log import log as logging from oslo_log import log as logging
from oslotest import base from oslotest import base
import six import six
import testtools import testtools
import sys sys.path.append(
sys.path.append(path.abspath(path.join(path.dirname(__file__), '../tools'))) os.path.abspath(os.path.join(os.path.dirname(__file__), '../tools')))
from kolla.cmd import build from kolla.cmd import build
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class BuildTest(base.BaseTestCase): @six.add_metaclass(abc.ABCMeta)
class BuildTest(object):
excluded_images = abc.abstractproperty()
def setUp(self): def setUp(self):
super(BuildTest, self).setUp() super(BuildTest, self).setUp()
...@@ -42,16 +45,9 @@ class BuildTest(base.BaseTestCase): ...@@ -42,16 +45,9 @@ class BuildTest(base.BaseTestCase):
LOG.info("Running with args %s", self.build_args) LOG.info("Running with args %s", self.build_args)
bad_results, good_results, unmatched_results = build.main() bad_results, good_results, unmatched_results = build.main()
# these are images that are known to not build properly
excluded_images = ["gnocchi-base",
"murano-base",
"ironic-pxe",
"ironic-discoverd",
"mistral-base"]
failures = 0 failures = 0
for image, result in six.iteritems(bad_results): for image, result in six.iteritems(bad_results):
if image in excluded_images: if image in self.excluded_images:
if result is 'error': if result is 'error':
continue continue
failures = failures + 1 failures = failures + 1
...@@ -70,46 +66,55 @@ class BuildTest(base.BaseTestCase): ...@@ -70,46 +66,55 @@ class BuildTest(base.BaseTestCase):
self.assertEqual(failures, 0, "%d failure(s) occurred" % failures) self.assertEqual(failures, 0, "%d failure(s) occurred" % failures)
class BuildTestCentosBinary(BuildTest): class BuildTestCentosBinary(BuildTest, base.BaseTestCase):
excluded_images = ["gnocchi-base",
"murano-base",
"ironic-pxe",
"ironic-discoverd",
"mistral-base",
"murano-base"]
def setUp(self): def setUp(self):
super(BuildTestCentosBinary, self).setUp() super(BuildTestCentosBinary, self).setUp()
self.build_args.extend(["--base", "centos", self.build_args.extend(["--base", "centos",
"--type", "binary"]) "--type", "binary"])
class BuildTestCentosSource(BuildTest): class BuildTestCentosSource(BuildTest, base.BaseTestCase):
excluded_images = ["gnocchi-base",
"murano-base",
"ironic-pxe",
"ironic-discoverd",
"mistral-base"]
def setUp(self): def setUp(self):
super(BuildTestCentosSource, self).setUp() super(BuildTestCentosSource, self).setUp()
self.build_args.extend(["--base", "centos", self.build_args.extend(["--base", "centos",
"--type", "source"]) "--type", "source"])
class BuildTestUbuntuSource(BuildTest): class BuildTestUbuntuSource(BuildTest, base.BaseTestCase):
excluded_images = []
def setUp(self): def setUp(self):
super(BuildTestUbuntuSource, self).setUp() super(BuildTestUbuntuSource, self).setUp()
self.build_args.extend(["--base", "ubuntu", self.build_args.extend(["--base", "ubuntu",
"--type", "source"]) "--type", "source"])
class DeployTestCentosBinary(BuildTest): class DeployTestCentosBinary(BuildTestCentosBinary):
def setUp(self): def setUp(self):
super(DeployTestCentosBinary, self).setUp() super(DeployTestCentosBinary, self).setUp()
self.build_args.extend(["--base", "centos", self.build_args.extend(["--profile", "gate"])
"--type", "binary",
"--profile", "gate"])
class DeployTestCentosSource(BuildTest): class DeployTestCentosSource(BuildTestCentosSource):
def setUp(self): def setUp(self):
super(DeployTestCentosSource, self).setUp() super(DeployTestCentosSource, self).setUp()
self.build_args.extend(["--base", "centos", self.build_args.extend(["--profile", "gate"])
"--type", "source",
"--profile", "gate"])
class DeployTestUbuntuSource(BuildTest): class DeployTestUbuntuSource(BuildTestUbuntuSource):
def setUp(self): def setUp(self):
super(DeployTestUbuntuSource, self).setUp() super(DeployTestUbuntuSource, self).setUp()
self.build_args.extend(["--base", "ubuntu", self.build_args.extend(["--profile", "gate"])
"--type", "source",
"--profile", "gate"])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment