build with no out link for better GC

This commit is contained in:
Graham Christensen 2017-11-04 11:56:57 -04:00
parent d6e70b7760
commit 8e4bc24a04
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
4 changed files with 23 additions and 5 deletions

View file

@ -44,7 +44,7 @@ function runner($msg) {
$fillers = implode(" ", array_fill(0, count($attrs), '%s')); $fillers = implode(" ", array_fill(0, count($attrs), '%s'));
$cmd = 'NIX_PATH=nixpkgs=%s nix-build --argstr system %s --option restrict-eval true --keep-going . ' . $fillers; $cmd = 'NIX_PATH=nixpkgs=%s nix-build --no-out-link --argstr system %s --option restrict-eval true --keep-going . ' . $fillers;
$args = $attrs; $args = $attrs;
array_unshift($args, NIX_SYSTEM); array_unshift($args, NIX_SYSTEM);
array_unshift($args, $pname); array_unshift($args, $pname);

View file

@ -195,7 +195,7 @@ function try_eval($ghclient, $owner, $name, $sha, $eval_name, $cmd, $args) {
$ghclient->api('repository')->statuses()->create( $ghclient->api('repository')->statuses()->create(
$owner, $owner,
$name, $name,
$head_sha, $sha,
[ [
'state' => 'failure', 'state' => 'failure',
'description' => 'Failed to evaluate ' . $eval_name, 'description' => 'Failed to evaluate ' . $eval_name,
@ -209,10 +209,10 @@ function try_eval($ghclient, $owner, $name, $sha, $eval_name, $cmd, $args) {
$ghclient->api('repository')->statuses()->create( $ghclient->api('repository')->statuses()->create(
$owner, $owner,
$name, $name,
$head_sha, $sha,
[ [
'state' => 'success', 'state' => 'success',
'description' => 'Evaluation of $eval_name is OK', 'description' => 'Evaluation of ' . $eval_name . ' is OK',
'context' => 'grahamcofborg-eval-' . $eval_name, 'context' => 'grahamcofborg-eval-' . $eval_name,
] ]
); );

View file

@ -49,7 +49,7 @@ class RebuildTagClassifier {
$suffix = "101-500"; $suffix = "101-500";
} else if ($count > 10) { } else if ($count > 10) {
$suffix = "11-100"; $suffix = "11-100";
} else if ($count > 1) { } else if ($count > 0) {
$suffix = "1-10"; $suffix = "1-10";
} else { } else {
$suffix = "0"; $suffix = "0";

View file

@ -5,6 +5,15 @@ namespace GHE;
class TestRebuildTagClassifier extends \PHPUnit\Framework\TestCase class TestRebuildTagClassifier extends \PHPUnit\Framework\TestCase
{ {
function testParseLabelJustOne() {
$this->assertEquals(
["10.rebuild-linux: 1-10", "10.rebuild-darwin: 0"],
RebuildTagClassifier::parseAndLabel([
"Estimating rebuild amount by counting changed Hydra jobs.",
" 1 x86_64-linux",
]));
}
function testExecParseAndLabelGarbage() { function testExecParseAndLabelGarbage() {
$this->assertEquals( $this->assertEquals(
["10.rebuild-darwin: 0", "10.rebuild-linux: 0", ], ["10.rebuild-darwin: 0", "10.rebuild-linux: 0", ],
@ -56,6 +65,15 @@ class TestRebuildTagClassifier extends \PHPUnit\Framework\TestCase
); );
} }
function testParseJustOne() {
$this->assertEquals(
["x86_64-linux" => 1],
RebuildTagClassifier::parse([
"Estimating rebuild amount by counting changed Hydra jobs.",
" 1 x86_64-linux",
]));
}
function testExecParseDarwinOnly() { function testExecParseDarwinOnly() {
$this->assertEquals( $this->assertEquals(
["x86_64-darwin" => 5], ["x86_64-darwin" => 5],