evaluation checks: move over

This commit is contained in:
Graham Christensen 2019-03-22 15:59:03 -04:00
parent d25f91b88e
commit ed0882a975
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 88 additions and 89 deletions

View file

@ -10,6 +10,7 @@ use ofborg::evalchecker::EvalChecker;
use ofborg::files::file_to_str;
use ofborg::message::buildjob::BuildJob;
use ofborg::message::evaluationjob::EvaluationJob;
use ofborg::nix;
use ofborg::nix::Nix;
use ofborg::outpathdiff::{OutPathDiff, OutPaths, PackageArch};
use ofborg::tagger::{MaintainerPRTagger, PathsTagger, RebuildTagger};
@ -364,7 +365,91 @@ impl<'a> EvaluationStrategy for NixpkgsStrategy<'a> {
}
fn evaluation_checks(&self) -> Vec<EvalChecker> {
vec![]
vec![
EvalChecker::new(
"package-list",
nix::Operation::QueryPackagesJSON,
vec![String::from("--file"), String::from(".")],
self.nix.clone(),
),
EvalChecker::new(
"package-list-no-aliases",
nix::Operation::QueryPackagesJSON,
vec![
String::from("--file"),
String::from("."),
String::from("--arg"),
String::from("config"),
String::from("{ allowAliases = false; }"),
],
self.nix.clone(),
),
EvalChecker::new(
"nixos-options",
nix::Operation::Instantiate,
vec![
String::from("--arg"),
String::from("nixpkgs"),
String::from("{ outPath=./.; revCount=999999; shortRev=\"ofborg\"; }"),
String::from("./nixos/release.nix"),
String::from("-A"),
String::from("options"),
],
self.nix.clone(),
),
EvalChecker::new(
"nixos-manual",
nix::Operation::Instantiate,
vec![
String::from("--arg"),
String::from("nixpkgs"),
String::from("{ outPath=./.; revCount=999999; shortRev=\"ofborg\"; }"),
String::from("./nixos/release.nix"),
String::from("-A"),
String::from("manual"),
],
self.nix.clone(),
),
EvalChecker::new(
"nixpkgs-manual",
nix::Operation::Instantiate,
vec![
String::from("--arg"),
String::from("nixpkgs"),
String::from("{ outPath=./.; revCount=999999; shortRev=\"ofborg\"; }"),
String::from("./pkgs/top-level/release.nix"),
String::from("-A"),
String::from("manual"),
],
self.nix.clone(),
),
EvalChecker::new(
"nixpkgs-tarball",
nix::Operation::Instantiate,
vec![
String::from("--arg"),
String::from("nixpkgs"),
String::from("{ outPath=./.; revCount=999999; shortRev=\"ofborg\"; }"),
String::from("./pkgs/top-level/release.nix"),
String::from("-A"),
String::from("tarball"),
],
self.nix.clone(),
),
EvalChecker::new(
"nixpkgs-unstable-jobset",
nix::Operation::Instantiate,
vec![
String::from("--arg"),
String::from("nixpkgs"),
String::from("{ outPath=./.; revCount=999999; shortRev=\"ofborg\"; }"),
String::from("./pkgs/top-level/release.nix"),
String::from("-A"),
String::from("unstable"),
],
self.nix.clone(),
),
]
}
fn all_evaluations_passed(

View file

@ -9,7 +9,6 @@ use hubcaps::issues::Issue;
use ofborg::acl::ACL;
use ofborg::checkout;
use ofborg::commitstatus::CommitStatus;
use ofborg::evalchecker::EvalChecker;
use ofborg::files::file_to_str;
use ofborg::message::{buildjob, evaluationjob};
use ofborg::nix;
@ -273,93 +272,8 @@ impl<E: stats::SysEvents + 'static> worker::SimpleWorker for EvaluationWorker<E>
overall_status
.set_with_description("Beginning Evaluations", hubcaps::statuses::State::Pending);
let eval_checks = vec![
EvalChecker::new(
"package-list",
nix::Operation::QueryPackagesJSON,
vec![String::from("--file"), String::from(".")],
self.nix.clone(),
),
EvalChecker::new(
"package-list-no-aliases",
nix::Operation::QueryPackagesJSON,
vec![
String::from("--file"),
String::from("."),
String::from("--arg"),
String::from("config"),
String::from("{ allowAliases = false; }"),
],
self.nix.clone(),
),
EvalChecker::new(
"nixos-options",
nix::Operation::Instantiate,
vec![
String::from("--arg"),
String::from("nixpkgs"),
String::from("{ outPath=./.; revCount=999999; shortRev=\"ofborg\"; }"),
String::from("./nixos/release.nix"),
String::from("-A"),
String::from("options"),
],
self.nix.clone(),
),
EvalChecker::new(
"nixos-manual",
nix::Operation::Instantiate,
vec![
String::from("--arg"),
String::from("nixpkgs"),
String::from("{ outPath=./.; revCount=999999; shortRev=\"ofborg\"; }"),
String::from("./nixos/release.nix"),
String::from("-A"),
String::from("manual"),
],
self.nix.clone(),
),
EvalChecker::new(
"nixpkgs-manual",
nix::Operation::Instantiate,
vec![
String::from("--arg"),
String::from("nixpkgs"),
String::from("{ outPath=./.; revCount=999999; shortRev=\"ofborg\"; }"),
String::from("./pkgs/top-level/release.nix"),
String::from("-A"),
String::from("manual"),
],
self.nix.clone(),
),
EvalChecker::new(
"nixpkgs-tarball",
nix::Operation::Instantiate,
vec![
String::from("--arg"),
String::from("nixpkgs"),
String::from("{ outPath=./.; revCount=999999; shortRev=\"ofborg\"; }"),
String::from("./pkgs/top-level/release.nix"),
String::from("-A"),
String::from("tarball"),
],
self.nix.clone(),
),
EvalChecker::new(
"nixpkgs-unstable-jobset",
nix::Operation::Instantiate,
vec![
String::from("--arg"),
String::from("nixpkgs"),
String::from("{ outPath=./.; revCount=999999; shortRev=\"ofborg\"; }"),
String::from("./pkgs/top-level/release.nix"),
String::from("-A"),
String::from("unstable"),
],
self.nix.clone(),
),
];
let eval_results: bool = eval_checks
let eval_results: bool = evaluation_strategy
.evaluation_checks()
.into_iter()
.map(|check| {
let mut status = CommitStatus::new(