chore(build): preparing for CI

This commit is contained in:
2026-03-08 15:44:26 +01:00
parent a45f0424f4
commit 98403152ab
7 changed files with 98 additions and 77 deletions

View File

@@ -3,17 +3,16 @@ use assert_fs::TempDir;
use jj_cz::{CommitType, Description, MockPrompts, Scope};
use jj_cz::{CommitWorkflow, Error, JjLib};
#[cfg(feature = "test-utils")]
use std::process::Command;
use jj_lib::{config::StackedConfig, settings::UserSettings, workspace::Workspace};
/// Helper to initialize a temporary jj repository
/// Helper to initialize a temporary jj repository using jj-lib directly (no CLI required)
#[cfg(feature = "test-utils")]
fn init_jj_repo(temp_dir: &TempDir) {
let status = Command::new("jj")
.args(["git", "init"])
.current_dir(temp_dir)
.status()
async fn init_jj_repo(temp_dir: &TempDir) {
let config = StackedConfig::with_defaults();
let settings = UserSettings::from_config(config).expect("Failed to create settings");
Workspace::init_internal_git(&settings, temp_dir.path())
.await
.expect("Failed to initialize jj repository");
assert!(status.success(), "jj git init failed");
}
#[cfg(feature = "test-utils")]
@@ -21,7 +20,7 @@ fn init_jj_repo(temp_dir: &TempDir) {
async fn test_happy_path_integration() {
// T037: Happy path integration test
let temp_dir = TempDir::new().unwrap();
init_jj_repo(&temp_dir);
init_jj_repo(&temp_dir).await;
// Create mock prompts that simulate a successful workflow
let mock_prompts = MockPrompts::new()
@@ -67,9 +66,6 @@ async fn test_cancellation() {
// This is tricky to test directly without a TTY
// We'll test the error handling path instead
let temp_dir = TempDir::new().unwrap();
init_jj_repo(&temp_dir);
// Create a mock executor that simulates cancellation
struct CancelMock;