From b9075452324326b6a12a6775b6e1179a7edd5ce7 Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Mon, 9 Dec 2024 17:23:33 +0800 Subject: [PATCH 1/4] disable log for miri --- crates/testing/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/testing/src/lib.rs b/crates/testing/src/lib.rs index 62870370adbe..4e13eec4926f 100644 --- a/crates/testing/src/lib.rs +++ b/crates/testing/src/lib.rs @@ -166,7 +166,9 @@ impl Tester { where F: FnOnce(Lrc, Handler) -> Result, { - let _log = init(); + // This makes miri slow + let _log: Option = + if cfg!(miri) { None } else { Some(init()) }; let (handler, errors) = self::string_errors::new_handler(self.cm.clone(), self.treat_err_as_bug); From 75705f2dc30a5a348ecbfa4df9d2ccc2f7e3737d Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Mon, 9 Dec 2024 17:24:00 +0800 Subject: [PATCH 2/4] enable --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bec0cdaf5855..4ac1ffb0de78 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -501,8 +501,8 @@ jobs: - string_enum - swc - swc_bundler - # - swc_ecma_codegen - # - swc_ecma_minifier + - swc_ecma_codegen + - swc_ecma_minifier steps: - uses: actions/checkout@v4 with: From 44f1aa1f5286e2989aab0e3fa8b782dc26c8e77b Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Mon, 9 Dec 2024 18:01:39 +0800 Subject: [PATCH 3/4] update --- crates/testing/src/lib.rs | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/crates/testing/src/lib.rs b/crates/testing/src/lib.rs index 4e13eec4926f..2f28c403de57 100644 --- a/crates/testing/src/lib.rs +++ b/crates/testing/src/lib.rs @@ -39,16 +39,20 @@ mod string_errors; pub fn init() -> tracing::subscriber::DefaultGuard { let log_env = env::var("RUST_LOG").unwrap_or_else(|_| "debug".to_string()); - let logger = tracing_subscriber::FmtSubscriber::builder() - .without_time() - .with_target(false) - .with_ansi(true) - .with_env_filter(EnvFilter::from_str(&log_env).unwrap()) - .with_test_writer() - .pretty() - .finish(); - - tracing::subscriber::set_default(logger) + if cfg!(miri) { + tracing::subscriber::set_default(tracing::subscriber::NoSubscriber::new()) + } else { + // This makes miri slow + let logger = tracing_subscriber::FmtSubscriber::builder() + .without_time() + .with_target(false) + .with_ansi(true) + .with_env_filter(EnvFilter::from_str(&log_env).unwrap()) + .with_test_writer() + .pretty() + .finish(); + tracing::subscriber::set_default(logger) + } } pub fn find_executable(name: &str) -> Option { @@ -166,9 +170,7 @@ impl Tester { where F: FnOnce(Lrc, Handler) -> Result, { - // This makes miri slow - let _log: Option = - if cfg!(miri) { None } else { Some(init()) }; + let _log = init(); let (handler, errors) = self::string_errors::new_handler(self.cm.clone(), self.treat_err_as_bug); From b038b615c4b9c2545edcfafd363ec3c999bc63c7 Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Mon, 9 Dec 2024 21:14:40 +0800 Subject: [PATCH 4/4] nextest --- .github/workflows/CI.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4ac1ffb0de78..65b9d0705d5c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -536,7 +536,12 @@ jobs: toolchain: "${{ steps.rustup-version.outputs.RUST_TOOLCHAIN }}" components: miri - - run: cargo miri test -p ${{ matrix.crate }} --no-fail-fast + - name: Install cargo-nextest + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + + - run: cargo miri nextest run -p ${{ matrix.crate }} --no-fail-fast -j 4 continue-on-error: true env: MIRIFLAGS: "-Zmiri-disable-isolation"