From 9a54a6d1cc100b860949bedad9b07714885370b8 Mon Sep 17 00:00:00 2001 From: Logan Nguyen Date: Mon, 22 Apr 2024 12:57:59 -0400 Subject: [PATCH] test: divided ws-server total acceptancetest into batches Signed-off-by: Logan Nguyen --- .github/workflows/acceptance-public.yml | 24 +++++++++++++++++-- .github/workflows/acceptance.yml | 18 ++++++++++++-- package.json | 6 +++-- .../tests/acceptance/blockNumber.spec.ts | 2 +- .../ws-server/tests/acceptance/call.spec.ts | 2 +- .../tests/acceptance/estimateGas.spec.ts | 3 +-- .../tests/acceptance/gasPrice.spec.ts | 2 +- .../tests/acceptance/getBalance.spec.ts | 2 +- .../tests/acceptance/getBlockByHash.spec.ts | 2 +- .../tests/acceptance/getBlockByNumber.spec.ts | 2 +- .../tests/acceptance/getCode.spec.ts | 2 +- .../tests/acceptance/getLogs.spec.ts | 2 +- .../tests/acceptance/getStorageAt.spec.ts | 2 +- .../acceptance/getTransactionByHash.spec.ts | 2 +- .../acceptance/getTransactionCount.spec.ts | 2 +- .../acceptance/getTransactionReceipt.spec.ts | 2 +- .../acceptance/sendRawTransaction.spec.ts | 2 +- .../tests/acceptance/subscribe.spec.ts | 2 +- .../acceptance/subscribeNewHeads.spec.ts | 2 +- 19 files changed, 58 insertions(+), 23 deletions(-) diff --git a/.github/workflows/acceptance-public.yml b/.github/workflows/acceptance-public.yml index 368db0d035..d7664a53ed 100644 --- a/.github/workflows/acceptance-public.yml +++ b/.github/workflows/acceptance-public.yml @@ -110,11 +110,31 @@ jobs: operator_id: ${{ inputs.operator_id }} operator_key: ${{ inputs.operator_key }} - websocket: + websocket-batch-1: name: Websocket uses: ./.github/workflows/acceptance-workflow.yml with: - testfilter: ws + testfilter: ws_batch1 + test_ws_server: true + envfile: ${{ inputs.network }}Acceptance.env + operator_id: ${{ inputs.operator_id }} + operator_key: ${{ inputs.operator_key }} + + websocket-batch-2: + name: Websocket + uses: ./.github/workflows/acceptance-workflow.yml + with: + testfilter: ws_batch2 + test_ws_server: true + envfile: ${{ inputs.network }}Acceptance.env + operator_id: ${{ inputs.operator_id }} + operator_key: ${{ inputs.operator_key }} + + websocket-batch-3: + name: Websocket + uses: ./.github/workflows/acceptance-workflow.yml + with: + testfilter: ws_batch3 test_ws_server: true envfile: ${{ inputs.network }}Acceptance.env operator_id: ${{ inputs.operator_id }} diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index 22d34dc328..8c9c753d91 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -72,11 +72,25 @@ jobs: with: testfilter: precompile-calls - websocket: + websocket-batch-1: name: Websocket uses: ./.github/workflows/acceptance-workflow.yml with: - testfilter: ws + testfilter: ws_batch1 + test_ws_server: true + + websocket-batch-2: + name: Websocket + uses: ./.github/workflows/acceptance-workflow.yml + with: + testfilter: ws_batch2 + test_ws_server: true + + websocket-batch-3: + name: Websocket + uses: ./.github/workflows/acceptance-workflow.yml + with: + testfilter: ws_batch3 test_ws_server: true cacheservice: diff --git a/package.json b/package.json index 9655781635..d36cba08aa 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,9 @@ "acceptancetest:tokenmanagement": "ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@tokenmanagement' --exit", "acceptancetest:htsprecompilev1": "ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@htsprecompilev1' --exit", "acceptancetest:release": "ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@release' --exit", - "acceptancetest:ws": "ts-mocha packages/ws-server/tests/acceptance/index.spec.ts -g '@web-socket' --exit", + "acceptancetest:ws_batch1": "ts-mocha packages/ws-server/tests/acceptance/index.spec.ts -g '@web-socket-batch-1' --exit", + "acceptancetest:ws_batch2": "ts-mocha packages/ws-server/tests/acceptance/index.spec.ts -g '@web-socket-batch-2' --exit", + "acceptancetest:ws_batch3": "ts-mocha packages/ws-server/tests/acceptance/index.spec.ts -g '@web-socket-batch-3' --exit", "acceptancetest:ws_newheads": "ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@web-socket-newheads' --exit", "acceptancetest:precompile-calls": "ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@precompile-calls' --exit", "acceptancetest:cache-service": "ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@cache-service' --exit", @@ -83,7 +85,7 @@ }, "overrides": { "protobufjs": "^7.2.4", - "semver": "^7.5.3" + "semver": "^7.5.3" }, "lint-staged": { "packages/**/src/**/*.ts": [ diff --git a/packages/ws-server/tests/acceptance/blockNumber.spec.ts b/packages/ws-server/tests/acceptance/blockNumber.spec.ts index 5e8a565546..12ab4ebcbd 100644 --- a/packages/ws-server/tests/acceptance/blockNumber.spec.ts +++ b/packages/ws-server/tests/acceptance/blockNumber.spec.ts @@ -23,7 +23,7 @@ import { expect } from 'chai'; import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; -describe('@release @web-socket eth_blockNumber', async function () { +describe('@release @web-socket-batch-1 eth_blockNumber', async function () { const METHOD_NAME = 'eth_blockNumber'; const INVALID_PARAMS = [ ['hedera', 'hbar'], diff --git a/packages/ws-server/tests/acceptance/call.spec.ts b/packages/ws-server/tests/acceptance/call.spec.ts index 89901b3442..011a4f0b8a 100644 --- a/packages/ws-server/tests/acceptance/call.spec.ts +++ b/packages/ws-server/tests/acceptance/call.spec.ts @@ -26,7 +26,7 @@ import { Utils } from '@hashgraph/json-rpc-server/tests/helpers/utils'; import ERC20MockJson from '@hashgraph/json-rpc-server/tests/contracts/ERC20Mock.json'; import { AliasAccount } from '@hashgraph/json-rpc-server/tests/clients/servicesClient'; -describe('@release @web-socket eth_call', async function () { +describe('@release @web-socket-batch-1 eth_call', async function () { const METHOD_NAME = 'eth_call'; const INVALID_PARAMS = [ ['{}', false, '0x0'], diff --git a/packages/ws-server/tests/acceptance/estimateGas.spec.ts b/packages/ws-server/tests/acceptance/estimateGas.spec.ts index 47885d7a16..bec0e3c579 100644 --- a/packages/ws-server/tests/acceptance/estimateGas.spec.ts +++ b/packages/ws-server/tests/acceptance/estimateGas.spec.ts @@ -21,12 +21,11 @@ // external resources import { expect } from 'chai'; import { Contract, ethers, WebSocketProvider } from 'ethers'; -// import { TransactionReceipt } from '@hashgraph/sdk'; import { WsTestConstant, WsTestHelper } from '../helper'; import basicContractJson from '@hashgraph/json-rpc-server/tests/contracts/Basic.json'; import { AliasAccount } from '@hashgraph/json-rpc-server/tests/clients/servicesClient'; -describe('@release @web-socket eth_estimateGas', async function () { +describe('@release @web-socket-batch-1 eth_estimateGas', async function () { const METHOD_NAME = 'eth_estimateGas'; const PING_CALL_ESTIMATED_GAS = '0x6122'; const BASIC_CONTRACT_PING_CALL_DATA = '0x5c36b186'; diff --git a/packages/ws-server/tests/acceptance/gasPrice.spec.ts b/packages/ws-server/tests/acceptance/gasPrice.spec.ts index 909a919caa..8e1f20d7f3 100644 --- a/packages/ws-server/tests/acceptance/gasPrice.spec.ts +++ b/packages/ws-server/tests/acceptance/gasPrice.spec.ts @@ -23,7 +23,7 @@ import { expect } from 'chai'; import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; -describe('@release @web-socket eth_gasPrice', async function () { +describe('@release @web-socket-batch-1 eth_gasPrice', async function () { const METHOD_NAME = 'eth_gasPrice'; const INVALID_PARAMS = [ ['hedera', 'hbar'], diff --git a/packages/ws-server/tests/acceptance/getBalance.spec.ts b/packages/ws-server/tests/acceptance/getBalance.spec.ts index 9184e5a724..07d64852c8 100644 --- a/packages/ws-server/tests/acceptance/getBalance.spec.ts +++ b/packages/ws-server/tests/acceptance/getBalance.spec.ts @@ -24,7 +24,7 @@ import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; import { AliasAccount } from '@hashgraph/json-rpc-server/tests/clients/servicesClient'; -describe('@release @web-socket eth_getBalance', async function () { +describe('@release @web-socket-batch-1 eth_getBalance', async function () { const METHOD_NAME = 'eth_getBalance'; const INVALID_PARAMS = [ [], diff --git a/packages/ws-server/tests/acceptance/getBlockByHash.spec.ts b/packages/ws-server/tests/acceptance/getBlockByHash.spec.ts index f262ded45f..ca5fa5b5d8 100644 --- a/packages/ws-server/tests/acceptance/getBlockByHash.spec.ts +++ b/packages/ws-server/tests/acceptance/getBlockByHash.spec.ts @@ -23,7 +23,7 @@ import { expect } from 'chai'; import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; -describe('@release @web-socket eth_getBlockByHash', async function () { +describe('@release @web-socket-batch-1 eth_getBlockByHash', async function () { const METHOD_NAME = 'eth_getBlockByHash'; const INVALID_PARAMS = [ [], diff --git a/packages/ws-server/tests/acceptance/getBlockByNumber.spec.ts b/packages/ws-server/tests/acceptance/getBlockByNumber.spec.ts index 13bb7da3e2..ace5c09d85 100644 --- a/packages/ws-server/tests/acceptance/getBlockByNumber.spec.ts +++ b/packages/ws-server/tests/acceptance/getBlockByNumber.spec.ts @@ -23,7 +23,7 @@ import { expect } from 'chai'; import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; -describe('@release @web-socket eth_getBlockByNumber', async function () { +describe('@release @web-socket-batch-1 eth_getBlockByNumber', async function () { const METHOD_NAME = 'eth_getBlockByNumber'; const INVALID_PARAMS = [ [], diff --git a/packages/ws-server/tests/acceptance/getCode.spec.ts b/packages/ws-server/tests/acceptance/getCode.spec.ts index c741bf5cf2..46d49c0a8c 100644 --- a/packages/ws-server/tests/acceptance/getCode.spec.ts +++ b/packages/ws-server/tests/acceptance/getCode.spec.ts @@ -24,7 +24,7 @@ import { WsTestConstant, WsTestHelper } from '../helper'; import { ethers, JsonRpcProvider, WebSocketProvider } from 'ethers'; import basicContractJson from '@hashgraph/json-rpc-server/tests/contracts/Basic.json'; -describe('@release @web-socket eth_getCode', async function () { +describe('@release @web-socket-batch-2 eth_getCode', async function () { const RELAY_URL = `${process.env.RELAY_ENDPOINT}`; const METHOD_NAME = 'eth_getCode'; diff --git a/packages/ws-server/tests/acceptance/getLogs.spec.ts b/packages/ws-server/tests/acceptance/getLogs.spec.ts index 1f3fb0b0b0..744c317ccf 100644 --- a/packages/ws-server/tests/acceptance/getLogs.spec.ts +++ b/packages/ws-server/tests/acceptance/getLogs.spec.ts @@ -24,7 +24,7 @@ import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; import { AliasAccount } from '@hashgraph/json-rpc-server/tests/clients/servicesClient'; -describe('@release @web-socket eth_getLogs', async function () { +describe('@release @web-socket-batch-2 eth_getLogs', async function () { const EXPECTED_VALUE = 7; const METHOD_NAME = 'eth_getLogs'; const INVALID_PARAMS = [ diff --git a/packages/ws-server/tests/acceptance/getStorageAt.spec.ts b/packages/ws-server/tests/acceptance/getStorageAt.spec.ts index 84a3443bcd..c3a402819c 100644 --- a/packages/ws-server/tests/acceptance/getStorageAt.spec.ts +++ b/packages/ws-server/tests/acceptance/getStorageAt.spec.ts @@ -24,7 +24,7 @@ import { ethers, WebSocketProvider } from 'ethers'; import { WsTestConstant, WsTestHelper } from '../helper'; import { AliasAccount } from '@hashgraph/json-rpc-server/tests/clients/servicesClient'; -describe('@release @web-socket eth_getStorageAt', async function () { +describe('@release @web-socket-batch-2 eth_getStorageAt', async function () { const METHOD_NAME = 'eth_getStorageAt'; const EXPECTED_VALUE = 7; const INVALID_PARAMS = [ diff --git a/packages/ws-server/tests/acceptance/getTransactionByHash.spec.ts b/packages/ws-server/tests/acceptance/getTransactionByHash.spec.ts index c123e4cea8..d4e2327b1a 100644 --- a/packages/ws-server/tests/acceptance/getTransactionByHash.spec.ts +++ b/packages/ws-server/tests/acceptance/getTransactionByHash.spec.ts @@ -26,7 +26,7 @@ import { numberTo0x } from '@hashgraph/json-rpc-relay/src/formatters'; import { AliasAccount } from '@hashgraph/json-rpc-server/tests/clients/servicesClient'; import { ONE_TINYBAR_IN_WEI_HEX } from '@hashgraph/json-rpc-relay/tests/lib/eth/eth-config'; -describe('@release @web-socket eth_getTransactionByHash', async function () { +describe('@release @web-socket-batch-2 eth_getTransactionByHash', async function () { const METHOD_NAME = 'eth_getTransactionByHash'; const CHAIN_ID = process.env.CHAIN_ID || '0x12a'; const INVALID_PARAMS = [ diff --git a/packages/ws-server/tests/acceptance/getTransactionCount.spec.ts b/packages/ws-server/tests/acceptance/getTransactionCount.spec.ts index 921852bd61..8ba3774fbe 100644 --- a/packages/ws-server/tests/acceptance/getTransactionCount.spec.ts +++ b/packages/ws-server/tests/acceptance/getTransactionCount.spec.ts @@ -27,7 +27,7 @@ import { Utils } from '@hashgraph/json-rpc-server/tests/helpers/utils'; import Assertions from '@hashgraph/json-rpc-server/tests/helpers/assertions'; import { AliasAccount } from '@hashgraph/json-rpc-server/tests/clients/servicesClient'; -describe('@release @web-socket eth_getTransactionCount', async function () { +describe('@release @web-socket-batch-2 eth_getTransactionCount', async function () { const METHOD_NAME = 'eth_getTransactionCount'; const CHAIN_ID = process.env.CHAIN_ID || '0x12a'; const ONE_TINYBAR = Utils.add0xPrefix(Utils.toHex(ethers.parseUnits('1', 10))); diff --git a/packages/ws-server/tests/acceptance/getTransactionReceipt.spec.ts b/packages/ws-server/tests/acceptance/getTransactionReceipt.spec.ts index c6157b1f4d..a636c918c4 100644 --- a/packages/ws-server/tests/acceptance/getTransactionReceipt.spec.ts +++ b/packages/ws-server/tests/acceptance/getTransactionReceipt.spec.ts @@ -26,7 +26,7 @@ import { numberTo0x } from '@hashgraph/json-rpc-relay/src/formatters'; import { AliasAccount } from '@hashgraph/json-rpc-server/tests/clients/servicesClient'; import { ONE_TINYBAR_IN_WEI_HEX } from '@hashgraph/json-rpc-relay/tests/lib/eth/eth-config'; -describe('@release @web-socket eth_getTransactionReceipt', async function () { +describe('@release @web-socket-batch-2 eth_getTransactionReceipt', async function () { const METHOD_NAME = 'eth_getTransactionReceipt'; const CHAIN_ID = process.env.CHAIN_ID || '0x12a'; const INVALID_PARAMS = [ diff --git a/packages/ws-server/tests/acceptance/sendRawTransaction.spec.ts b/packages/ws-server/tests/acceptance/sendRawTransaction.spec.ts index 47fe9e6581..65a151bcca 100644 --- a/packages/ws-server/tests/acceptance/sendRawTransaction.spec.ts +++ b/packages/ws-server/tests/acceptance/sendRawTransaction.spec.ts @@ -26,7 +26,7 @@ import { numberTo0x } from '@hashgraph/json-rpc-relay/src/formatters'; import { AliasAccount } from '@hashgraph/json-rpc-server/tests/clients/servicesClient'; import { ONE_TINYBAR_IN_WEI_HEX } from '@hashgraph/json-rpc-relay/tests/lib/eth/eth-config'; -describe('@release @web-socket eth_sendRawTransaction', async function () { +describe('@release @web-socket-batch-3 eth_sendRawTransaction', async function () { const METHOD_NAME = 'eth_sendRawTransaction'; const CHAIN_ID = process.env.CHAIN_ID || '0x12a'; const INVALID_PARAMS = [ diff --git a/packages/ws-server/tests/acceptance/subscribe.spec.ts b/packages/ws-server/tests/acceptance/subscribe.spec.ts index 1913a63850..276f39dc62 100644 --- a/packages/ws-server/tests/acceptance/subscribe.spec.ts +++ b/packages/ws-server/tests/acceptance/subscribe.spec.ts @@ -68,7 +68,7 @@ const createLogs = async (contract: ethers.Contract, requestId) => { await new Promise((resolve) => setTimeout(resolve, 2000)); }; -describe('@release @web-socket eth_subscribe', async function () { +describe('@release @web-socket-batch-3 eth_subscribe', async function () { this.timeout(240 * 1000); // 240 seconds const CHAIN_ID = process.env.CHAIN_ID || 0; let server; diff --git a/packages/ws-server/tests/acceptance/subscribeNewHeads.spec.ts b/packages/ws-server/tests/acceptance/subscribeNewHeads.spec.ts index 1c52e1e27f..d02594c8ed 100644 --- a/packages/ws-server/tests/acceptance/subscribeNewHeads.spec.ts +++ b/packages/ws-server/tests/acceptance/subscribeNewHeads.spec.ts @@ -90,7 +90,7 @@ function verifyResponse(response: any, done: Mocha.Done, webSocket: any, include } } -describe('@release @web-socket eth_subscribe newHeads', async function () { +describe('@release @web-socket-batch-3 eth_subscribe newHeads', async function () { this.timeout(240 * 1000); // 240 seconds const accounts: AliasAccount[] = []; const CHAIN_ID = process.env.CHAIN_ID || 0;