build with no out link for better GC
This commit is contained in:
parent
d6e70b7760
commit
8e4bc24a04
|
@ -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);
|
||||||
|
|
|
@ -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,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -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],
|
||||||
|
|
Loading…
Reference in a new issue