Skip to content

Commit e1d959a

Browse files
claude: Remove redundant cargo build from LSP integration tests
Each nextest process ran `cargo build -p quarto` independently (OnceLock doesn't help across processes), adding ~30-60s per test just to check dependency staleness. The binary is already built before tests run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e798543 commit e1d959a

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

crates/quarto-lsp/tests/integration_test.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,12 @@ impl LspTestHarness {
103103
}
104104
}
105105

106-
/// Get the quarto binary path, building it once if needed.
107-
/// Uses OnceLock to ensure the build only happens once even when
108-
/// tests run in parallel, avoiding file lock contention.
106+
/// Get the quarto binary path.
107+
/// Expects the binary to already be built (e.g. by `cargo build` or
108+
/// `cargo nextest run`). Avoids running `cargo build` here because
109+
/// nextest runs each test in a separate process, so the OnceLock
110+
/// doesn't help — each process would redundantly check all
111+
/// dependencies for staleness, adding ~30-60s per test.
109112
fn get_binary_path() -> &'static PathBuf {
110113
BINARY_PATH.get_or_init(|| {
111114
let manifest_dir = env!("CARGO_MANIFEST_DIR");
@@ -115,18 +118,10 @@ impl LspTestHarness {
115118
.parent()
116119
.unwrap();
117120

118-
// Run cargo build first to ensure the binary exists
119-
let status = Command::new("cargo")
120-
.args(["build", "-p", "quarto"])
121-
.current_dir(workspace_root)
122-
.status()
123-
.expect("Failed to build quarto");
124-
assert!(status.success(), "Failed to build quarto binary");
125-
126121
let binary_path = workspace_root.join("target").join("debug").join("q2");
127122
assert!(
128123
binary_path.exists(),
129-
"q2 binary not found at {:?}",
124+
"q2 binary not found at {:?}. Run `cargo build -p quarto` first.",
130125
binary_path
131126
);
132127

0 commit comments

Comments
 (0)