diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b651e7046bc7d603a7a829ce1b59fcf0468bdd3b..35efafcfcd97c0139f8225ce7b15a05946c385ad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,6 +43,8 @@ jobs: SCCACHE_BUCKET: sccache-zed - name: steps::cargo_nextest run: cargo nextest run --workspace --no-fail-fast --no-tests=warn + - name: steps::cargo_build_visual_tests + run: cargo build -p zed --bin zed_visual_test_runner --features visual-tests - name: steps::show_sccache_stats run: sccache --show-stats || true - name: steps::cleanup_cargo_config diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index a1a0569f5df00cfa9e93e311681a98c90d6ce067..13d036b128666700d45ae39013b2dd8f3da5abf9 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -440,6 +440,8 @@ jobs: SCCACHE_BUCKET: sccache-zed - name: steps::cargo_nextest run: cargo nextest run --workspace --no-fail-fast --no-tests=warn${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }} + - name: steps::cargo_build_visual_tests + run: cargo build -p zed --bin zed_visual_test_runner --features visual-tests - name: steps::show_sccache_stats run: sccache --show-stats || true - name: steps::cleanup_cargo_config diff --git a/crates/zed/src/visual_test_runner.rs b/crates/zed/src/visual_test_runner.rs index 17ce65bea4f3354bec1efd9b14d1b0ae08a6263f..7e081c15a564cb996f176345ee3330f00ee6b6f3 100644 --- a/crates/zed/src/visual_test_runner.rs +++ b/crates/zed/src/visual_test_runner.rs @@ -2646,10 +2646,11 @@ fn run_multi_workspace_sidebar_visual_tests( cx.run_until_parked(); - // Create the sidebar and register it on the MultiWorkspace - let sidebar = multi_workspace_window - .update(cx, |_multi_workspace, window, cx| { - let multi_workspace_handle = cx.entity(); + // Create the sidebar outside the MultiWorkspace update to avoid a + // re-entrant read panic (Sidebar::new reads the MultiWorkspace). + let sidebar = cx + .update_window(multi_workspace_window.into(), |root_view, window, cx| { + let multi_workspace_handle: Entity = root_view.downcast().unwrap(); cx.new(|cx| sidebar::Sidebar::new(multi_workspace_handle, window, cx)) }) .context("Failed to create sidebar")?; @@ -3178,10 +3179,11 @@ edition = "2021" cx.run_until_parked(); - // Create and register the workspace sidebar - let sidebar = workspace_window - .update(cx, |_multi_workspace, window, cx| { - let multi_workspace_handle = cx.entity(); + // Create the sidebar outside the MultiWorkspace update to avoid a + // re-entrant read panic (Sidebar::new reads the MultiWorkspace). + let sidebar = cx + .update_window(workspace_window.into(), |root_view, window, cx| { + let multi_workspace_handle: Entity = root_view.downcast().unwrap(); cx.new(|cx| sidebar::Sidebar::new(multi_workspace_handle, window, cx)) }) .context("Failed to create sidebar")?; diff --git a/tooling/xtask/src/tasks/workflows/run_tests.rs b/tooling/xtask/src/tasks/workflows/run_tests.rs index 52338e30ff15f9862c802f8515980642a9ba490d..65b44123c7b76f49e7c349318aab1bc2fb856c1f 100644 --- a/tooling/xtask/src/tasks/workflows/run_tests.rs +++ b/tooling/xtask/src/tasks/workflows/run_tests.rs @@ -596,6 +596,9 @@ fn run_platform_tests_impl(platform: Platform, filter_packages: bool) -> NamedJo .when(!filter_packages, |job| { job.add_step(steps::cargo_nextest(platform)) }) + .when(platform == Platform::Mac, |job| { + job.add_step(steps::cargo_build_visual_tests()) + }) .add_step(steps::show_sccache_stats(platform)) .add_step(steps::cleanup_cargo_config(platform)), } diff --git a/tooling/xtask/src/tasks/workflows/steps.rs b/tooling/xtask/src/tasks/workflows/steps.rs index 02476531ae97b6878784d2ce4694b29801446993..15c2614ada81dd7c2e772f52c7072dac4324d1dc 100644 --- a/tooling/xtask/src/tasks/workflows/steps.rs +++ b/tooling/xtask/src/tasks/workflows/steps.rs @@ -254,6 +254,10 @@ pub fn setup_sccache(platform: Platform) -> Step { .add_env(("SCCACHE_BUCKET", SCCACHE_R2_BUCKET)) } +pub fn cargo_build_visual_tests() -> Step { + named::bash("cargo build -p zed --bin zed_visual_test_runner --features visual-tests") +} + pub fn show_sccache_stats(platform: Platform) -> Step { match platform { // Use $env:RUSTC_WRAPPER (absolute path) because GITHUB_PATH changes