1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-30 05:39:12 +02:00

Add build-max option to set max build processes.

Currently this controls make processes via -j.
This commit is contained in:
David Steele 2019-04-23 20:52:03 -04:00
parent c11c936366
commit 1ae8a6a716
3 changed files with 16 additions and 6 deletions

View File

@ -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>

View File

@ -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" : '') .

View File

@ -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())