From c4c682cfa8af33663f824b51e9c64082c7ac7e2c Mon Sep 17 00:00:00 2001
From: fwaszkiewicz <fabianwaszkiewicz09@gmail.com>
Date: Wed, 29 Jan 2025 13:41:54 +0100
Subject: [PATCH 1/2] Add matrix to CI for multiple workers tests execution

---
 .gitlab-ci.yml  | 11 +++++++++++
 ts/package.json |  4 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 83a95c648..217e7e482 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -216,6 +216,17 @@ test_wax_wasm:
       artifacts: true
   tags:
     - public-runner-docker
+  parallel:
+    matrix:
+      - TEST_GROUPS: [
+        --project=wax_testsuite,
+        --project=healthchecker_tests,
+        --project=wax_utils --project=wax_non_encrypted_operations --project=wax_mock_tests --project=wax_encrypted_operations --project=wax_custom_chain_online_tx --project=wax_testsuite_custom_chain_options,
+        --project=wax_regression_tests --project=wax_operation_factories --project=wax_testsuite_protocol_benchmarks,
+      ]
+  script:
+    - cd ts
+    - npm run test -- $TEST_GROUPS
 
 test_wax_wasm_proto_pattern:
   extends: .npm_process_built_package_tarball
diff --git a/ts/package.json b/ts/package.json
index 4c82a9340..5ffd34bd0 100644
--- a/ts/package.json
+++ b/ts/package.json
@@ -14,8 +14,8 @@
     "postbuild": "rollup -c && size-limit",
     "build:test": "tsc --project wasm/configs/tsconfig.tests.json",
     "pretest": "playwright install chromium",
-    "test": "unset CI && playwright test --workers 4 --max-failures 1 --project=wax_testsuite --project=healthchecker_tests --project=wax_testsuite_custom_chain_options --project=wax_regression_tests --project=wax_operation_factories --project=wax_encrypted_operations --project=wax_non_encrypted_operations --project=wax_utils --project=wax_custom_chain_online_tx --project=wax_mock_tests",
-    "benchmark": "unset CI && playwright test --workers 1 --max-failures 1 --project=wax_testsuite_protocol_benchmarks",
+    "test": "unset CI && playwright test --workers 4 --max-failures 1",
+    "benchmark": "unset CI && playwright test --workers 4 --max-failures 1 --project=wax_testsuite_protocol_benchmarks",
     "examples": "run-s examples:*",
     "examples:html": "cd ../examples/ts/html && pnpm install && pnpm run test && cd ../../../ts",
     "examples:nextjs-app": "cd ../examples/ts/nextjs-app && pnpm install && pnpm run build && cd ../../../ts",
-- 
GitLab


From ae1e26e3609f3e7a717bc7c07132918541b84c43 Mon Sep 17 00:00:00 2001
From: Bartek Wrona <wrona@syncad.com>
Date: Thu, 30 Jan 2025 18:06:07 +0100
Subject: [PATCH 2/2] WaxModule should be imported from bundled code to
 correctly load wasm code

---
 ts/wasm/__tests__/detailed/protocol_benchmarks.ts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ts/wasm/__tests__/detailed/protocol_benchmarks.ts b/ts/wasm/__tests__/detailed/protocol_benchmarks.ts
index 4994c93d1..9594da857 100644
--- a/ts/wasm/__tests__/detailed/protocol_benchmarks.ts
+++ b/ts/wasm/__tests__/detailed/protocol_benchmarks.ts
@@ -2,7 +2,9 @@ import fs from 'node:fs';
 import path, { dirname } from 'node:path';
 import { fileURLToPath } from 'node:url';
 
-import WaxModule, { protocol } from '../../lib/build_wasm/wax.node.js';
+import WaxModule from '../../dist/bundle/wax.node.js';
+import type {protocol} from '../../lib/build_wasm/wax.node.js';
+
 import { test } from '../assets/jest-helper';
 import { numToHighLow, specificBenchmarkTransaction, vote_operation } from "../assets/data.protocol";
 import type { IHiveChainInterface } from '../../dist/bundle';
-- 
GitLab