Add test for CLI

This commit is contained in:
vorotamoroz
2026-04-02 09:58:25 +00:00
parent 216861f2c3
commit 6cce931a88
2 changed files with 17 additions and 3 deletions

View File

@@ -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"

View File

@@ -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