Skip to content

Commit 4cd2507

Browse files
committed
chore(test-suite): update test-suite and add workflows
1 parent b493934 commit 4cd2507

File tree

7 files changed

+230
-24
lines changed

7 files changed

+230
-24
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Docker - Fhevm Test Suite E2E"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
release:
9+
types:
10+
- published
11+
12+
concurrency:
13+
group: test-suite-e2e-${{ github.ref }}
14+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
15+
16+
jobs:
17+
check-changes:
18+
permissions:
19+
actions: 'read'
20+
contents: 'read'
21+
pull-requests: 'read'
22+
runs-on: ubuntu-latest
23+
outputs:
24+
changes-e2e-docker: ${{ steps.filter.outputs.e2e-docker }}
25+
steps:
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
28+
id: filter
29+
with:
30+
filters: |
31+
e2e-docker:
32+
- '.github/workflows/test-suite-docker-build.yml'
33+
- 'test-suite/e2e/**'
34+
docker-e2e-image:
35+
needs: check-changes
36+
if: ${{ needs.check-changes.outputs.changes-e2e-docker == 'true' || github.event_name == 'release' }}
37+
name: Docker - fhevm E2E Image
38+
uses: zama-ai/ci-templates/.github/workflows/docker_common.yml@44333c96991d6747e0bef6a3308bfd98b20390f8 # main
39+
secrets:
40+
GHCR_ACTION_TOKEN: ${{ secrets.BLOCKCHAIN_ACTIONS_TOKEN }}
41+
GRAVITON_BUILDER_SSH_PRIVATE_KEY: ${{ secrets.GRAVITON_BUILDER_SSH_PRIVATE_KEY }}
42+
permissions:
43+
contents: "read"
44+
id-token: "write"
45+
packages: "write"
46+
with:
47+
working-directory: "test-suite"
48+
docker-context: "test-suite"
49+
push_image: true
50+
image-name: "fhevm/test-suite/e2e"
51+
docker-file: "e2e/Dockerfile"
52+
arm-build: true
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
name: Fhevm Test Suite E2E Tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
core_version:
7+
description: "KMS Core Version"
8+
required: true
9+
default: ""
10+
type: string
11+
connector_version:
12+
description: "Connector Version"
13+
required: true
14+
default: ""
15+
type: string
16+
coprocessor_version:
17+
description: "Coprocessor Image Version"
18+
required: true
19+
default: ""
20+
type: string
21+
db_migration_version:
22+
description: "Coprocessor DB Migration Image Version"
23+
required: true
24+
default: ""
25+
type: string
26+
host_version:
27+
description: "Host Image Version"
28+
required: false
29+
default: ""
30+
type: string
31+
gateway_version:
32+
description: "Gateway Image Version"
33+
required: false
34+
default: ""
35+
type: string
36+
relayer_version:
37+
description: "Relayer Image Version"
38+
required: true
39+
default: ""
40+
type: string
41+
test_suite_version:
42+
description: "Test Suite E2E Image Version"
43+
required: true
44+
default: ""
45+
type: string
46+
pull_request:
47+
48+
concurrency:
49+
group: ${{ github.workflow }}-${{ github.ref }}
50+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
51+
52+
jobs:
53+
check-changes:
54+
permissions:
55+
actions: 'read'
56+
contents: 'read'
57+
pull-requests: 'read'
58+
runs-on: ubuntu-latest
59+
outputs:
60+
changes-fhevm: ${{ steps.filter.outputs.fhevm }}
61+
steps:
62+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
63+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
64+
id: filter
65+
with:
66+
filters: |
67+
fhevm:
68+
- 'test-suite/fhevm/**'
69+
fhevm-e2e-test:
70+
needs: check-changes
71+
if: ${{ needs.check-changes.outputs.changes-fhevm == 'true' || github.event_name == 'release' }}
72+
permissions:
73+
contents: "read"
74+
id-token: "write"
75+
packages: "read"
76+
77+
runs-on: large_ubuntu_32
78+
steps:
79+
- name: Checkout code
80+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
81+
82+
- name: Setup Docker
83+
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
84+
85+
- name: Login to GitHub Container Registry
86+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
87+
with:
88+
registry: ghcr.io
89+
username: ${{ github.actor }}
90+
password: ${{ secrets.GHCR_READ_TOKEN }}
91+
92+
- name: Deploy fhevm Stack
93+
working-directory: test-suite/fhevm
94+
env:
95+
CORE_VERSION: ${{ inputs.core_version }}
96+
CONNECTOR_VERSION: ${{ inputs.connector_version }}
97+
COPROCESSOR_VERSION: ${{ inputs.coprocessor_version }}
98+
DB_MIGRATION_VERSION: ${{ inputs.db_migration_version }}
99+
HOST_VERSION: ${{ inputs.host_version }}
100+
GATEWAY_VERSION: ${{ inputs.gateway_version }}
101+
RELAYER_VERSION: ${{ inputs.relayer_version }}
102+
TEST_SUITE_VERSION: ${{ inputs.test_suite_version }}
103+
run: |
104+
./fhevm-cli deploy
105+
106+
- name: Input proof test (uint64)
107+
working-directory: test-suite/fhevm
108+
run: |
109+
./fhevm-cli test input-proof
110+
111+
- name: Public Decryption test
112+
working-directory: test-suite/fhevm
113+
run: |
114+
./fhevm-cli test public-decryption
115+
116+
- name: User Decryption test
117+
working-directory: test-suite/fhevm
118+
run: |
119+
./fhevm-cli test user-decryption
120+
121+
- name: ERC20 test
122+
working-directory: test-suite/fhevm
123+
run: |
124+
./fhevm-cli test erc20
125+
126+
- name: Public Decryption HTTP endpoint test (ebool)
127+
working-directory: test-suite/fhevm
128+
run: |
129+
./fhevm-cli test public-decrypt-http-ebool
130+
131+
- name: Public Decryption HTTP endpoint test (mixed)
132+
working-directory: test-suite/fhevm
133+
run: |
134+
./fhevm-cli test public-decrypt-http-mixed
135+
136+
- name: Show logs on test failure
137+
working-directory: test-suite/fhevm
138+
if: always()
139+
run: |
140+
echo "::group::Relayer Logs"
141+
./fhevm-cli logs relayer
142+
echo "::endgroup::"
143+
echo "::group::SNS Worker Logs"
144+
./fhevm-cli logs sns-worker | grep -v "Selected 0 rows to process"
145+
echo "::endgroup::"
146+
echo "::group::Transaction Sender Logs (filtered)"
147+
./fhevm-cli logs transaction-sender | grep -v "Selected 0 rows to process"
148+
echo "::endgroup::"
149+
150+
- name: Cleanup
151+
working-directory: test-suite/fhevm
152+
if: always()
153+
run: |
154+
./fhevm-cli clean
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
services:
2+
3+
test-suite-e2e-debug:
4+
container_name: fhevm-test-suite-e2e-debug
5+
image: ghcr.io/zama-ai/fhevm/test-suite/e2e:${TEST_SUITE_VERSION}
6+
build:
7+
context: ../..
8+
dockerfile: e2e/Dockerfile
9+
env_file:
10+
- ../env/staging/.env.test-suite.local
11+
command:
12+
- tail -f /dev/null

