Skip to content

Automatically ignore trybuild compiler diagnostic changes #689

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
Apr 1, 2023
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 src/report/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ impl ResultName for FailureReason {
FailureReason::ICE => "ICE".into(),
FailureReason::CompilerError(_) => "compiler error".into(),
FailureReason::DependsOn(_) => "faulty deps".into(),
FailureReason::CompilerDiagnosticChange => "compiler diagnostic changed".into(),
}
}

Expand All @@ -27,6 +28,7 @@ impl ResultName for FailureReason {
| FailureReason::NetworkAccess
| FailureReason::Timeout
| FailureReason::OOM
| FailureReason::CompilerDiagnosticChange
| FailureReason::ICE => self.short_name(),
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/results/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ pub enum FailureReason {
Timeout,
ICE,
NetworkAccess,
CompilerDiagnosticChange,
CompilerError(BTreeSet<DiagnosticCode>),
DependsOn(BTreeSet<Crate>),
}
Expand Down Expand Up @@ -230,6 +231,7 @@ impl ::std::fmt::Display for FailureReason {
.collect::<Vec<String>>()
.join(", "),
),
FailureReason::CompilerDiagnosticChange => write!(f, "compiler-diagnostic-change"),
}
}
}
Expand Down Expand Up @@ -274,7 +276,10 @@ impl ::std::str::FromStr for FailureReason {
impl FailureReason {
pub(crate) fn is_spurious(&self) -> bool {
match *self {
FailureReason::OOM | FailureReason::Timeout | FailureReason::NetworkAccess => true,
FailureReason::OOM
| FailureReason::Timeout
| FailureReason::NetworkAccess
| FailureReason::CompilerDiagnosticChange => true,
FailureReason::CompilerError(_)
| FailureReason::DependsOn(_)
| FailureReason::Unknown
Expand Down
6 changes: 6 additions & 0 deletions src/runner/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ fn run_cargo<DB: WriteResults>(

let mut did_ice = false;
let mut did_network = false;
let mut did_trybuild = false;
let mut error_codes = BTreeSet::new();
let mut deps = BTreeSet::new();

Expand All @@ -123,6 +124,9 @@ fn run_cargo<DB: WriteResults>(
if line.contains("code: 111") && line.contains("Connection refused") {
did_network = true;
}
if line.contains("the environment variable TRYBUILD=overwrite") {
did_trybuild = true;
}

// Avoid trying to deserialize non JSON output
if !line.starts_with('{') {
Expand Down Expand Up @@ -198,6 +202,8 @@ fn run_cargo<DB: WriteResults>(
Err(e.context(FailureReason::CompilerError(error_codes)).into())
} else if did_network {
Err(e.context(FailureReason::NetworkAccess).into())
} else if did_trybuild {
Err(e.context(FailureReason::CompilerDiagnosticChange).into())
} else {
Err(e.into())
}
Expand Down