Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more exceptions to the list #671

Merged
merged 5 commits into from
Oct 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix clippy
est31 committed Oct 28, 2022
commit efbb48747773987f5bf0f1d0e284eb34d0da6b49
2 changes: 1 addition & 1 deletion src/actions/experiments/create.rs
Original file line number Diff line number Diff line change
@@ -185,7 +185,7 @@ mod tests {
let crates: Vec<Crate> = db
.query(
"SELECT crate FROM experiment_crates WHERE experiment = ?1 AND skipped = 0",
&[&ex],
[&ex],
|row| {
let krate: String = row.get("crate")?;
Ok(krate.parse().unwrap())
2 changes: 1 addition & 1 deletion src/actions/experiments/edit.rs
Original file line number Diff line number Diff line change
@@ -251,7 +251,7 @@ mod tests {
let crates: Vec<Crate> = db
.query(
"SELECT crate FROM experiment_crates WHERE experiment = ?1 AND skipped = 0",
&[&ex],
[&ex],
|row| {
let krate: String = row.get("crate")?;
Ok(krate.parse().unwrap())
2 changes: 1 addition & 1 deletion src/report/archives.rs
Original file line number Diff line number Diff line change
@@ -163,7 +163,7 @@ pub fn write_logs_archives<DB: ReadResults, W: ReportWriter>(
for (comparison, archive) in by_comparison.drain(..) {
let data = archive.into_inner()?.finish()?;
dest.write_bytes(
&format!("logs-archives/{}.tar.gz", comparison),
format!("logs-archives/{}.tar.gz", comparison),
data,
&"application/gzip".parse().unwrap(),
EncodingType::Plain,
2 changes: 1 addition & 1 deletion src/report/html.rs
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ fn write_report<W: ReportWriter>(
result_names.len() - 1
});
runs[pos] = Some(BuildTestResultHTML {
res: *idx as usize,
res: *idx,
log: run.log.clone(),
});
}
20 changes: 10 additions & 10 deletions src/report/mod.rs
Original file line number Diff line number Diff line change
@@ -542,13 +542,13 @@ impl ReportWriter for FileWriter {
_: EncodingType,
) -> Fallible<()> {
self.create_prefix(path.as_ref())?;
fs::write(&self.0.join(path.as_ref()), &b)?;
fs::write(self.0.join(path.as_ref()), b)?;
Ok(())
}

fn write_string<P: AsRef<Path>>(&self, path: P, s: Cow<str>, _: &Mime) -> Fallible<()> {
self.create_prefix(path.as_ref())?;
fs::write(&self.0.join(path.as_ref()), s.as_ref().as_bytes())?;
fs::write(self.0.join(path.as_ref()), s.as_ref().as_bytes())?;
Ok(())
}
}
@@ -973,19 +973,19 @@ mod tests {
);
assert_eq!(gh_result.res, Comparison::Regressed);
assert_eq!(
(&gh_result.runs[0]).as_ref().unwrap().res,
gh_result.runs[0].as_ref().unwrap().res,
TestResult::TestPass
);
assert_eq!(
(&gh_result.runs[1]).as_ref().unwrap().res,
gh_result.runs[1].as_ref().unwrap().res,
TestResult::BuildFail(FailureReason::Unknown)
);
assert_eq!(
Path::new((&gh_result.runs[0]).as_ref().unwrap().log.as_str()),
Path::new(gh_result.runs[0].as_ref().unwrap().log.as_str()),
Path::new("stable/gh/brson.hello-rs")
);
assert_eq!(
Path::new((&gh_result.runs[1]).as_ref().unwrap().log.as_str()),
Path::new(gh_result.runs[1].as_ref().unwrap().log.as_str()),
Path::new("beta/gh/brson.hello-rs")
);

@@ -996,19 +996,19 @@ mod tests {
);
assert_eq!(reg_result.res, Comparison::Regressed);
assert_eq!(
(&reg_result.runs[0]).as_ref().unwrap().res,
reg_result.runs[0].as_ref().unwrap().res,
TestResult::TestPass
);
assert_eq!(
(&reg_result.runs[1]).as_ref().unwrap().res,
reg_result.runs[1].as_ref().unwrap().res,
TestResult::BuildFail(FailureReason::Unknown)
);
assert_eq!(
Path::new((&reg_result.runs[0]).as_ref().unwrap().log.as_str()),
Path::new(reg_result.runs[0].as_ref().unwrap().log.as_str()),
Path::new("stable/reg/syn-1.0.0")
);
assert_eq!(
Path::new((&reg_result.runs[1]).as_ref().unwrap().log.as_str()),
Path::new(reg_result.runs[1].as_ref().unwrap().log.as_str()),
Path::new("beta/reg/syn-1.0.0")
);

2 changes: 1 addition & 1 deletion src/runner/test.rs
Original file line number Diff line number Diff line change
@@ -386,7 +386,7 @@ pub(super) fn test_rustdoc<DB: WriteResults>(

// Make sure to remove the built documentation
// There is no point in storing it after the build is done
remove_dir_all(&build_env.host_target_dir().join("doc"))?;
remove_dir_all(build_env.host_target_dir().join("doc"))?;

res
};
2 changes: 1 addition & 1 deletion src/server/agents.rs
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ impl Agents {
#[cfg(test)]
fn get(&self, name: &str) -> Fallible<Option<Agent>> {
self.db
.get_row("SELECT * FROM agents WHERE name = ?1;", &[&name], |row| {
.get_row("SELECT * FROM agents WHERE name = ?1;", [&name], |row| {
Ok(Agent {
name: row.get("name")?,
last_heartbeat: row.get("last_heartbeat")?,
10 changes: 5 additions & 5 deletions tests/check_config/mod.rs
Original file line number Diff line number Diff line change
@@ -6,15 +6,15 @@ use std::process::Command;
#[test]
fn test_good_config() {
Command::crater()
.args(&["check-config", "tests/check_config/good.toml"])
.args(["check-config", "tests/check_config/good.toml"])
.assert()
.success();
}

#[test]
fn test_bad_config_duplicate_crate() {
Command::crater()
.args(&[
.args([
"check-config",
"tests/check_config/bad-duplicate-crate.toml",
])
@@ -27,7 +27,7 @@ fn test_bad_config_duplicate_crate() {
#[test]
fn test_bad_config_duplicate_repo() {
Command::crater()
.args(&["check-config", "tests/check_config/bad-duplicate-repo.toml"])
.args(["check-config", "tests/check_config/bad-duplicate-repo.toml"])
.assert()
.failure()
.code(1)
@@ -39,7 +39,7 @@ fn test_bad_config_duplicate_repo() {
#[test]
fn test_bad_config_missing_crate() {
Command::crater()
.args(&["check-config", "tests/check_config/bad-missing-crate.toml"])
.args(["check-config", "tests/check_config/bad-missing-crate.toml"])
.assert()
.failure()
.code(1)
@@ -49,7 +49,7 @@ fn test_bad_config_missing_crate() {
#[test]
fn test_bad_config_missing_repo() {
Command::crater()
.args(&["check-config", "tests/check_config/bad-missing-repo.toml"])
.args(["check-config", "tests/check_config/bad-missing-repo.toml"])
.assert()
.failure()
.code(1)
8 changes: 4 additions & 4 deletions tests/minicrater/driver.rs
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ impl MinicraterRun {

// Create local list in the temp work dir
Command::crater()
.args(&["create-lists", "local"])
.args(["create-lists", "local"])
.env("CRATER_CONFIG", &config_file)
.minicrater_exec();

@@ -172,7 +172,7 @@ impl MinicraterRun {

// Execute the experiment
Command::crater()
.args(&[
.args([
"run-graph",
&ex_arg,
"--threads",
@@ -189,7 +189,7 @@ impl MinicraterRun {
let mut failed = false;

Command::crater()
.args(&["gen-report", &ex_arg])
.args(["gen-report", &ex_arg])
.env("CRATER_CONFIG", &config_file)
.arg(report_dir.path())
.arg("--output-templates")
@@ -201,7 +201,7 @@ impl MinicraterRun {

// Delete the experiment
Command::crater()
.args(&["delete-ex", &ex_arg])
.args(["delete-ex", &ex_arg])
.env("CRATER_CONFIG", &config_file)
.minicrater_exec();