pgbackrest.git / summary / log / commit / refs
commit 1ae8a6a71665c12bec6e20741df29ba4792bf8f8
Author: David Steele <david@pgmasters.net>
Date: Wed Apr 24 00:52:03 2019 +0000
Add build-max option to set max build processes.
Currently this controls make processes via -j.
doc/xml/release.xml | 4 ++++
test/lib/pgBackRestTest/Common/JobTest.pm | 4 +++-
test/test.pl | 14 +++++++++-----
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/doc/xml/release.xml b/doc/xml/release.xml
index befaf9811..0adc332ad 100644
--- a/doc/xml/release.xml
+++ b/doc/xml/release.xml
@@ -89,6 +89,10 @@
<p>Add <code>harnessInfoChecksum/Z()</code> to ease creation of test info files.</p>
</release-item>
+ <release-item>
+ <p>Add <id>build-max</id> option to set max build processes.</p>
+ </release-item>
+
<release-item>
<p>Reduce <proper>ScalityS3</proper> processes since only two are needed.</p>
</release-item>
diff --git a/test/lib/pgBackRestTest/Common/JobTest.pm b/test/lib/pgBackRestTest/Common/JobTest.pm
index 0cdee97b9..ef3192cb8 100644
--- a/test/lib/pgBackRestTest/Common/JobTest.pm
+++ b/test/lib/pgBackRestTest/Common/JobTest.pm
@@ -75,6 +75,7 @@ sub new
$self->{bProfile},
$self->{bDebug},
$self->{bDebugTestTrace},
+ $self->{iBuildMax},
) =
logDebugParam
(
@@ -103,6 +104,7 @@ sub new
{name => 'bProfile'},
{name => 'bDebug'},
{name => 'bDebugTestTrace'},
+ {name => 'iBuildMax'},
);
# Set try to 0
@@ -246,7 +248,7 @@ sub run
$strCommand =
'docker exec -i -u ' . TEST_USER . " ${strImage} bash -l -c '" .
"cd $self->{strGCovPath} && " .
- "make -s 2>&1 &&" .
+ "make -j $self->{iBuildMax} -s 2>&1 &&" .
($self->{oTest}->{&TEST_VM} ne VM_CO6 && $self->{bValgrindUnit}?
" valgrind -q --gen-suppressions=all --suppressions=$self->{strGCovPath}/test/valgrind.suppress" .
" --leak-check=full --leak-resolution=high --error-exitcode=25" : '') .
diff --git a/test/test.pl b/test/test.pl
index 31c0de301..a6fdccee5 100755
--- a/test/test.pl
+++ b/test/test.pl
@@ -79,6 +79,7 @@ test.pl [options]
--log-force force overwrite of current test log files
--no-lint disable static source code analysis
--build-only compile the test library / packages and run tests only
+ --build-max max processes to use for builds (default 4)
--coverage-only only run coverage tests (as a subset of selected tests)
--c-only only run C tests
--gen-only only run auto-generation
@@ -143,6 +144,7 @@ my $bVmBuild = false;
my $bVmForce = false;
my $bNoLint = false;
my $bBuildOnly = false;
+my $iBuildMax = 4;
my $bCoverageOnly = false;
my $bNoCoverage = false;
my $bCOnly = false;
@@ -186,6 +188,7 @@ GetOptions ('q|quiet' => \$bQuiet,
'log-force' => \$bLogForce,
'no-lint' => \$bNoLint,
'build-only' => \$bBuildOnly,
+ 'build-max=s' => \$iBuildMax,
'no-package' => \$bNoPackage,
'no-ci-config' => \$bNoCiConfig,
'coverage-only' => \$bCoverageOnly,
@@ -821,8 +824,8 @@ eval
executeTest(
'docker exec -i test-build' .
(vmLintC($strVm) && !$bNoLint ? ' scan-build-6.0' : '') .
- " make --silent --directory ${strBuildPath} CEXTRA='${strCExtra}' LDEXTRA='${strLdExtra}'" .
- " CDEBUG='${strCDebug}'",
+ " make -j ${iBuildMax} --silent --directory ${strBuildPath} CEXTRA='${strCExtra}'" .
+ " LDEXTRA='${strLdExtra}' CDEBUG='${strCDebug}'",
{bShowOutputAsync => $bLogDetail});
executeTest("docker rm -f test-build");
@@ -924,7 +927,7 @@ eval
executeTest(
($bContainerExists ? 'docker exec -i test-build ' : '') .
- "make --silent --directory ${strBuildPath}",
+ "make -j ${iBuildMax} --silent --directory ${strBuildPath}",
{bShowOutputAsync => $bLogDetail});
if ($bContainerExists)
@@ -1230,8 +1233,9 @@ eval
{
my $oJob = new pgBackRestTest::Common::JobTest(
$oStorageTest, $strBackRestBase, $strTestPath, $strCoveragePath, $$oyTestRun[$iTestIdx], $bDryRun, $bVmOut,
- $iVmIdx, $iVmMax, $iTestIdx, $iTestMax, $strLogLevel, $strLogLevelTest, $bLogForce, $bShowOutputAsync, $bNoCleanup, $iRetry,
- !$bNoValgrind, !$bNoCoverage, !$bNoOptimize, $bBackTrace, $bProfile, !$bNoDebug, $bDebugTestTrace);
+ $iVmIdx, $iVmMax, $iTestIdx, $iTestMax, $strLogLevel, $strLogLevelTest, $bLogForce, $bShowOutputAsync,
+ $bNoCleanup, $iRetry, !$bNoValgrind, !$bNoCoverage, !$bNoOptimize, $bBackTrace, $bProfile, !$bNoDebug,
+ $bDebugTestTrace, $iBuildMax / $iVmMax < 1 ? 1 : int($iBuildMax / $iVmMax));
$iTestIdx++;
if ($oJob->run())
[parent: c11c936366fd]