Skip to content

Commit bf1e82f

Browse files
committed
Auto merge of #3399 - RalfJung:ci, r=
make CI failures easier to interpret RUST_BACKTRACE=1 means we show 2 backtraces that are almost always irrelevant: from ui_test and from the miri script. Instead let's set the env var inside the test harness so we see backtraces of Miri ICEing but nothing else.
2 parents 3670823 + 00f700d commit bf1e82f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
host_target: i686-pc-windows-msvc
3131
runs-on: ${{ matrix.os }}
3232
env:
33-
RUST_BACKTRACE: 1
3433
HOST_TARGET: ${{ matrix.host_target }}
3534
steps:
3635
- uses: actions/checkout@v3

tests/ui.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::ffi::OsString;
44
use std::num::NonZeroUsize;
55
use std::path::{Path, PathBuf};
66
use std::{env, process::Command};
7+
use ui_test::color_eyre::eyre::Context;
78
use ui_test::{color_eyre::Result, Config, Match, Mode, OutputConflictHandling};
89
use ui_test::{status_emitter, CommandBuilder, Format, RustfixMode};
910

@@ -124,6 +125,9 @@ fn run_tests(
124125
// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
125126
config.program.envs.push(("MIRI_TEMP".into(), Some(tmpdir.to_owned().into())));
126127

128+
// If a test ICEs, we want to see a backtrace.
129+
config.program.envs.push(("RUST_BACKTRACE".into(), Some("1".into())));
130+
127131
// Handle command-line arguments.
128132
let args = ui_test::Args::test()?;
129133
let default_bless = env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
@@ -223,14 +227,15 @@ fn ui(
223227
with_dependencies: Dependencies,
224228
tmpdir: &Path,
225229
) -> Result<()> {
226-
let msg = format!("## Running ui tests in {path} against miri for {target}");
230+
let msg = format!("## Running ui tests in {path} for {target}");
227231
eprintln!("{}", msg.green().bold());
228232

229233
let with_dependencies = match with_dependencies {
230234
WithDependencies => true,
231235
WithoutDependencies => false,
232236
};
233237
run_tests(mode, path, target, with_dependencies, tmpdir)
238+
.with_context(|| format!("ui tests in {path} for {target} failed"))
234239
}
235240

236241
fn get_target() -> String {

0 commit comments

Comments
 (0)