upleb.uk

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

summaryrefslogtreecommitdiff
path: root/tests/pull.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-07-24 16:11:23 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-07-24 16:11:23 +0100
commit95cb9c040dfa8ca18bf907a44a86df35b316b6ca (patch)
treeafb0394022bc1e05b6706a8f50c4321128e8077d /tests/pull.rs
parent50df657f45966bc6cbf4a392a815fcc2c331f888 (diff)
test: remove old proposal rev amended locally
`pull` test. It's failing and only tests for different copy in an obscure scenario
Diffstat (limited to 'tests/pull.rs')
-rw-r--r--tests/pull.rs67
1 files changed, 0 insertions, 67 deletions
diff --git a/tests/pull.rs b/tests/pull.rs
index 057e827..6637859 100644
--- a/tests/pull.rs
+++ b/tests/pull.rs
@@ -305,73 +305,6 @@ mod when_branch_is_checked_out {
305 } 305 }
306 } 306 }
307 307
308 mod when_old_proposal_revision_amended_locally {
309 use super::*;
310
311 mod cli_prompts {
312 use super::*;
313
314 #[tokio::test]
315 #[serial]
316 async fn cli_output_correct() -> Result<()> {
317 let (mut r51, mut r52, mut r53, mut r55, mut r56) = (
318 Relay::new(8051, None, None),
319 Relay::new(8052, None, None),
320 Relay::new(8053, None, None),
321 Relay::new(8055, None, None),
322 Relay::new(8056, None, None),
323 );
324
325 r51.events.push(generate_test_key_1_relay_list_event());
326 r51.events.push(generate_test_key_1_metadata_event("fred"));
327 r51.events.push(generate_repo_ref_event());
328
329 r55.events.push(generate_repo_ref_event());
330 r55.events.push(generate_test_key_1_metadata_event("fred"));
331 r55.events.push(generate_test_key_1_relay_list_event());
332
333 let cli_tester_handle = std::thread::spawn(move || -> Result<()> {
334 let (o, test_repo) =
335 create_proposals_with_first_revised_and_repo_with_unrevised_proposal_checkedout()?;
336
337 amend_last_commit(&test_repo, "add different ammended-commit.md")?;
338
339 // test when branch is ammended an older version of the proposal
340 let mut p = CliTester::new_from_dir(&test_repo.dir, ["pull"]);
341 p.expect("fetching updates...\r\n")?;
342 p.expect_eventually("\r\n")?; // some updates listed here
343 p.expect(
344 "you have an amended/rebase version the proposal that is unpublished\r\n",
345 )?;
346 p.expect("your local proposal branch (2 ahead 0 behind 'main') has conflicting changes with the latest published proposal (2 ahead 0 behind 'main')\r\n")?;
347 p.expect("its likely that you have rebased / amended an old proposal version because git has no record of the latest proposal commit.\r\n")?;
348 p.expect("it is possible that you have been working off the latest version and git has delete this commit as part of a clean up\r\n")?;
349 p.expect("to view the latest proposal but retain your changes:\r\n")?;
350 p.expect(" 1) create a new branch off the tip commit of this one to store your changes\r\n")?;
351 p.expect(" 2) run `ngit list` and checkout the latest published version of this proposal\r\n")?;
352 p.expect("if you are confident in your changes consider running `ngit push --force`\r\n")?;
353 p.expect_end()?;
354
355 for p in [51, 52, 53, 55, 56] {
356 relay::shutdown_relay(8000 + p)?;
357 }
358 Ok(())
359 });
360
361 // launch relay
362 let _ = join!(
363 r51.listen_until_close(),
364 r52.listen_until_close(),
365 r53.listen_until_close(),
366 r55.listen_until_close(),
367 r56.listen_until_close(),
368 );
369 cli_tester_handle.join().unwrap()?;
370 Ok(())
371 }
372 }
373 }
374
375 mod when_latest_proposal_amended_locally { 308 mod when_latest_proposal_amended_locally {
376 use super::*; 309 use super::*;
377 310