mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-09-01 08:17:07 +00:00
Move CLI E2E runner into CLI tests
This commit is contained in:
@@ -178,8 +178,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run Compose CLI P2P E2E
|
- name: Run Compose CLI P2P E2E
|
||||||
env:
|
env:
|
||||||
BENCH_COMMAND: cli-p2p-e2e
|
CLI_E2E_TASK: test:p2p-sync
|
||||||
CLI_P2P_E2E_TASK: test:p2p-sync
|
|
||||||
RELAY: ws://nostr-relay:7777/
|
RELAY: ws://nostr-relay:7777/
|
||||||
PEERS_TIMEOUT: '20'
|
PEERS_TIMEOUT: '20'
|
||||||
SYNC_TIMEOUT: '60'
|
SYNC_TIMEOUT: '60'
|
||||||
@@ -188,7 +187,7 @@ jobs:
|
|||||||
LIVESYNC_P2P_PEERS_RETRY: '1'
|
LIVESYNC_P2P_PEERS_RETRY: '1'
|
||||||
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: '60000'
|
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: '60000'
|
||||||
BENCH_LIVESYNC_TEST_TEE: '0'
|
BENCH_LIVESYNC_TEST_TEE: '0'
|
||||||
run: docker compose -f test/bench-network/compose.yml run --build --rm bench-runner
|
run: docker compose -f test/bench-network/compose.yml run --build --rm bench-runner run-livesync-cli-e2e
|
||||||
|
|
||||||
- name: Show Compose diagnostics
|
- name: Show Compose diagnostics
|
||||||
if: failure()
|
if: failure()
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
TASK="${CLI_E2E_TASK:-test:p2p-sync}"
|
||||||
|
|
||||||
|
case "$TASK" in
|
||||||
|
test:p2p-host|test:p2p-peers|test:p2p-sync|test:p2p-three-nodes|test:p2p-upload-download)
|
||||||
|
exec deno task "$TASK"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown CLI_E2E_TASK: $TASK" >&2
|
||||||
|
echo "Expected one of: test:p2p-host, test:p2p-peers, test:p2p-sync, test:p2p-three-nodes, test:p2p-upload-download" >&2
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -31,6 +31,7 @@ RUN deno cache --lock=deno.lock \
|
|||||||
test-p2p-sync.ts
|
test-p2p-sync.ts
|
||||||
|
|
||||||
COPY test/bench-network/run-bench.sh /usr/local/bin/run-livesync-bench
|
COPY test/bench-network/run-bench.sh /usr/local/bin/run-livesync-bench
|
||||||
RUN chmod +x /usr/local/bin/run-livesync-bench
|
COPY src/apps/cli/testdeno/run-cli-e2e.sh /usr/local/bin/run-livesync-cli-e2e
|
||||||
|
RUN chmod +x /usr/local/bin/run-livesync-bench /usr/local/bin/run-livesync-cli-e2e
|
||||||
|
|
||||||
CMD ["run-livesync-bench"]
|
CMD ["run-livesync-bench"]
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ services:
|
|||||||
BENCH_PEERS_TIMEOUT: ${BENCH_PEERS_TIMEOUT:-60}
|
BENCH_PEERS_TIMEOUT: ${BENCH_PEERS_TIMEOUT:-60}
|
||||||
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: ${LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS:-60000}
|
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: ${LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS:-60000}
|
||||||
BENCH_LIVESYNC_TEST_TEE: ${BENCH_LIVESYNC_TEST_TEE:-0}
|
BENCH_LIVESYNC_TEST_TEE: ${BENCH_LIVESYNC_TEST_TEE:-0}
|
||||||
CLI_P2P_E2E_TASK: ${CLI_P2P_E2E_TASK:-test:p2p-sync}
|
CLI_E2E_TASK: ${CLI_E2E_TASK:-test:p2p-sync}
|
||||||
RELAY: ${RELAY:-ws://nostr-relay:7777/}
|
RELAY: ${RELAY:-ws://nostr-relay:7777/}
|
||||||
PEERS_TIMEOUT: ${PEERS_TIMEOUT:-20}
|
PEERS_TIMEOUT: ${PEERS_TIMEOUT:-20}
|
||||||
SYNC_TIMEOUT: ${SYNC_TIMEOUT:-60}
|
SYNC_TIMEOUT: ${SYNC_TIMEOUT:-60}
|
||||||
|
|||||||
@@ -11,12 +11,9 @@ case "${BENCH_COMMAND:-cases}" in
|
|||||||
p2p-split-node)
|
p2p-split-node)
|
||||||
exec deno task bench:p2p-split-node
|
exec deno task bench:p2p-split-node
|
||||||
;;
|
;;
|
||||||
cli-p2p-e2e)
|
|
||||||
exec deno task "${CLI_P2P_E2E_TASK:-test:p2p-sync}"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "Unknown BENCH_COMMAND: ${BENCH_COMMAND}" >&2
|
echo "Unknown BENCH_COMMAND: ${BENCH_COMMAND}" >&2
|
||||||
echo "Expected one of: cases, latency-sweep, p2p-split-node, cli-p2p-e2e" >&2
|
echo "Expected one of: cases, latency-sweep, p2p-split-node" >&2
|
||||||
exit 2
|
exit 2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user