feat: add rule dispatch, cross-plugin API, and Docker integration test
Wire rule registry and authenticated callbacks into both client and server runtimes; expose __yonexusClient / __yonexusServer on globalThis for cross-plugin communication. Add Docker-based integration test with server-test-plugin (test_ping echo) and client-test-plugin (test_pong receiver), plus docker-compose setup. Fix transport race condition where a stale _connections entry caused promoteToAuthenticated to silently fail. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
46
tests/docker/docker-compose.yml
Normal file
46
tests/docker/docker-compose.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
services:
|
||||
yonexus-server:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: tests/docker/server/Dockerfile
|
||||
environment:
|
||||
# Identifier the client will use — must match IDENTIFIER on the client side
|
||||
CLIENT_IDENTIFIER: test-client
|
||||
# Required: Discord bot token and admin user ID for pairing notifications
|
||||
NOTIFY_BOT_TOKEN: ${NOTIFY_BOT_TOKEN}
|
||||
ADMIN_USER_ID: ${ADMIN_USER_ID}
|
||||
# Optional: override the publicWsUrl advertised to clients
|
||||
# PUBLIC_WS_URL: ws://yonexus-server:8787
|
||||
networks:
|
||||
- yonexus-net
|
||||
healthcheck:
|
||||
# Wait until the Yonexus WebSocket port is accepting connections
|
||||
test:
|
||||
- CMD
|
||||
- node
|
||||
- -e
|
||||
- "require('net').createConnection({port:8787,host:'127.0.0.1'}).on('connect',()=>process.exit(0)).on('error',()=>process.exit(1))"
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 12
|
||||
start_period: 15s
|
||||
|
||||
yonexus-client:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: tests/docker/client/Dockerfile
|
||||
environment:
|
||||
# Must match CLIENT_IDENTIFIER on the server side
|
||||
IDENTIFIER: test-client
|
||||
NOTIFY_BOT_TOKEN: ${NOTIFY_BOT_TOKEN}
|
||||
ADMIN_USER_ID: ${ADMIN_USER_ID}
|
||||
YONEXUS_SERVER_URL: ws://yonexus-server:8787
|
||||
networks:
|
||||
- yonexus-net
|
||||
depends_on:
|
||||
yonexus-server:
|
||||
condition: service_healthy
|
||||
|
||||
networks:
|
||||
yonexus-net:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user