diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c2edf926baa..b414162adc1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -962,11 +962,11 @@ jobs: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} - run: ./tools/ci.sh cactus-plugin-ledger-connector-besu: - continue-on-error: true - # needs: - # - build-dev - # - compute_changed_packages - # if: needs.compute_changed_packages.outputs.plugin-ledger-connector-besu-changed == 'true' + continue-on-error: false + needs: + - build-dev + - compute_changed_packages + if: needs.compute_changed_packages.outputs.plugin-ledger-connector-besu-changed == 'true' env: FULL_BUILD_DISABLED: true JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-besu/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts @@ -982,6 +982,9 @@ jobs: node-version: ${{ env.NODEJS_VERSION }} - uses: actions/checkout@v3.5.2 + # - name: Run configure + # run: yarn run configure + - id: yarn-cache name: Restore Yarn Cache uses: actions/cache@v3.3.1 diff --git a/packages/cactus-plugin-ledger-connector-besu/package.json b/packages/cactus-plugin-ledger-connector-besu/package.json index ad12a67e7f0..3e59d1e2960 100644 --- a/packages/cactus-plugin-ledger-connector-besu/package.json +++ b/packages/cactus-plugin-ledger-connector-besu/package.json @@ -78,16 +78,19 @@ "devDependencies": { "@hyperledger/cactus-plugin-keychain-memory": "2.0.0-alpha.2", "@hyperledger/cactus-test-tooling": "2.0.0-alpha.2", + "@types/benchmark": "2.1.5", "@types/body-parser": "1.19.4", "@types/express": "4.17.19", "@types/http-errors": "2.0.4", "@types/uuid": "9.0.6", + "benchmark": "2.1.4", "body-parser": "1.20.2", "key-encoder": "2.0.3", "socket.io": "4.5.4", "uuid": "9.0.1", "web3-core": "1.6.1", - "web3-eth": "1.6.1" + "web3-eth": "1.6.1", + "tsx": "4.7.0" }, "engines": { "node": ">=18", diff --git a/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/benchmark/run-plugin-ledger-connector-besu-benchmark.ts b/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/benchmark/run-plugin-ledger-connector-besu-benchmark.ts index 08f6057e56f..ea132bdc4c2 100644 --- a/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/benchmark/run-plugin-ledger-connector-besu-benchmark.ts +++ b/packages/cactus-plugin-ledger-connector-besu/src/test/typescript/benchmark/run-plugin-ledger-connector-besu-benchmark.ts @@ -48,7 +48,9 @@ test("BEFORE " + testCase, async (t: Test) => { t.end(); }); -const createTest = async (t: Test) => { +const createTestInfrastructure = async (t: { + readonly logLevel: LogLevelDesc; +}) => { const keyEncoder: KeyEncoder = new KeyEncoder("secp256k1"); const keychainIdForSigned = uuidv4(); const keychainIdForUnsigned = uuidv4(); @@ -66,8 +68,8 @@ const createTest = async (t: Test) => { const rpcApiWsHost = await besuTestLedger.getRpcApiWsHost(); const testEthAccount1 = await besuTestLedger.createEthTestAccount(); - const testEthAccount2 = await besuTestLedger.createEthTestAccount(); - const firstHighNetWorthAccount = besuTestLedger.getGenesisAccountPubKey(); + // const testEthAccount2 = await besuTestLedger.createEthTestAccount(); + // const firstHighNetWorthAccount = besuTestLedger.getGenesisAccountPubKey(); // keychainPlugin for signed transactions const { privateKey } = Secp256k1Keys.generateKeyPairsBuffer(); @@ -124,12 +126,12 @@ const createTest = async (t: Test) => { test.onFinish(async () => await Servers.shutdown(server)); const { address, port } = addressInfo; const apiHost = `http://${address}:${port}`; - t.comment( - `Metrics URL: ${apiHost}/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics`, - ); + // t.comment( + // `Metrics URL: ${apiHost}/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-besu/get-prometheus-exporter-metrics`, + // ); - const wsBasePath = apiHost + Constants.SocketIoConnectionPathV1; - t.comment("WS base path: " + wsBasePath); + // const wsBasePath = apiHost + Constants.SocketIoConnectionPathV1; + // t.comment("WS base path: " + wsBasePath); const besuApiClientOptions = new BesuApiClientOptions({ basePath: apiHost }); const apiClient = new BesuApiClient(besuApiClientOptions); @@ -141,6 +143,11 @@ const createTest = async (t: Test) => { await connector.getOrCreateWebServices(); await connector.registerWebServices(expressApp, wsApi); + + return { + httpApi: apiClient, + apiServer: connector, + }; }; const main = async (opts: { readonly argv: Readonly> }) => { @@ -181,7 +188,7 @@ const main = async (opts: { readonly argv: Readonly> }) => { await fse.mkdirp(absoluteOutputDirPath); console.log("%s mkdir -p OK: %s", LOG_TAG, absoluteOutputDirPath); - const { apiServer, httpApi } = await createTest({ logLevel }); + const { apiServer, httpApi } = await createTestInfrastructure({ logLevel }); const minSamples = 100; const suite = new Benchmark.Suite({});