# Add visual tests to macOS CI \(\#52847\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/ffbfff3e17af2e5485cbb98b122c5277d9e0b69f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: ffbfff3e17af2e5485cbb98b122c5277d9e0b69f

Requested commit: ffbfff3e17af2e5485cbb98b122c5277d9e0b69f

Commit: ffbfff3e17af2e5485cbb98b122c5277d9e0b69f

Tree: b375a9c8cd909de4ee7ce33d70a79b222517d7ae

Author: Richard Feldman

Committer: GitHub

## Message

```
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
```

## Parents

- [3bc55a48df5356af8aed7c3313802e13a053c6bd](https://git.cafe/gitcafe/zed/commit/3bc55a48df5356af8aed7c3313802e13a053c6bd?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/ffbfff3e17af2e5485cbb98b122c5277d9e0b69f?format=markdown)
