Skip to content

List new errors on comparison page #1128

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

Merged
merged 1 commit into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions site/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ pub mod comparison {
pub b: ArtifactDescription,
pub comparisons: Vec<Comparison>,

pub new_errors: Vec<(String, String)>,

/// The names for the next artifact after `b`, if any.
pub next: Option<String>,

Expand Down
34 changes: 33 additions & 1 deletion site/src/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! comparison endpoints

use crate::api;
use crate::db::{ArtifactId, Benchmark, Profile, Scenario};
use crate::db::{ArtifactId, Benchmark, Lookup, Profile, Scenario};
use crate::github;
use crate::load::SiteCtxt;
use crate::selector::{self, Tag};
Expand Down Expand Up @@ -132,11 +132,14 @@ pub async fn handle_compare(
})
.collect();

let mut new_errors = comparison.new_errors.into_iter().collect::<Vec<_>>();
new_errors.sort();
Ok(api::comparison::Response {
prev,
a: comparison.a.into(),
b: comparison.b.into(),
comparisons,
new_errors,
next,
is_contiguous,
})
Expand Down Expand Up @@ -323,6 +326,21 @@ impl ComparisonSummary {
write!(result, "- ").unwrap();
change.summary_line(&mut result, Some(link))
}

if !comparison.new_errors.is_empty() {
write!(
result,
"- New errors in {}",
comparison
.new_errors
.keys()
.map(|k| k.as_str())
.collect::<Vec<_>>()
.join(", ")
)
.unwrap();
}

result
}
}
Expand Down Expand Up @@ -368,6 +386,7 @@ async fn compare_given_commits(
master_commits: &[collector::MasterCommit],
calc_new_sig: bool,
) -> Result<Option<Comparison>, BoxedError> {
let idx = ctxt.index.load();
let a = ctxt
.artifact_id_for_bound(start.clone(), true)
.ok_or(format!("could not find start commit for bound {:?}", start))?;
Expand Down Expand Up @@ -408,10 +427,22 @@ async fn compare_given_commits(
})
})
.collect();

let mut errors = conn.get_error(b.lookup(&idx).unwrap()).await;
for (name, error) in conn.get_error(a.lookup(&idx).unwrap()).await {
if error.is_some() {
errors.remove(&name);
}
}

Ok(Some(Comparison {
a: ArtifactDescription::for_artifact(&*conn, a.clone(), master_commits).await,
b: ArtifactDescription::for_artifact(&*conn, b.clone(), master_commits).await,
statistics,
new_errors: errors
.into_iter()
.filter_map(|(k, v)| v.map(|v| (k, v)))
.collect(),
}))
}

Expand Down Expand Up @@ -557,6 +588,7 @@ pub struct Comparison {
pub b: ArtifactDescription,
/// Statistics based on test case
pub statistics: HashSet<TestResultComparison>,
pub new_errors: HashMap<String, String>,
}

impl Comparison {
Expand Down
10 changes: 9 additions & 1 deletion site/static/compare.html
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,14 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
</div>
</div>
</div>
<div v-if="data.new_errors.length">
<p><b>Newly broken benchmarks</b>:</p>
<details v-for="[crate, error] in data.new_errors">
<summary>{{ crate }}</summary>
<pre>{{ error }}</pre>
</details>
<hr />
</div>
<table id="benches" class="compare">
<thead>
<tr>
Expand Down Expand Up @@ -835,4 +843,4 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
</script>
</body>

</html>
</html>