Skip to content

Commit

Permalink
Apply PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
blyxyas committed Sep 22, 2023
1 parent 4f8b7ae commit 9f76490
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions collector/src/bin/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ fn main_result() -> anyhow::Result<i32> {

let compile_config = CompileBenchmarkConfig {
benchmarks,
profiles: Profile::all(),
profiles: Profile::all_non_clippy(),
scenarios: Scenario::all(),
iterations: runs.map(|v| v as usize),
is_self_profile: self_profile.self_profile,
Expand Down Expand Up @@ -1199,7 +1199,7 @@ fn bench_published_artifact(
let artifact_id = ArtifactId::Tag(toolchain.id.clone());

let profiles = if collector::version_supports_doc(&toolchain.id) {
Profile::all()
Profile::all_non_clippy()
} else {
Profile::all_non_doc()
};
Expand Down
4 changes: 4 additions & 0 deletions collector/src/compile/benchmark/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ impl Profile {
pub fn all() -> Vec<Self> {
vec![Profile::Check, Profile::Debug, Profile::Doc, Profile::Opt, Profile::Clippy]
}

pub fn all_non_clippy() -> Vec<Self> {
vec![Profile::Check, Profile::Debug, Profile::Doc, Profile::Opt]
}

// This also leaves Clippy out
pub fn all_non_doc() -> Vec<Self> {
Expand Down
6 changes: 3 additions & 3 deletions collector/src/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,16 +444,16 @@ pub fn get_local_toolchain(
let clippy =
if let Some(clippy) = &toolchain_config.clippy {
Some(clippy.canonicalize().with_context(|| {
format!("failed to canonicalize rustdoc executable {:?}", clippy)
format!("failed to canonicalize clippy executable {:?}", clippy)
})?)
} else if profiles.contains(&Profile::Clippy) {
// We need a `clippy`. Look for one next to `rustc`.
if let Ok(clippy) = rustc.with_file_name("clippy").canonicalize() {
if let Ok(clippy) = rustc.with_file_name("cargo-clippy").canonicalize() {
debug!("found clippy: {:?}", &clippy);
Some(clippy)
} else {
anyhow::bail!(
"'Clippy' build specified but '--clippy' not specified and no 'clippy' found \
"'Clippy' build specified but '--clippy' not specified and no 'cargo-clippy' found \
next to 'rustc'"
);
}
Expand Down
4 changes: 2 additions & 2 deletions database/src/pool/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -961,10 +961,10 @@ impl Connection for SqliteConnection {
) {
self.raw_ref()
.prepare_cached(
"insert into pull_request_build (pr, complete, requested, include, exclude, runs, profile) VALUES (?, 0, strftime('%s','now'), ?, ?, ?, ?)",
"insert into pull_request_build (pr, complete, requested, include, exclude, runs) VALUES (?, 0, strftime('%s','now'), ?, ?, ?)",
)
.unwrap()
.execute(params![pr, include, exclude, &runs, profile])
.execute(params![pr, include, exclude, &runs])
.unwrap();
}
async fn pr_attach_commit(
Expand Down

0 comments on commit 9f76490

Please sign in to comment.