Add visual tests to macOS CI (#52847)

This fixes three pre-existing issues in the visual test runner that were
never caught because visual tests aren't run in CI.

## Fixes

**1. Re-entrant read panic in sidebar creation (3 places)**

`Sidebar::new` reads the `MultiWorkspace` entity, so creating it inside
a `multi_workspace.update()` closure causes a `cannot read while being
updated` panic. Fixed by using `update_window` with
`root_view.downcast()` to get the handle without holding a mutable
borrow.

**2. Tooltip entity leak in breakpoint_hover test**

The tooltip system has an Rc cycle (`ActiveTooltip::Visible` holds a
`check_visible_and_update` closure that captures the
`Rc<RefCell<Option<ActiveTooltip>>>`). This cycle is normally broken
when the tooltip is dismissed, but the test closed the window while the
tooltip was still visible, causing a panic from the leak detector. Fixed
by simulating a click before cleanup to dismiss the tooltip.

**3. Visual tests not in CI**

Added a `cargo_run_visual_tests` step to the macOS test job via xtask so
these tests run on every PR and regressions are caught early.

Release Notes:

- N/A
This commit is contained in:
Richard Feldman authored and GitHub committed 2026-04-01 23:11:40 -04:00
1 parent 7d46c41c26
commit 05031b8c88
5 files changed
+21 -8

No files matched your search

+2
View File
@@ -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
+2
View File
@@ -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