MCPcopy Create free account
hub / github.com/dashed/git-chain / merge_subcommand_report_level_options

Function merge_subcommand_report_level_options

tests/merge.rs:3040–3489  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3038/// Test merge feature: report levels
3039#[test]
3040fn merge_subcommand_report_level_options() {
3041 let repo_name = "merge_report_level_options";
3042 let repo = setup_git_repo(repo_name);
3043 let path_to_repo = generate_path_to_repo(repo_name);
3044
3045 println!("=== TEST SETUP: Initial Repository ===");
3046 // Create initial repository with a chain
3047 {
3048 create_new_file(&path_to_repo, "hello_world.txt", "Hello, world!");
3049 first_commit_all(&repo, "first commit");
3050 println!("Created master branch with hello_world.txt");
3051
3052 println!("=== CREATING FEATURE BRANCHES ===");
3053 // Create branches and chain
3054 create_branch(&repo, "feature_1");
3055 checkout_branch(&repo, "feature_1");
3056 create_new_file(&path_to_repo, "feature1.txt", "Feature 1 content");
3057 commit_all(&repo, "feature 1 commit");
3058 println!("Created feature_1 branch with feature1.txt");
3059
3060 create_branch(&repo, "feature_2");
3061 checkout_branch(&repo, "feature_2");
3062 create_new_file(&path_to_repo, "feature2.txt", "Feature 2 content");
3063 commit_all(&repo, "feature 2 commit");
3064 println!("Created feature_2 branch with feature2.txt");
3065
3066 create_branch(&repo, "feature_3");
3067 checkout_branch(&repo, "feature_3");
3068 create_new_file(&path_to_repo, "feature3.txt", "Feature 3 content");
3069 commit_all(&repo, "feature 3 commit");
3070 println!("Created feature_3 branch with feature3.txt");
3071
3072 println!("=== CHAIN SETUP ===");
3073 // Setup the chain
3074 let args: Vec<&str> = vec![
3075 "setup",
3076 "feature_chain",
3077 "master",
3078 "feature_1",
3079 "feature_2",
3080 "feature_3",
3081 ];
3082 let output = run_test_bin(&path_to_repo, args);
3083
3084 let stdout = String::from_utf8_lossy(&output.stdout);
3085 let stderr = String::from_utf8_lossy(&output.stderr);
3086 let success = output.status.success();
3087
3088 println!("Chain setup stdout: {}", stdout);
3089 println!("Chain setup stderr: {}", stderr);
3090 println!("Chain setup success: {}", success);
3091
3092 assert!(success, "Command should succeed but failed");
3093 assert!(
3094 stdout.contains("Succesfully set up chain: feature_chain"),
3095 "stdout should confirm chain setup but got: {}",
3096 stdout
3097 );

Callers

nothing calls this directly

Calls 11

setup_git_repoFunction · 0.85
generate_path_to_repoFunction · 0.85
create_new_fileFunction · 0.85
first_commit_allFunction · 0.85
create_branchFunction · 0.85
checkout_branchFunction · 0.85
commit_allFunction · 0.85
run_test_binFunction · 0.85
get_current_branch_nameFunction · 0.85
run_git_commandFunction · 0.85
teardown_git_repoFunction · 0.85

Tested by

no test coverage detected