Merge "Speed up builds by increasing threads for builds"
This commit is contained in:
commit
5ad95b335f
@ -11,6 +11,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -34,7 +35,12 @@ class BuildTest(object):
|
|||||||
super(BuildTest, self).setUp()
|
super(BuildTest, self).setUp()
|
||||||
self.useFixture(log_fixture.SetLogLevel([__name__],
|
self.useFixture(log_fixture.SetLogLevel([__name__],
|
||||||
logging.logging.INFO))
|
logging.logging.INFO))
|
||||||
self.build_args = [__name__, "--debug", '--threads', '4']
|
|
||||||
|
self.threads = multiprocessing.cpu_count()
|
||||||
|
if self.threads < 4:
|
||||||
|
self.threads = 4
|
||||||
|
|
||||||
|
self.build_args = [__name__, "--debug", '--threads', str(self.threads)]
|
||||||
|
|
||||||
@testtools.skipUnless(os.environ.get('DOCKER_BUILD_TEST'),
|
@testtools.skipUnless(os.environ.get('DOCKER_BUILD_TEST'),
|
||||||
'Skip the docker build test')
|
'Skip the docker build test')
|
||||||
|
Loading…
Reference in New Issue
Block a user