Skip to content

Commit

Permalink
Auto merge of #3399 - RalfJung:ci, r=RalfJung
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Mar 23, 2024
2 parents 3670823 + 00f700d commit adc9951
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
host_target: i686-pc-windows-msvc
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: 1
HOST_TARGET: ${{ matrix.host_target }}
steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 6 additions & 1 deletion tests/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::ffi::OsString;
use std::num::NonZeroUsize;
use std::path::{Path, PathBuf};
use std::{env, process::Command};
use ui_test::color_eyre::eyre::Context;
use ui_test::{color_eyre::Result, Config, Match, Mode, OutputConflictHandling};
use ui_test::{status_emitter, CommandBuilder, Format, RustfixMode};

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

// If a test ICEs, we want to see a backtrace.
config.program.envs.push(("RUST_BACKTRACE".into(), Some("1".into())));

// Handle command-line arguments.
let args = ui_test::Args::test()?;
let default_bless = env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
Expand Down Expand Up @@ -223,14 +227,15 @@ fn ui(
with_dependencies: Dependencies,
tmpdir: &Path,
) -> Result<()> {
let msg = format!("## Running ui tests in {path} against miri for {target}");
let msg = format!("## Running ui tests in {path} for {target}");
eprintln!("{}", msg.green().bold());

let with_dependencies = match with_dependencies {
WithDependencies => true,
WithoutDependencies => false,
};
run_tests(mode, path, target, with_dependencies, tmpdir)
.with_context(|| format!("ui tests in {path} for {target} failed"))
}

fn get_target() -> String {
Expand Down

0 comments on commit adc9951

Please sign in to comment.