forked from OpenZeppelin/openzeppelin-relayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.toml
More file actions
61 lines (54 loc) · 1.9 KB
/
Makefile.toml
File metadata and controls
61 lines (54 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[tasks.rust-docs]
description = "Build Rust Docs"
script = [
"cargo doc --target-dir docs/rust_docs --release --no-deps --quiet --locked",
"bash scripts/rust_docs.sh"
]
[tasks.docker-compose-up]
description = "Run docker compose up according to the user defined settings"
script = [
"chmod +x ./scripts/docker_compose.sh",
"./scripts/docker_compose.sh up"
]
[tasks.docker-compose-down]
description = "Run docker compose down according to the user defined settings"
script = [
"chmod +x ./scripts/docker_compose.sh",
"./scripts/docker_compose.sh down"
]
[tasks.integration-test-local]
description = "Run integration tests against local standalone Anvil"
env = { "TEST_REGISTRY_PATH" = "tests/integration/config/local-standalone/registry.json" }
command = "cargo"
args = ["test", "--features", "integration-tests", "--test", "integration"]
[tasks.integration-test-standalone]
description = "Start Anvil if needed, check relayer, then run integration tests"
script = '''
#!/bin/bash
set -e
# Check if Anvil is running, start if not
if ! docker ps --format '{{.Names}}' | grep -q "^standalone-anvil$"; then
echo "🔧 Anvil not running, starting it..."
./scripts/anvil-local.sh start
echo ""
fi
# Load API_KEY from .env if it exists
if [ -f .env ]; then
export $(grep -v '^#' .env | grep API_KEY | xargs)
fi
# Check if relayer is running (health endpoint)
if ! curl -s -f -H "Authorization: Bearer ${API_KEY}" http://localhost:8080/api/v1/health > /dev/null 2>&1; then
echo "❌ Relayer not running!"
echo ""
echo "Please start the relayer in another terminal:"
echo " cargo run"
echo ""
echo "Then re-run: cargo make integration-test-standalone"
exit 1
fi
echo "✅ Anvil running, relayer healthy. Running tests..."
echo ""
# Run tests
TEST_REGISTRY_PATH=tests/integration/config/local-standalone/registry.json \
cargo test --features integration-tests --test integration
'''