Skip to content

Commit 4188953

Browse files
authored
fix(test-suite): run random tests in all PRs and use default parameters for keygen (#1391)
1 parent a89b675 commit 4188953

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.github/workflows/test-suite-e2e-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ jobs:
187187
run: |
188188
./fhevm-cli test delegate-user-decryption
189189
190+
- name: Random operators test (subset)
191+
working-directory: test-suite/fhevm
192+
run: |
193+
./fhevm-cli test random-subset
194+
190195
- name: Show logs on test failure
191196
working-directory: test-suite/fhevm
192197
if: always()

test-suite/fhevm/docker-compose/gateway-sc-docker-compose.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ services:
7272
- type=gha,mode=max
7373
env_file:
7474
- ../env/staging/.env.gateway-sc.local
75+
# Using test parameters (--params-type 1) is currently not possible at it can make the random
76+
# tests fail with a high probability (1/2 chance), so we instead use default parameters (--params-type 0).
77+
# See https://github.com/zama-ai/fhevm-internal/issues/685
7578
command:
76-
- npx hardhat task:triggerKeygen --params-type 1
79+
- npx hardhat task:triggerKeygen --params-type 0
7780
depends_on:
7881
gateway-sc-add-pausers:
7982
condition: service_completed_successfully
@@ -94,8 +97,11 @@ services:
9497
- type=gha,mode=max
9598
env_file:
9699
- ../env/staging/.env.gateway-sc.local
100+
# Using test parameters (--params-type 1) is currently not possible for keygen (see above), and
101+
# CRS parameters must be of the same type as the keygen parameters.
102+
# See https://github.com/zama-ai/fhevm-internal/issues/685
97103
command:
98-
- npx hardhat task:triggerCrsgen --params-type 1 --max-bit-length 2048
104+
- npx hardhat task:triggerCrsgen --params-type 0 --max-bit-length 2048
99105
depends_on:
100106
gateway-sc-trigger-keygen:
101107
condition: service_completed_successfully

test-suite/fhevm/fhevm-cli

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function usage {
5858
echo
5959
echo -e "${BOLD}${LIGHT_BLUE}Commands:${RESET}"
6060
echo -e " ${YELLOW}deploy${RESET} ${CYAN}[--build]${RESET} WIP: Deploy the full fhevm stack (optionally rebuild images)"
61-
echo -e " ${YELLOW}test${RESET} ${CYAN}[TYPE]${RESET} Run tests (input-proof|user-decryption|public-decryption|erc20|debug)"
61+
echo -e " ${YELLOW}test${RESET} ${CYAN}[TYPE]${RESET} Run tests (input-proof|user-decryption|public-decryption|delegate-user-decryption|random|random-subset|operators|erc20|debug)"
6262
echo -e " ${YELLOW}upgrade${RESET} ${CYAN}[SERVICE]${RESET} Upgrade specific service (host|gateway|connector|coprocessor|relayer|test-suite)"
6363
echo -e " ${YELLOW}clean${RESET} Remove all containers and volumes"
6464
echo -e " ${YELLOW}logs${RESET} ${CYAN}[SERVICE]${RESET} View logs for a specific service"
@@ -216,6 +216,10 @@ case $COMMAND in
216216
log_message="${LIGHT_BLUE}${BOLD}[TEST] RANDOM OPERATORS${RESET}"
217217
docker_args+=("-g" "generate and decrypt|generating rand in reverting sub-call|upper bound and decrypt")
218218
;;
219+
random-subset)
220+
log_message="${LIGHT_BLUE}${BOLD}[TEST] RANDOM OPERATORS (SUBSET)${RESET}"
221+
docker_args+=("-g" "64 bits generate and decrypt|generating rand in reverting sub-call|64 bits generate with upper bound and decrypt")
222+
;;
219223
debug)
220224
echo -e "${LIGHT_BLUE}${BOLD}[DEBUG] Starting debug session...${RESET}"
221225
docker exec -it fhevm-test-suite-e2e-debug bash

0 commit comments

Comments
 (0)