upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/test_utils/src/lib.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-12-13 12:02:15 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-12-13 12:37:22 +0000
commitee0e048ed9c244449ffb12284e444933eb67e118 (patch)
tree7447813026f9ef834ccae1e3cb3de4735f3a7f02 /test_utils/src/lib.rs
parentf294a249307accc0f173917989ce27c27f0c6792 (diff)
test(push): merge event for applied commits
publish a merge event when the commit author signature and timestamp match patches within an open proposal
Diffstat (limited to 'test_utils/src/lib.rs')
-rw-r--r--test_utils/src/lib.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs
index 3ac171b..5079c26 100644
--- a/test_utils/src/lib.rs
+++ b/test_utils/src/lib.rs
@@ -1212,9 +1212,9 @@ pub fn cli_tester_create_proposals() -> Result<GitTestRepo> {
1212pub fn cli_tester_create_proposal_branches_ready_to_send() -> Result<GitTestRepo> { 1212pub fn cli_tester_create_proposal_branches_ready_to_send() -> Result<GitTestRepo> {
1213 let git_repo = GitTestRepo::default(); 1213 let git_repo = GitTestRepo::default();
1214 git_repo.populate()?; 1214 git_repo.populate()?;
1215 create_and_populate_branch(&git_repo, FEATURE_BRANCH_NAME_1, "a", false)?; 1215 create_and_populate_branch(&git_repo, FEATURE_BRANCH_NAME_1, "a", false, None)?;
1216 create_and_populate_branch(&git_repo, FEATURE_BRANCH_NAME_2, "b", false)?; 1216 create_and_populate_branch(&git_repo, FEATURE_BRANCH_NAME_2, "b", false, None)?;
1217 create_and_populate_branch(&git_repo, FEATURE_BRANCH_NAME_3, "c", false)?; 1217 create_and_populate_branch(&git_repo, FEATURE_BRANCH_NAME_3, "c", false, None)?;
1218 Ok(git_repo) 1218 Ok(git_repo)
1219} 1219}
1220 1220
@@ -1223,6 +1223,7 @@ pub fn create_and_populate_branch(
1223 branch_name: &str, 1223 branch_name: &str,
1224 prefix: &str, 1224 prefix: &str,
1225 only_one_commit: bool, 1225 only_one_commit: bool,
1226 commiter: Option<&Signature>,
1226) -> Result<()> { 1227) -> Result<()> {
1227 test_repo.checkout("main")?; 1228 test_repo.checkout("main")?;
1228 test_repo.create_branch(branch_name)?; 1229 test_repo.create_branch(branch_name)?;
@@ -1239,7 +1240,7 @@ pub fn create_and_populate_branch(
1239 ) 1240 )
1240 .unwrap(), 1241 .unwrap(),
1241 ), 1242 ),
1242 None, 1243 commiter,
1243 )?; 1244 )?;
1244 if !only_one_commit { 1245 if !only_one_commit {
1245 let file_name = format!("{}4.md", prefix); 1246 let file_name = format!("{}4.md", prefix);
@@ -1254,7 +1255,7 @@ pub fn create_and_populate_branch(
1254 ) 1255 )
1255 .unwrap(), 1256 .unwrap(),
1256 ), 1257 ),
1257 None, 1258 commiter,
1258 )?; 1259 )?;
1259 } 1260 }
1260 Ok(()) 1261 Ok(())
@@ -1292,7 +1293,7 @@ pub fn cli_tester_create_proposal(
1292 cover_letter_title_and_description: Option<(&str, &str)>, 1293 cover_letter_title_and_description: Option<(&str, &str)>,
1293 in_reply_to: Option<String>, 1294 in_reply_to: Option<String>,
1294) -> Result<()> { 1295) -> Result<()> {
1295 create_and_populate_branch(test_repo, branch_name, prefix, false)?; 1296 create_and_populate_branch(test_repo, branch_name, prefix, false, None)?;
1296 std::thread::sleep(std::time::Duration::from_millis(1000)); 1297 std::thread::sleep(std::time::Duration::from_millis(1000));
1297 if let Some(in_reply_to) = in_reply_to { 1298 if let Some(in_reply_to) = in_reply_to {
1298 let mut p = CliTester::new_from_dir( 1299 let mut p = CliTester::new_from_dir(