test-suite/fhevm/docker-compose/tests-docker-compose.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.
File renamed without changes.

test-suite/fhevm/fhevm-cli

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export DB_MIGRATION_VERSION=${DB_MIGRATION_VERSION:-"v0.7.0-rc8"}
2424
export HOST_VERSION=${HOST_VERSION:-"31c51c3"}
2525
export GATEWAY_VERSION=${GATEWAY_VERSION:-"5d13e72"}
2626
export RELAYER_VERSION=${RELAYER_VERSION:-"v0.1.0-rc8"}
27-
export TESTS_VERSION=${TESTS_VERSION:-"0d61373"}
27+
export TEST_SUITE_VERSION=${TEST_SUITE_VERSION:-"0d61373"}
2828

2929
function print_logo() {
3030
echo -e "${LIGHT_BLUE}"
@@ -44,7 +44,7 @@ function usage {
4444
echo -e "${BOLD}${LIGHT_BLUE}Commands:${RESET}"
4545
echo -e " ${YELLOW}deploy${RESET} Deploy the full fhevm stack"
4646
echo -e " ${YELLOW}test${RESET} ${CYAN}[TYPE]${RESET} Run tests (input-proof|user-decryption|public-decryption|erc20|debug)"
47-
echo -e " ${YELLOW}upgrade${RESET} ${CYAN}[SERVICE]${RESET} Upgrade specific service (host|gateway|connector|coprocessor|relayer|tests)"
47+
echo -e " ${YELLOW}upgrade${RESET} ${CYAN}[SERVICE]${RESET} Upgrade specific service (host|gateway|connector|coprocessor|relayer|test-suite)"
4848
echo -e " ${YELLOW}clean${RESET} Remove all containers and volumes"
4949
echo -e " ${YELLOW}logs${RESET} ${CYAN}[SERVICE]${RESET} View logs for a specific service"
5050
echo -e " ${YELLOW}help${RESET} Display this help message"
@@ -173,7 +173,7 @@ case $COMMAND in
173173
;;
174174
debug)
175175
echo -e "${LIGHT_BLUE}${BOLD}[DEBUG] Starting debug session...${RESET}"
176-
docker exec -it fhevm-tests-e2e-debug bash
176+
docker exec -it fhevm-test-suite-e2e-debug bash
177177
;;
178178
*)
179179
echo -e "${RED}[ERROR]${RESET} ${BOLD}Unknown test type: $TEST_TYPE${RESET}"
@@ -184,7 +184,7 @@ case $COMMAND in
184184
fi
185185
if [ "$TEST_TYPE" != "debug" ]; then
186186
echo -e "${log_message}"
187-
docker exec fhevm-tests-e2e-debug "${docker_args[@]}"
187+
docker exec fhevm-test-suite-e2e-debug "${docker_args[@]}"
188188
fi
189189
;;
190190

