1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-15 01:04:37 +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> <p>Add <code>harnessInfoChecksum/Z()</code> to ease creation of test info files.</p>
</release-item> </release-item>
<release-item>
<p>Add <id>build-max</id> option to set max build processes.</p>
</release-item>
<release-item> <release-item>
<p>Reduce <proper>ScalityS3</proper> processes since only two are needed.</p> <p>Reduce <proper>ScalityS3</proper> processes since only two are needed.</p>
</release-item> </release-item>

View File

@ -75,6 +75,7 @@ sub new
$self->{bProfile}, $self->{bProfile},
$self->{bDebug}, $self->{bDebug},
$self->{bDebugTestTrace}, $self->{bDebugTestTrace},
$self->{iBuildMax},
) = ) =
logDebugParam logDebugParam
( (
@ -103,6 +104,7 @@ sub new
{name => 'bProfile'}, {name => 'bProfile'},
{name => 'bDebug'}, {name => 'bDebug'},
{name => 'bDebugTestTrace'}, {name => 'bDebugTestTrace'},
{name => 'iBuildMax'},
); );
# Set try to 0 # Set try to 0
@ -246,7 +248,7 @@ sub run
$strCommand = $strCommand =
'docker exec -i -u ' . TEST_USER . " ${strImage} bash -l -c '" . 'docker exec -i -u ' . TEST_USER . " ${strImage} bash -l -c '" .
"cd $self->{strGCovPath} && " . "cd $self->{strGCovPath} && " .
"make -s 2>&1 &&" . "make -j $self->{iBuildMax} -s 2>&1 &&" .
($self->{oTest}->{&TEST_VM} ne VM_CO6 && $self->{bValgrindUnit}? ($self->{oTest}->{&TEST_VM} ne VM_CO6 && $self->{bValgrindUnit}?
" valgrind -q --gen-suppressions=all --suppressions=$self->{strGCovPath}/test/valgrind.suppress" . " valgrind -q --gen-suppressions=all --suppressions=$self->{strGCovPath}/test/valgrind.suppress" .
" --leak-check=full --leak-resolution=high --error-exitcode=25" : '') . " --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 --log-force force overwrite of current test log files
--no-lint disable static source code analysis --no-lint disable static source code analysis
--build-only compile the test library / packages and run tests only --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) --coverage-only only run coverage tests (as a subset of selected tests)
--c-only only run C tests --c-only only run C tests
--gen-only only run auto-generation --gen-only only run auto-generation
@ -143,6 +144,7 @@ my $bVmBuild = false;
my $bVmForce = false; my $bVmForce = false;
my $bNoLint = false; my $bNoLint = false;
my $bBuildOnly = false; my $bBuildOnly = false;
my $iBuildMax = 4;
my $bCoverageOnly = false; my $bCoverageOnly = false;
my $bNoCoverage = false; my $bNoCoverage = false;
my $bCOnly = false; my $bCOnly = false;
@ -186,6 +188,7 @@ GetOptions ('q|quiet' => \$bQuiet,
'log-force' => \$bLogForce, 'log-force' => \$bLogForce,
'no-lint' => \$bNoLint, 'no-lint' => \$bNoLint,
'build-only' => \$bBuildOnly, 'build-only' => \$bBuildOnly,
'build-max=s' => \$iBuildMax,
'no-package' => \$bNoPackage, 'no-package' => \$bNoPackage,
'no-ci-config' => \$bNoCiConfig, 'no-ci-config' => \$bNoCiConfig,
'coverage-only' => \$bCoverageOnly, 'coverage-only' => \$bCoverageOnly,
@ -821,8 +824,8 @@ eval
executeTest( executeTest(
'docker exec -i test-build' . 'docker exec -i test-build' .
(vmLintC($strVm) && !$bNoLint ? ' scan-build-6.0' : '') . (vmLintC($strVm) && !$bNoLint ? ' scan-build-6.0' : '') .
" make --silent --directory ${strBuildPath} CEXTRA='${strCExtra}' LDEXTRA='${strLdExtra}'" . " make -j ${iBuildMax} --silent --directory ${strBuildPath} CEXTRA='${strCExtra}'" .
" CDEBUG='${strCDebug}'", " LDEXTRA='${strLdExtra}' CDEBUG='${strCDebug}'",
{bShowOutputAsync => $bLogDetail}); {bShowOutputAsync => $bLogDetail});
executeTest("docker rm -f test-build"); executeTest("docker rm -f test-build");
@ -924,7 +927,7 @@ eval
executeTest( executeTest(
($bContainerExists ? 'docker exec -i test-build ' : '') . ($bContainerExists ? 'docker exec -i test-build ' : '') .
"make --silent --directory ${strBuildPath}", "make -j ${iBuildMax} --silent --directory ${strBuildPath}",
{bShowOutputAsync => $bLogDetail}); {bShowOutputAsync => $bLogDetail});
if ($bContainerExists) if ($bContainerExists)
@ -1230,8 +1233,9 @@ eval
{ {
my $oJob = new pgBackRestTest::Common::JobTest( my $oJob = new pgBackRestTest::Common::JobTest(
$oStorageTest, $strBackRestBase, $strTestPath, $strCoveragePath, $$oyTestRun[$iTestIdx], $bDryRun, $bVmOut, $oStorageTest, $strBackRestBase, $strTestPath, $strCoveragePath, $$oyTestRun[$iTestIdx], $bDryRun, $bVmOut,
$iVmIdx, $iVmMax, $iTestIdx, $iTestMax, $strLogLevel, $strLogLevelTest, $bLogForce, $bShowOutputAsync, $bNoCleanup, $iRetry, $iVmIdx, $iVmMax, $iTestIdx, $iTestMax, $strLogLevel, $strLogLevelTest, $bLogForce, $bShowOutputAsync,
!$bNoValgrind, !$bNoCoverage, !$bNoOptimize, $bBackTrace, $bProfile, !$bNoDebug, $bDebugTestTrace); $bNoCleanup, $iRetry, !$bNoValgrind, !$bNoCoverage, !$bNoOptimize, $bBackTrace, $bProfile, !$bNoDebug,
$bDebugTestTrace, $iBuildMax / $iVmMax < 1 ? 1 : int($iBuildMax / $iVmMax));
$iTestIdx++; $iTestIdx++;
if ($oJob->run()) if ($oJob->run())