Skip to content

Commit bb96963

Browse files
committed
disable RUST_BACKTRACE in CI, set it inside the test harness instead
1 parent 2bdbf1d commit bb96963

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ 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;
8-
use ui_test::{color_eyre::Result, Config, Match, Mode, OutputConflictHandling};
9-
use ui_test::{status_emitter, CommandBuilder, Format, RustfixMode};
7+
use ui_test::color_eyre::eyre::{Context, Result};
8+
use ui_test::{
9+
status_emitter, CommandBuilder, Config, Format, Match, Mode, OutputConflictHandling,
10+
RustfixMode,
11+
};
1012

1113
fn miri_path() -> PathBuf {
1214
PathBuf::from(option_env!("MIRI").unwrap_or(env!("CARGO_BIN_EXE_miri")))
@@ -125,6 +127,9 @@ fn run_tests(
125127
// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
126128
config.program.envs.push(("MIRI_TEMP".into(), Some(tmpdir.to_owned().into())));
127129

130+
// If a test ICEs, we want to see a backtrace.
131+
config.program.envs.push(("RUST_BACKTRACE".into(), Some("1".into())));
132+
128133
// Handle command-line arguments.
129134
let args = ui_test::Args::test()?;
130135
let default_bless = env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
@@ -224,7 +229,7 @@ fn ui(
224229
with_dependencies: Dependencies,
225230
tmpdir: &Path,
226231
) -> Result<()> {
227-
let msg = format!("## Running ui tests in {path} against miri for {target}");
232+
let msg = format!("## Running ui tests in {path} for {target}");
228233
eprintln!("{}", msg.green().bold());
229234

230235
let with_dependencies = match with_dependencies {

0 commit comments

Comments
 (0)