mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-09 16:00:09 +00:00
Move CLI E2E runner into CLI tests
This commit is contained in:
parent
4d2326d0de
commit
8fec425d32
5 changed files with 21 additions and 9 deletions
5
.github/workflows/cli-deno-tests.yml
vendored
5
.github/workflows/cli-deno-tests.yml
vendored
|
|
@ -178,8 +178,7 @@ jobs:
|
|||
|
||||
- name: Run Compose CLI P2P E2E
|
||||
env:
|
||||
BENCH_COMMAND: cli-p2p-e2e
|
||||
CLI_P2P_E2E_TASK: test:p2p-sync
|
||||
CLI_E2E_TASK: test:p2p-sync
|
||||
RELAY: ws://nostr-relay:7777/
|
||||
PEERS_TIMEOUT: '20'
|
||||
SYNC_TIMEOUT: '60'
|
||||
|
|
@ -188,7 +187,7 @@ jobs:
|
|||
LIVESYNC_P2P_PEERS_RETRY: '1'
|
||||
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: '60000'
|
||||
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
|
||||
if: failure()
|
||||
|
|
|
|||
15
src/apps/cli/testdeno/run-cli-e2e.sh
Normal file
15
src/apps/cli/testdeno/run-cli-e2e.sh
Normal file
|
|
@ -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
|
||||
|
||||
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"]
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ services:
|
|||
BENCH_PEERS_TIMEOUT: ${BENCH_PEERS_TIMEOUT:-60}
|
||||
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: ${LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS:-60000}
|
||||
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/}
|
||||
PEERS_TIMEOUT: ${PEERS_TIMEOUT:-20}
|
||||
SYNC_TIMEOUT: ${SYNC_TIMEOUT:-60}
|
||||
|
|
|
|||
|
|
@ -11,12 +11,9 @@ case "${BENCH_COMMAND:-cases}" in
|
|||
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 "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
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue