mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-27 19:43:20 +00:00
Add test for CLI
This commit is contained in:
2 files changed
+17
-3
No files matched your search
@@ -136,6 +136,8 @@ fi
|
|||||||
|
|
||||||
TARGET_A_ONLY="e2e/a-only-info.md"
|
TARGET_A_ONLY="e2e/a-only-info.md"
|
||||||
TARGET_SYNC="e2e/sync-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_PUSH="e2e/pushed-from-a.md"
|
||||||
TARGET_PUT="e2e/put-from-a.md"
|
TARGET_PUT="e2e/put-from-a.md"
|
||||||
TARGET_PUSH_BINARY="e2e/pushed-from-a.bin"
|
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"
|
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 "[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"
|
echo "[CASE] A pushes and puts, both sync, and B can pull and cat"
|
||||||
PUSH_SRC="$WORK_DIR/push-source.txt"
|
PUSH_SRC="$WORK_DIR/push-source.txt"
|
||||||
PULL_DST="$WORK_DIR/pull-destination.txt"
|
PULL_DST="$WORK_DIR/pull-destination.txt"
|
||||||
|
|||||||
+1
-3
@@ -9,12 +9,10 @@ The head note of 0.25 is now in [updates_old.md](https://github.com/vrtmrz/obsid
|
|||||||
|
|
||||||
### CLI
|
### CLI
|
||||||
|
|
||||||
#### (may) Fixed, to be confirmed
|
#### Fixed
|
||||||
|
|
||||||
- Replication progress is now correctly saved and restored in the CLI.
|
- Replication progress is now correctly saved and restored in the CLI.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ~~0.25.55~~ 0.25.56
|
## ~~0.25.55~~ 0.25.56
|
||||||
|
|
||||||
30th March, 2026
|
30th March, 2026
|
||||||
|
|||||||
Reference in new issue
Block a user