History

Rename visual_test_runner to zed_visual_test_runner (#46171)

This fixes the auto-update failure by ensuring cargo-bundle picks 'zed' as the first binary. **Problem:** `cargo metadata` returns binaries alphabetically, so `visual_test_runner` was coming before `zed`. When cargo-bundle looks for the first binary to bundle (without `--bin`), it was picking `visual_test_runner` - which doesn't exist in release builds because it requires the `visual-tests` feature. The previous fix (#46163) added `--bin zed` to explicitly select the binary, but this caused cargo-bundle to use the binary name ('zed') instead of the bundle metadata name ('Zed Nightly'), breaking auto-updates. **Fix:** Rename the binary to `zed_visual_test_runner` so it comes after `zed` alphabetically. This restores the original bundle script behavior that has worked for years. Also reverts the `--bin zed` workaround from #46163. Release Notes: - N/A

Richard Feldman committed 10 months ago

Commit 167970b1 parent 114bc694 files · +6 −6Browse files

Unified · Split

4 files
  1. crates/zed/Cargo.toml +1 −1
  2. crates/zed/src/visual_test_runner.rs +2 −2
  3. docs/src/development/macos.md +2 −2
  4. script/bundle-mac +1 −1
crates/zed/Cargo.toml+1−1
@@ -43,7 +43,7 @@ name = "zed" · 42 unmodified lines
43path = "src/main.rs"43path = "src/main.rs"
44 44
45[[bin]]45[[bin]]
46name = "visual_test_runner"46name = "zed_visual_test_runner"
47path = "src/visual_test_runner.rs"47path = "src/visual_test_runner.rs"
48required-features = ["visual-tests"]48required-features = ["visual-tests"]
49 49
crates/zed/src/visual_test_runner.rs+2−2
@@ -14,10 +14,10 @@ · 13 unmodified lines
14//! ## Usage14//! ## Usage
15//!15//!
16//! Run the visual tests:16//! Run the visual tests:
17//! cargo run -p zed --bin visual_test_runner --features visual-tests17//! cargo run -p zed --bin zed_visual_test_runner --features visual-tests
18//!18//!
19//! Update baseline images (when UI intentionally changes):19//! Update baseline images (when UI intentionally changes):
20//! UPDATE_BASELINE=1 cargo run -p zed --bin visual_test_runner --features visual-tests20//! UPDATE_BASELINE=1 cargo run -p zed --bin zed_visual_test_runner --features visual-tests
21//!21//!
22//! ## Environment Variables22//! ## Environment Variables
23//!23//!
docs/src/development/macos.md+2−2
@@ -69,7 +69,7 @@ You must grant Screen Recording permission to your terminal: · 68 unmodified lines
69### Running Visual Tests69### Running Visual Tests
70 70
71```sh71```sh
72cargo run -p zed --bin visual_test_runner --features visual-tests72cargo run -p zed --bin zed_visual_test_runner --features visual-tests
73```73```
74 74
75### Updating Baselines75### Updating Baselines
@@ -77,7 +77,7 @@ cargo run -p zed --bin visual_test_runner --features visual-tests · 1 unmodified line
77When UI changes are intentional, update the baseline images:77When UI changes are intentional, update the baseline images:
78 78
79```sh79```sh
80UPDATE_BASELINE=1 cargo run -p zed --bin visual_test_runner --features visual-tests80UPDATE_BASELINE=1 cargo run -p zed --bin zed_visual_test_runner --features visual-tests
81```81```
82 82
83Baseline images are stored in `crates/zed/test_fixtures/visual_tests/` and should be committed to the repository.83Baseline images are stored in `crates/zed/test_fixtures/visual_tests/` and should be committed to the repository.
script/bundle-mac+1−1
@@ -100,7 +100,7 @@ sed \ · 99 unmodified lines
100 "s/package.metadata.bundle-${channel}/package.metadata.bundle/" \100 "s/package.metadata.bundle-${channel}/package.metadata.bundle/" \
101 Cargo.toml101 Cargo.toml
102 102
103app_path=$(cargo bundle ${build_flag} --target $target_triple --select-workspace-root --bin zed | xargs)103app_path=$(cargo bundle ${build_flag} --target $target_triple --select-workspace-root | xargs)
104 104
105mv Cargo.toml.backup Cargo.toml105mv Cargo.toml.backup Cargo.toml
106popd106popd