-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrate chopstick tests with CI (#68)
* ci test * ci test works
- Loading branch information
1 parent
54b5814
commit f3abb6e
Showing
4 changed files
with
74 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,60 @@ | ||
version: '3.8' | ||
|
||
services: | ||
relayer: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
target: relayer | ||
node: | ||
container_name: node | ||
image: oven/bun:1 | ||
working_dir: /app | ||
volumes: | ||
- ./src/__tests__/configs/acala.yml:/app/acala.yml | ||
command: | ||
bunx @acala-network/chopsticks@latest -c /app/acala.yml | ||
ports: | ||
- 3111:3111 | ||
# - 3112:3112 | ||
environment: | ||
- KARURA_ETH_RPC=https://eth-rpc-karura-testnet.aca-staging.network | ||
- KARURA_PRIVATE_KEY=efb03e3f4fd8b3d7f9b14de6c6fb95044e2321d6bcb9dfe287ba987920254044 | ||
- 8000:8000 | ||
healthcheck: | ||
# bun image doesn't have wget or curl ... | ||
test: | | ||
bun --eval ' | ||
fetch("http://localhost:8000", { | ||
method: "POST", | ||
headers: { "Content-Type": "application/json" }, | ||
body: JSON.stringify({ id: 1, jsonrpc: "2.0", method: "system_health", params: [] }) | ||
}) | ||
.then(res => res.json()) | ||
.then(data => { | ||
const exitCode = data.result ? 0 : 1; | ||
process.exit(exitCode) | ||
}) | ||
.catch(() => process.exit(1)); | ||
' | ||
interval: 2s | ||
timeout: 5s | ||
retries: 100 | ||
|
||
- KARURA_ETH_RPC=https://eth-rpc-acala-testnet.aca-staging.network | ||
- ACALA_PRIVATE_KEY=efb03e3f4fd8b3d7f9b14de6c6fb95044e2321d6bcb9dfe287ba987920254044 | ||
eth-rpc: | ||
container_name: eth-rpc | ||
image: acala/eth-rpc-adapter:2.8.7 | ||
restart: on-failure | ||
depends_on: | ||
node: | ||
condition: service_healthy | ||
ports: | ||
- 8545:8545 | ||
extra_hosts: | ||
- host.docker.internal:host-gateway | ||
environment: | ||
- ENDPOINT_URL=ws://node:8000 | ||
healthcheck: | ||
test: | | ||
wget -q -O- --post-data='{"id": 1, "jsonrpc": "2.0", "method": "eth_chainId", "params": []}' --header='Content-Type: application/json' http://localhost:8545 || exit 1 | ||
interval: 2s | ||
timeout: 5s | ||
retries: 100 | ||
|
||
- PORT=3111 | ||
- TESTNET_MODE=1 | ||
restart: always | ||
test-stack-ready: | ||
image: alpine:latest | ||
restart: on-failure | ||
depends_on: | ||
eth-rpc: | ||
condition: service_healthy | ||
command: echo "test stack ready 🚀" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters