aboutsummaryrefslogtreecommitdiff
path: root/tests/test_build.py
diff options
context:
space:
mode:
authorRadosław Piliszek <radoslaw.piliszek@gmail.com>2020-03-15 15:36:47 +0100
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2020-04-03 15:46:11 +0200
commitc089eab392de39ff01f9eba65ef4855a14e2076a (patch)
tree338456fb75ad115aee3ba3ade0206c816715fc8d /tests/test_build.py
parent3da0aaa845053aa667bf57c3b9fdfc4e363259da (diff)
downloadkolla-c089eab392de39ff01f9eba65ef4855a14e2076a.tar.gz
kolla-c089eab392de39ff01f9eba65ef4855a14e2076a.zip
CI: Avoid tox
We don't need tox nor tell our users to use it when doing kolla builds. Tox is going away from base infra images (it is already gone from aarch64 ones). Depends-on: https://review.opendev.org/713134 Co-authored-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> Change-Id: Ib1d97a783951ac42740ebf91bcc6ecaf2bf70853
Diffstat (limited to 'tests/test_build.py')
-rw-r--r--tests/test_build.py133
1 files changed, 0 insertions, 133 deletions
diff --git a/tests/test_build.py b/tests/test_build.py
deleted file mode 100644
index c4a4a6aed..000000000
--- a/tests/test_build.py
+++ /dev/null
@@ -1,133 +0,0 @@
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-import multiprocessing
-import os
-import sys
-from unittest.mock import patch
-
-from oslo_log import fixture as log_fixture
-from oslo_log import log as logging
-from oslotest import base
-import testtools
-
-
-sys.path.append(
- os.path.abspath(os.path.join(os.path.dirname(__file__), '../tools')))
-from kolla.image import build # noqa
-
-LOG = logging.getLogger(__name__)
-
-
-class BuildTest(object):
- excluded_images = []
-
- def setUp(self):
- super(BuildTest, self).setUp()
- self.useFixture(log_fixture.SetLogLevel([__name__],
- logging.logging.INFO))
-
- self.threads = multiprocessing.cpu_count()
- if self.threads < 4:
- self.threads = 4
-
- self.build_args = [__name__, '--threads', str(self.threads)]
-
- @testtools.skipUnless(os.environ.get('DOCKER_BUILD_TEST'),
- 'Skip the docker build test')
- def runTest(self):
- with patch.object(sys, 'argv', self.build_args):
- LOG.info("Running with args %s", self.build_args)
- (bad_results, good_results, unmatched_results,
- skipped_results, unbuildable_results) = build.run_build()
-
- failures = 0
- for image, result in bad_results.items():
- if result != 'error':
- continue
- failures = failures + 1
- LOG.critical(">>> Expected image '%s' to succeed!", image)
-
- for image in unmatched_results:
- LOG.warning(">>> Image '%s' was not matched", image)
-
- self.assertEqual(0, failures, "%d failure(s) occurred" % failures)
-
-
-class BuildTestCentosBinary(BuildTest, base.BaseTestCase):
-
- def setUp(self):
- super(BuildTestCentosBinary, self).setUp()
- self.build_args.extend(["--base", "centos",
- "--type", "binary"])
-
-
-class BuildTestCentosSource(BuildTest, base.BaseTestCase):
-
- def setUp(self):
- super(BuildTestCentosSource, self).setUp()
- self.build_args.extend(["--base", "centos",
- "--type", "source"])
-
-
-class BuildTestCentos8Binary(BuildTest, base.BaseTestCase):
-
- def setUp(self):
- super(BuildTestCentos8Binary, self).setUp()
- # TODO(mgoddard): Remove --base-tag argument when CentOS 8 is the
- # default.
- self.build_args.extend(["--base", "centos",
- "--base-tag", "8",
- "--type", "binary"])
-
-
-class BuildTestCentos8Source(BuildTest, base.BaseTestCase):
-
- def setUp(self):
- super(BuildTestCentos8Source, self).setUp()
- # TODO(mgoddard): Remove --base-tag argument when CentOS 8 is the
- # default.
- self.build_args.extend(["--base", "centos",
- "--base-tag", "8",
- "--type", "source"])
-
-
-class BuildTestUbuntuBinary(BuildTest, base.BaseTestCase):
-
- def setUp(self):
- super(BuildTestUbuntuBinary, self).setUp()
- self.build_args.extend(["--base", "ubuntu",
- "--type", "binary"])
-
-
-class BuildTestUbuntuSource(BuildTest, base.BaseTestCase):
-
- def setUp(self):
- super(BuildTestUbuntuSource, self).setUp()
- self.build_args.extend(["--base", "ubuntu",
- "--type", "source"])
-
-
-class BuildTestDebianBinary(BuildTest, base.BaseTestCase):
-
- def setUp(self):
- super(BuildTestDebianBinary, self).setUp()
- self.build_args.extend(["--base", "debian",
- "--type", "binary"])
-
-
-class BuildTestDebianSource(BuildTest, base.BaseTestCase):
-
- def setUp(self):
- super(BuildTestDebianSource, self).setUp()
- self.build_args.extend(["--base", "debian",
- "--type", "source"])