Skip to content

Commit 832bea7

Browse files
committed
feature: make dkg-end-to-end test use the local docker-compose with
pregenerated keys
1 parent 1389d3d commit 832bea7

3 files changed

Lines changed: 18 additions & 27 deletions

File tree

.github/workflows/integ-tests.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ jobs:
264264
done
265265
266266
- name: Run end-to-end integration tests
267-
run: cargo run --bin integration-tests test --port-range 50057-50061
267+
run: cargo run --bin integration-tests test --port-range 50051-50055
268268

269269
- name: Shutdown stack & print logs
270270
run: |
@@ -465,22 +465,17 @@ jobs:
465465
- name: Install dependencies
466466
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
467467

468-
- name: Create NodeCluster (3 nodes)
469-
run: ./scripts/clear_dkg_keys.sh
470-
471468
- name: Start 5-node stack with network chaos
472469
run: |
473-
if [ "${{ github.event_name }}" = "pull_request" ]; then
474-
bash setup_nodes.sh 5 "trieve/threshold:pr-${{ github.event.pull_request.number }}"
475-
else
476-
bash setup_nodes.sh 5 "trieve/threshold:latest"
477-
fi
470+
# Modify docker-compose.yaml to the correct tag
471+
sed -i "s/trieve\/threshold:latest/trieve\/threshold:pr-${{ github.event.pull_request.number }}/g" docker-compose.yaml
472+
docker compose -f docker-compose.yaml up -d
478473
479474
- name: Wait for gRPC endpoint
480475
run: |
481-
echo "Waiting for node to expose port 50057-50061..."
476+
echo "Waiting for node to expose port 50051-50055..."
482477
for i in {1..30}; do
483-
if nc -z localhost {50057..50061}; then
478+
if nc -z localhost {50051..50055}; then
484479
echo "Port 50057-50061 is open."
485480
break
486481
fi
@@ -489,12 +484,12 @@ jobs:
489484
done
490485
491486
- name: Run end-to-end integration tests with network chaos
492-
run: cargo run --bin integration-tests test --port-range 50057-50061
487+
run: cargo run --bin integration-tests test --port-range 50051-50055
493488

494489
- name: Shutdown stack & print logs
495490
run: |
496-
docker compose -f docker-compose.yaml -f docker-compose.chaos-network.yaml logs --no-color || true
497-
docker compose -f docker-compose.yaml -f docker-compose.chaos-network.yaml down --volumes --remove-orphans || true
491+
docker compose -f docker-compose.yaml logs --no-color || true
492+
docker compose -f docker-compose.yaml down --volumes --remove-orphans || true
498493
499494
end-to-end-deposit-withdrawl-chaos-nodes:
500495
runs-on: blacksmith-16vcpu-ubuntu-2204
@@ -558,7 +553,7 @@ jobs:
558553
done
559554
560555
- name: Run end-to-end integration tests with node chaos
561-
run: cargo run --bin integration-tests test --port-range 50057-50061
556+
run: cargo run --bin integration-tests test --port-range 50051-50055
562557

563558
- name: Shutdown stack & print logs
564559
run: |

docker-compose.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
build:
44
context: .
55
dockerfile: Dockerfile
6-
image: vault-node
6+
image: trieve/threshold
77
environment:
88
- KEY_PASSWORD=supersecret
99
- IS_TESTNET=true
@@ -21,7 +21,7 @@ services:
2121
build:
2222
context: .
2323
dockerfile: Dockerfile
24-
image: vault-node
24+
image: trieve/threshold
2525
environment:
2626
- KEY_PASSWORD=supersecret
2727
- IS_TESTNET=true
@@ -39,7 +39,7 @@ services:
3939
build:
4040
context: .
4141
dockerfile: Dockerfile
42-
image: vault-node
42+
image: trieve/threshold
4343
environment:
4444
- KEY_PASSWORD=supersecret
4545
- IS_TESTNET=true
@@ -57,7 +57,7 @@ services:
5757
build:
5858
context: .
5959
dockerfile: Dockerfile
60-
image: vault-node
60+
image: trieve/threshold
6161
environment:
6262
- KEY_PASSWORD=supersecret
6363
- IS_TESTNET=true
@@ -75,7 +75,7 @@ services:
7575
build:
7676
context: .
7777
dockerfile: Dockerfile
78-
image: vault-node
78+
image: trieve/threshold
7979
environment:
8080
- KEY_PASSWORD=supersecret
8181
- IS_TESTNET=true

setup_nodes.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,10 @@ DOCKER_COMPOSE_FILE_PATH="$BASE_DIR/test_${NUM_NODES}_nodes/$DOCKER_COMPOSE_FILE
165165
echo "Successfully generated '$BASE_DIR/test_${NUM_NODES}_nodes/$DOCKER_COMPOSE_FILE'."
166166

167167
# ------------------- Build Docker Image Once ----------------------------
168-
echo -e "\nBuilding Docker image..."
169-
170-
cd "$BASE_DIR/test_${NUM_NODES}_nodes"
171-
172168
if [ -z "$2" ]; then
169+
echo -e "\nBuilding Docker image..."
170+
cd "$BASE_DIR/test_${NUM_NODES}_nodes"
171+
173172
docker build -t threshold-node -f ../../Dockerfile ../..
174173
fi
175174

@@ -178,7 +177,4 @@ echo -e "\nStarting Docker Compose for $NUM_NODES nodes..."
178177

179178
docker compose -f "$DOCKER_COMPOSE_FILE" up -d
180179

181-
# Wait 10 seconds for dkg to complete
182-
sleep 20s
183-
184180
echo "All nodes started."

0 commit comments

Comments
 (0)