From 6cce931a88490de7413919db153d15f4612075f0 Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Thu, 2 Apr 2026 09:58:25 +0000 Subject: [PATCH] Add test for CLI --- src/apps/cli/test/test-e2e-two-vaults-common.sh | 16 ++++++++++++++++ updates.md | 4 +--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/apps/cli/test/test-e2e-two-vaults-common.sh b/src/apps/cli/test/test-e2e-two-vaults-common.sh index 812d290..9daab6b 100644 --- a/src/apps/cli/test/test-e2e-two-vaults-common.sh +++ b/src/apps/cli/test/test-e2e-two-vaults-common.sh @@ -136,6 +136,8 @@ fi TARGET_A_ONLY="e2e/a-only-info.md" TARGET_SYNC="e2e/sync-info.md" +TARGET_SYNC_TWICE_FIRST="e2e/sync-twice-first.md" +TARGET_SYNC_TWICE_SECOND="e2e/sync-twice-second.md" TARGET_PUSH="e2e/pushed-from-a.md" TARGET_PUT="e2e/put-from-a.md" TARGET_PUSH_BINARY="e2e/pushed-from-a.bin" @@ -154,6 +156,20 @@ INFO_B_SYNC="$(run_cli_b info "$TARGET_SYNC")" cli_test_assert_contains "$INFO_B_SYNC" "\"path\": \"$TARGET_SYNC\"" "B info should include path after sync" echo "[PASS] sync A->B and B info" +echo "[CASE] B can sync again after first replication has completed" +printf 'first-sync-round-%s\n' "$DB_SUFFIX" | run_cli_a put "$TARGET_SYNC_TWICE_FIRST" >/dev/null +run_cli_a sync >/dev/null +run_cli_b sync >/dev/null +CAT_B_SYNC_TWICE_FIRST="$(run_cli_b cat "$TARGET_SYNC_TWICE_FIRST" | cli_test_sanitise_cat_stdout)" +cli_test_assert_equal "first-sync-round-$DB_SUFFIX" "$CAT_B_SYNC_TWICE_FIRST" "B should receive first update after first sync" + +printf 'second-sync-round-%s\n' "$DB_SUFFIX" | run_cli_a put "$TARGET_SYNC_TWICE_SECOND" >/dev/null +run_cli_a sync >/dev/null +run_cli_b sync >/dev/null +CAT_B_SYNC_TWICE_SECOND="$(run_cli_b cat "$TARGET_SYNC_TWICE_SECOND" | cli_test_sanitise_cat_stdout)" +cli_test_assert_equal "second-sync-round-$DB_SUFFIX" "$CAT_B_SYNC_TWICE_SECOND" "B should receive second update after re-running sync" +echo "[PASS] second sync after completion works" + echo "[CASE] A pushes and puts, both sync, and B can pull and cat" PUSH_SRC="$WORK_DIR/push-source.txt" PULL_DST="$WORK_DIR/pull-destination.txt" diff --git a/updates.md b/updates.md index dbc9a70..48d45d4 100644 --- a/updates.md +++ b/updates.md @@ -9,12 +9,10 @@ The head note of 0.25 is now in [updates_old.md](https://github.com/vrtmrz/obsid ### CLI -#### (may) Fixed, to be confirmed +#### Fixed - Replication progress is now correctly saved and restored in the CLI. - - ## ~~0.25.55~~ 0.25.56 30th March, 2026