@@ -196,7 +196,7 @@ case $COMMAND in
196196
upgrade)
197197
print_logo
198198
SERVICE=$1
199-
if [[ ! $SERVICE =~ ^(minio|core|gateway|host|connector|coprocessor|relayer|tests)$ ]]; then
199+
if [[ ! $SERVICE =~ ^(minio|core|gateway|host|connector|coprocessor|relayer|test-suite)$ ]]; then
200200
echo -e "${RED}[ERROR]${RESET} ${BOLD}Unknown service: $SERVICE${RESET}"
201201
usage
202202
exit 1

test-suite/fhevm/scripts/deploy-fhevm-stack.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ prepare_local_config_relayer() {
112112
prepare_all_env_files() {
113113
log_info "Preparing all local environment files..."
114114

115-
local components=("minio" "core" "gateway" "host" "connector" "coprocessor" "relayer" "tests")
115+
local components=("minio" "core" "gateway" "host" "connector" "coprocessor" "relayer" "test-suite")
116116

117117
for component in "${components[@]}"; do
118118
prepare_local_env_file "$component" > /dev/null
@@ -198,16 +198,16 @@ cleanup "$@"
198198
prepare_all_env_files
199199
prepare_local_config_relayer
200200

201-
log_info "Deploying FHEVM stack..."
201+
log_info "Deploying FHEVM Stack..."
202202
log_info "Using component versions:"
203-
log_info " CORE: ${CORE_VERSION}"
204-
log_info " CONNECTOR: ${CONNECTOR_VERSION}"
203+
log_info " KMS CORE:${CORE_VERSION}"
204+
log_info " KMS CONNECTOR: ${CONNECTOR_VERSION}"
205205
log_info " COPROCESSOR: ${COPROCESSOR_VERSION}"
206206
log_info " DB MIGRATION: ${DB_MIGRATION_VERSION}"
207207
log_info " GATEWAY: ${GATEWAY_VERSION}"
208208
log_info " HOST: ${HOST_VERSION}"
209209
log_info " RELAYER: ${RELAYER_VERSION}"
210-
log_info " TESTS: ${TESTS_VERSION}"
210+
log_info " TEST SUITE: ${TEST_SUITE_VERSION}"
211211

212212
run_compose "minio" "MinIO Services" \
213213
"${PROJECT}-minio:running" \
@@ -247,7 +247,7 @@ run_compose "coprocessor" "Coprocessor Services" \
247247
run_compose "relayer" "Relayer Services" \
248248
"${PROJECT}-relayer:running"
249249

250-
run_compose "tests" "E2E Tests" \
251-
"${PROJECT}-tests-e2e-debug:running"
250+
run_compose "test-suite" "Test Suite E2E Tests" \
251+
"${PROJECT}-test-suite-e2e-debug:running"
252252

253253
log_info "All services started successfully!"

0 commit comments

Comments
 (0)