From 6707e01f1b595ac1c2f0577b20182b28a88d0327 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 5 Dec 2024 15:05:40 -0300 Subject: [PATCH 01/43] chore: add more memory to node image for circleci --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index d5fd8e768..3b66ff262 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,8 @@ references: image_name: &image_name 'cimg/python:3.7' node_image: &node_image image: cimg/node:18.18 + environment: + NODE_OPTIONS: '--max-old-space-size=4096' ipfs_image: &ipfs_image image: requestnetwork/request-ipfs:v0.13.0 ganache_image: &ganache_image From 07ebaf9ff5be939e6591dbcf83105a48543e9343 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 5 Dec 2024 15:06:27 -0300 Subject: [PATCH 02/43] test: change trigger to run next release in the current branch --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b66ff262..d225404ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -649,7 +649,7 @@ workflows: filters: branches: only: - - master + - fix/next-release nightly: triggers: From d122efa154346219bbeadb43995783a7e3259295 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 5 Dec 2024 15:15:56 -0300 Subject: [PATCH 03/43] fix: ci trigger --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d225404ee..dc27646ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -649,7 +649,7 @@ workflows: filters: branches: only: - - fix/next-release + - 'fix/next-release' nightly: triggers: From 4f5eb7e1d80d36859b59cecc0e64beb58428f3db Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 5 Dec 2024 15:35:50 -0300 Subject: [PATCH 04/43] chore: revert test --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc27646ff..3b66ff262 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -649,7 +649,7 @@ workflows: filters: branches: only: - - 'fix/next-release' + - master nightly: triggers: From b3fcbdea3e65569bf1067e766d0e066803e1960a Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 5 Dec 2024 16:25:56 -0300 Subject: [PATCH 05/43] chore: remove --canary from next release --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b66ff262..95fdaa1c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -536,7 +536,6 @@ jobs: --conventional-commits \ --conventional-prerelease \ --exact \ - --canary \ --no-git-tag-version \ --no-push \ --preid next \ From 8c5a2435921f8e4d5fd598ead445e7c8925ba64e Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 5 Dec 2024 23:13:00 -0300 Subject: [PATCH 06/43] fix: improve ci --- .circleci/config.yml | 468 ++++--------------------------------------- 1 file changed, 41 insertions(+), 427 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 95fdaa1c9..a091ec3b7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -116,292 +116,68 @@ jobs: - run: name: 'lint package.json files' command: 'yarn run packageJsonLint' - test-request-client: + test: docker: - *node_image + - *ipfs_image - *ganache_image + - *postgres_image + - *graph_image + resource_class: large working_directory: *working_directory steps: - attach_workspace: at: *working_directory - run: - name: 'Build request-client.js' - command: 'yarn workspace @requestnetwork/request-client.js run build:commonjs' - - run: - name: 'Deploy test contracts from smart-contracts' + name: 'Deploy test contract from smart-contracts' command: 'yarn workspace @requestnetwork/smart-contracts run deploy' + - run: *step_graph_deploy - run: - name: 'Test request-client.js' - command: 'yarn workspace @requestnetwork/request-client.js run test --ci --maxWorkers=1' - - store_test_results: - path: packages/request-client.js/reports/ - test-data-access: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build data-access' - command: 'yarn workspace @requestnetwork/data-access run build' - - run: - name: 'Test data-access' - command: 'yarn workspace @requestnetwork/data-access run test --ci --maxWorkers=1' - - store_test_results: - path: packages/data-access/reports/ - test-data-format: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build data-format' - command: 'yarn workspace @requestnetwork/data-format run build' + name: 'Start request-node' + command: 'yarn start:request-node' + background: true + - run: *step_wait_for_node - run: - name: 'Test data-format' - command: 'yarn workspace @requestnetwork/data-format run test --ci --maxWorkers=1' + name: 'Test all' + command: 'yarn test' - store_test_results: - path: packages/data-format/reports/ - test-transaction-manager: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build transaction-manager' - command: 'yarn workspace @requestnetwork/transaction-manager run build' - - run: - name: 'Test transaction-manager' - command: 'yarn workspace @requestnetwork/transaction-manager run test --ci --maxWorkers=1' + path: packages/integration-test/reports/ - store_test_results: - path: packages/transaction-manager/reports/ - test-ethereum-storage: - docker: - - *node_image - - *ipfs_image - - *ganache_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build ethereum-storage' - command: 'yarn workspace @requestnetwork/ethereum-storage run build' - - run: - name: 'Deploy contracs smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' - - run: - name: 'Test ethereum-storage' - command: 'yarn workspace @requestnetwork/ethereum-storage run test --ci --maxWorkers=1' + path: packages/lit-protocol-cipher/reports/ - store_test_results: - path: packages/ethereum-storage/reports/ - test-smart-contracts: - docker: - - *node_image - - *ganache_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Deploy contracs smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' - - run: - name: 'Lint smart contracts smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run lint:sol:check' - - run: - name: 'Test smart contracts smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run test' - - run: - name: 'Test smart contracts utilities' - command: 'yarn workspace @requestnetwork/smart-contracts run test:lib --ci --maxWorkers=1' - test-request-logic: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build request-logic' - command: 'yarn workspace @requestnetwork/request-logic run build' - - run: - name: 'Test request-logic' - command: 'yarn workspace @requestnetwork/request-logic run test --ci --maxWorkers=1' + path: packages/request-client.js/reports/ - store_test_results: path: packages/request-logic/reports/ - test-advanced-logic: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build advanced-logic' - command: 'yarn workspace @requestnetwork/advanced-logic run build' - - run: - name: 'Test advanced-logic' - command: 'yarn workspace @requestnetwork/advanced-logic run test --ci --maxWorkers=1' - - store_test_results: - path: packages/advanced-logic/reports/ - test-request-node: - docker: - - *node_image - - *ipfs_image - - *ganache_image - - *postgres_image - - *graph_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build request-node' - command: 'yarn workspace @requestnetwork/request-node run build' - - run: - name: 'Deploy test contract from smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' - - run: *step_graph_deploy - - run: - name: 'Test request-node' - command: 'yarn workspace @requestnetwork/request-node run test --ci' - store_test_results: path: packages/request-node/reports/ - test-utils: - docker: - - *node_image - - *ganache_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Test utils' - command: 'yarn workspace @requestnetwork/utils run test --ci --maxWorkers=1' - store_test_results: - path: packages/utils/reports/ - test-currency: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Test currency' - command: 'yarn workspace @requestnetwork/currency run test --ci --maxWorkers=1' + path: packages/smart-contracts/reports/ - store_test_results: - path: packages/currency/reports/ - test-epk-signature: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build epk-signature' - command: 'yarn workspace @requestnetwork/epk-signature run build' - - run: - name: 'Test epk-signature' - command: 'yarn workspace @requestnetwork/epk-signature run test --ci --maxWorkers=1' + path: packages/transaction-manager/reports/ - store_test_results: path: packages/epk-signature/reports/ - test-epk-cipher: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build epk-cipher' - command: 'yarn workspace @requestnetwork/epk-cipher run build' - - run: - name: 'Test epk-cipher' - command: 'yarn workspace @requestnetwork/epk-cipher run test --ci --maxWorkers=1' - store_test_results: - path: packages/epk-cipher/reports/ - test-lit-protocol-cipher: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build lit-protocol-cipher' - command: 'yarn workspace @requestnetwork/lit-protocol-cipher run build' - - run: - name: 'Test lit-protocol-cipher' - command: 'yarn workspace @requestnetwork/lit-protocol-cipher run test --ci --maxWorkers=1' + path: packages/web3-signature/reports/ - store_test_results: - path: packages/lit-protocol-cipher/reports/ - test-epk-decryption: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build epk-decryption' - command: 'yarn workspace @requestnetwork/epk-decryption run build' - - run: - name: 'Test epk-decryption' - command: 'yarn workspace @requestnetwork/epk-decryption run test --ci --maxWorkers=1' + path: packages/payment-detection/reports/ + - store_test_results: + path: packages/payment-processor/reports/ + - store_test_results: + path: packages/advanced-logic/reports/ + - store_test_results: + path: packages/data-access/reports/ + - store_test_results: + path: packages/ethereum-storage/reports/ - store_test_results: path: packages/epk-decryption/reports/ - test-web3-signature: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build web3-signature' - command: 'yarn workspace @requestnetwork/web3-signature run build' - - run: - name: 'Test web3-signature' - command: 'yarn workspace @requestnetwork/web3-signature run test --ci --maxWorkers=1' - store_test_results: - path: packages/web3-signature/reports/ - test-integration-test: - docker: - - *node_image - - *ipfs_image - - *ganache_image - - *postgres_image - - *graph_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build integration-test' - command: 'yarn workspace @requestnetwork/integration-test run build' - - run: - name: 'Deploy test contract from smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' - - run: *step_graph_deploy - - run: - name: 'Start request-node' - command: 'yarn workspace @requestnetwork/request-node run start' - background: true - - run: *step_wait_for_node - - run: - name: 'Test integration-test (node)' - command: 'yarn workspace @requestnetwork/integration-test run test:node --ci --maxWorkers=1' - - run: - name: 'Test integration-test (layers)' - command: 'yarn workspace @requestnetwork/integration-test run test:layers --ci --maxWorkers=1' + path: packages/thegraph-data-access/reports/ + - store_test_results: + path: packages/currency/reports/ + - store_test_results: + path: packages/utils/reports/ + - store_test_results: + path: packages/multi-format/reports/ test-usage-examples: docker: - *node_image @@ -425,88 +201,6 @@ jobs: - run: name: 'Build toolbox' command: 'yarn workspace @requestnetwork/toolbox run build' - test-multi-format: - docker: - - *node_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build multi-format' - command: 'yarn workspace @requestnetwork/multi-format run build' - - run: - name: 'Test multi-format' - command: 'yarn workspace @requestnetwork/multi-format run test --ci --maxWorkers=1' - - store_test_results: - path: packages/multi-format/reports/ - test-payment-detection: - docker: - - *node_image - - *ganache_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build payment-detection' - command: 'yarn workspace @requestnetwork/payment-detection run build' - - run: - name: 'Deploy test contracts from smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' - - run: - name: 'Test payment-detection' - command: 'yarn workspace @requestnetwork/payment-detection run test --ci' - - store_test_results: - path: packages/payment-detection/reports/ - test-payment-processor: - docker: - - *node_image - - *ganache_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build payment-processor' - command: 'yarn workspace @requestnetwork/payment-processor run build' - - run: - name: 'Deploy test contracts from smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' - - run: - name: 'Test payment-processor' - command: 'yarn workspace @requestnetwork/payment-processor run test --ci' - - store_test_results: - path: packages/payment-processor/reports/ - test-nightly: - docker: - - *node_image - - *ipfs_image - - *ganache_image - - *postgres_image - - *graph_image - working_directory: *working_directory - steps: - - attach_workspace: - at: *working_directory - - run: - name: 'Build integration-test' - command: 'yarn workspace @requestnetwork/integration-test run build' - - run: - name: 'Deploy test contract from smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' - - run: *step_graph_deploy - - run: - name: 'Start request-node' - command: 'yarn workspace @requestnetwork/request-node run start' - background: true - - run: *step_wait_for_node - - run: - name: 'Test integration-test (erc20)' - command: 'yarn workspace @requestnetwork/integration-test run test:erc20 --ci --maxWorkers=1' - - run: - name: 'Test integration-test (btc)' - command: 'yarn workspace @requestnetwork/integration-test run test:btc --ci --maxWorkers=1' # Release a next version package everytime we merge to master next-release: @@ -519,11 +213,6 @@ jobs: - run: name: 'Allow github ssh host' command: mkdir ~/.ssh; echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts - # this build step shouldn't be necessary because publishing already builds, - # but without it, some packages like epk-signature are missing the dist folder. - - run: - name: 'Build all' - command: 'yarn build' - run: name: 'Authenticate with registry' command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc @@ -552,56 +241,7 @@ workflows: - lint: requires: - build - # Test - - test-request-client: - requires: - - build - - test-transaction-manager: - requires: - - build - - test-data-access: - requires: - - build - - test-data-format: - requires: - - build - - test-ethereum-storage: - requires: - - build - - test-smart-contracts: - requires: - - build - - test-request-logic: - requires: - - build - - test-multi-format: - requires: - - build - - test-advanced-logic: - requires: - - build - - test-request-node: - requires: - - build - - test-utils: - requires: - - build - - test-currency: - requires: - - build - - test-epk-cipher: - requires: - - build - - test-lit-protocol-cipher: - requires: - - build - - test-epk-signature: - requires: - - build - - test-epk-decryption: - requires: - - build - - test-web3-signature: + - test: requires: - build - test-usage-examples: @@ -610,40 +250,14 @@ workflows: - test-toolbox: requires: - build - - test-integration-test: - requires: - - build - - test-payment-detection: - requires: - - build - - test-payment-processor: - requires: - - build # Release a next version package everytime we merge to master - next-release: requires: - - lint - - test-advanced-logic - - test-currency - - test-data-access - - test-data-format - - test-epk-cipher - - test-lit-protocol-cipher - - test-epk-decryption - - test-epk-signature - - test-ethereum-storage - - test-integration-test - - test-multi-format - - test-payment-detection - - test-payment-processor - - test-request-client - - test-request-logic - - test-request-node - - test-smart-contracts - - test-transaction-manager - - test-utils - - test-web3-signature + - build + - test: + requires: + - build context: protocol-release filters: branches: @@ -661,6 +275,6 @@ workflows: - master jobs: - build - - test-nightly: + - test: requires: - build From 1fde94a714ef3caab932a29a92a1a26bb75c02fe Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 5 Dec 2024 23:15:12 -0300 Subject: [PATCH 07/43] fix: syntax issu --- .circleci/config.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a091ec3b7..e63ca27bd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -255,9 +255,7 @@ workflows: - next-release: requires: - build - - test: - requires: - - build + - test context: protocol-release filters: branches: From 827d9983b76ae53d8ffcfa69cb7784b23d205112 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 5 Dec 2024 23:21:54 -0300 Subject: [PATCH 08/43] fix: build with lerna --- .circleci/config.yml | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e63ca27bd..f1b895e90 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,6 +62,7 @@ jobs: build: docker: - *node_image + resource_class: large working_directory: *working_directory steps: - checkout @@ -78,23 +79,8 @@ jobs: paths: - ~/.cache/yarn - run: - name: Build types - command: yarn workspace @requestnetwork/types run build - - run: - name: Build utils - command: yarn workspace @requestnetwork/utils run build - - run: - name: Build currency - command: yarn workspace @requestnetwork/currency run build - - run: - name: Generate Smart Contract types - command: yarn workspace @requestnetwork/smart-contracts run build - - run: - name: Generate Payment Detection queries - command: yarn workspace @requestnetwork/payment-detection run codegen - - run: - name: Build all packages (tsc) - command: yarn build:tsc + name: Build all packages (lerna) + command: yarn build --skip-nx-cache - persist_to_workspace: root: *working_directory From 7a1a993e7fa36fca4794a349f56a7d21eb76a419 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 5 Dec 2024 23:52:20 -0300 Subject: [PATCH 09/43] fix: run lint and build before tests only once --- .circleci/config.yml | 17 +++++------------ nx.json | 9 ++++++--- package.json | 4 +++- packages/request-logic/package.json | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f1b895e90..6617733c0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -96,9 +96,6 @@ jobs: - run: name: Verify format command: yarn format:check - - run: - name: Verify lint - command: yarn lint:check - run: name: 'lint package.json files' command: 'yarn run packageJsonLint' @@ -220,27 +217,23 @@ jobs: --force-publish=${FORCE_PUBLISH} workflows: - version: 2 + ## Lerna will run lit, build and test build-and-test: jobs: - - build + - test - lint: requires: - - build - - test: - requires: - - build + - test - test-usage-examples: requires: - - build + - test - test-toolbox: requires: - - build + - test # Release a next version package everytime we merge to master - next-release: requires: - - build - test context: protocol-release filters: diff --git a/nx.json b/nx.json index 1e929a819..403413ae1 100644 --- a/nx.json +++ b/nx.json @@ -3,16 +3,19 @@ "default": { "runner": "nx/tasks-runners/default", "options": { - "cacheableOperations": ["build", "clean", "test"] + "cacheableOperations": ["build", "test", "lint"] } } }, "targetDefaults": { + "lint": { + "dependsOn": ["^lint"] + }, "build": { - "dependsOn": ["^build"] + "dependsOn": ["^build", "lint"] }, "test": { - "dependsOn": ["clean", "build"] + "dependsOn": ["build"] }, "clean": { "dependsOn": ["^clean"] diff --git a/package.json b/package.json index dcd3d64c0..fc9be2742 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,9 @@ "build": "lerna run build", "clean": "lerna run clean", "build:tsc": "tsc -b packages/**/tsconfig.build.json", - "lint": "eslint . --fix --quiet", + "lint": "lerna run lint:check", + "lint:ci": "yarn format:check && yarn lint:check && yarn packageJsonLint", + "lint:fix": "eslint . --fix --quiet", "lint:check": "eslint . --quiet", "lint-staged": "lint-staged", "lerna": "lerna", diff --git a/packages/request-logic/package.json b/packages/request-logic/package.json index 71e1b7faf..c40109371 100644 --- a/packages/request-logic/package.json +++ b/packages/request-logic/package.json @@ -35,7 +35,7 @@ "clean": "rm -rf dist tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo", "example": "ts-node specs/example/example.ts", "lint": "eslint . --fix", - "lint:check": "eslint .", + "lint:check": "eslint . --ignore-pattern 'specs'", "test": "jest", "test:watch": "yarn test --watch" }, From a3f9ecbdb6821a81834e0b1b61b2d69973d7331a Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Thu, 5 Dec 2024 23:59:16 -0300 Subject: [PATCH 10/43] fix: install --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6617733c0..79aece2fd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,7 +59,7 @@ references: done echo Failed waiting for Node initialization && exit 1 jobs: - build: + install: docker: - *node_image resource_class: large @@ -78,9 +78,6 @@ jobs: key: yarn-packages-{{ checksum "yarn.lock" }} paths: - ~/.cache/yarn - - run: - name: Build all packages (lerna) - command: yarn build --skip-nx-cache - persist_to_workspace: root: *working_directory @@ -122,7 +119,7 @@ jobs: - run: *step_wait_for_node - run: name: 'Test all' - command: 'yarn test' + command: yarn test --skip-nx-cache - store_test_results: path: packages/integration-test/reports/ - store_test_results: @@ -220,7 +217,10 @@ workflows: ## Lerna will run lit, build and test build-and-test: jobs: - - test + - install + - test: + requires: + - install - lint: requires: - test @@ -251,7 +251,7 @@ workflows: only: - master jobs: - - build + - install - test: requires: - - build + - install From 62fe275639a69d2629585b2fb55adbcf65ae1c45 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 00:07:18 -0300 Subject: [PATCH 11/43] fix: build contracts --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 79aece2fd..f9adab843 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,6 +108,9 @@ jobs: steps: - attach_workspace: at: *working_directory + - run: + name: 'Build contract from smart-contracts' + command: 'yarn workspace @requestnetwork/smart-contracts run build' - run: name: 'Deploy test contract from smart-contracts' command: 'yarn workspace @requestnetwork/smart-contracts run deploy' From 619615ac8b463efd8ba688e32ce53d133a7ae3a5 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 00:13:00 -0300 Subject: [PATCH 12/43] fix: build all before deploying test contracts --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f9adab843..2ecd79903 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,8 +109,8 @@ jobs: - attach_workspace: at: *working_directory - run: - name: 'Build contract from smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run build' + name: 'Build with lerna' + command: 'yarn build --skip-nx-cache' - run: name: 'Deploy test contract from smart-contracts' command: 'yarn workspace @requestnetwork/smart-contracts run deploy' @@ -122,7 +122,7 @@ jobs: - run: *step_wait_for_node - run: name: 'Test all' - command: yarn test --skip-nx-cache + command: 'yarn test' - store_test_results: path: packages/integration-test/reports/ - store_test_results: From 573e8c2ac679f7f20fd3a885861a880af016a6d9 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 00:23:06 -0300 Subject: [PATCH 13/43] fix: lint call --- nx.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx.json b/nx.json index 403413ae1..b6a4af969 100644 --- a/nx.json +++ b/nx.json @@ -8,11 +8,11 @@ } }, "targetDefaults": { - "lint": { - "dependsOn": ["^lint"] + "lint:check": { + "dependsOn": ["^lint:check"] }, "build": { - "dependsOn": ["^build", "lint"] + "dependsOn": ["^build", "lint:check"] }, "test": { "dependsOn": ["build"] From 7c28604a1ef734cc8013af2ca66e4aef870732f7 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 00:23:29 -0300 Subject: [PATCH 14/43] fix: lint again --- nx.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx.json b/nx.json index b6a4af969..20cba77dd 100644 --- a/nx.json +++ b/nx.json @@ -3,7 +3,7 @@ "default": { "runner": "nx/tasks-runners/default", "options": { - "cacheableOperations": ["build", "test", "lint"] + "cacheableOperations": ["build", "test", "lint:check"] } } }, From e082d6e423d31dd589575a973ef7f59f1f8ee0b0 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 00:35:09 -0300 Subject: [PATCH 15/43] fix: build smart contract dependecies first only --- .circleci/config.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2ecd79903..8565fbe72 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,8 +109,17 @@ jobs: - attach_workspace: at: *working_directory - run: - name: 'Build with lerna' - command: 'yarn build --skip-nx-cache' + name: 'Build types' + command: 'yarn workspace @requestnetwork/types run build' + - run: + name: 'Build utils' + command: 'yarn workspace @requestnetwork/utils run build' + - run: + name: 'Build currency' + command: 'yarn workspace @requestnetwork/currency run build' + - run: + name: 'Build smart-contracts' + command: 'yarn workspace @requestnetwork/smart-contracts run build' - run: name: 'Deploy test contract from smart-contracts' command: 'yarn workspace @requestnetwork/smart-contracts run deploy' From bf473d8176e636003dc86be2141250f822016325 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 00:37:22 -0300 Subject: [PATCH 16/43] fix: change resource class --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8565fbe72..d84879086 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -103,7 +103,7 @@ jobs: - *ganache_image - *postgres_image - *graph_image - resource_class: large + resource_class: xlarge working_directory: *working_directory steps: - attach_workspace: From 7e34e6ef00247a1422d8e169673cc095e47a2c7c Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 00:46:48 -0300 Subject: [PATCH 17/43] revert: build all --- .circleci/config.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d84879086..2159d0f97 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,17 +109,8 @@ jobs: - attach_workspace: at: *working_directory - run: - name: 'Build types' - command: 'yarn workspace @requestnetwork/types run build' - - run: - name: 'Build utils' - command: 'yarn workspace @requestnetwork/utils run build' - - run: - name: 'Build currency' - command: 'yarn workspace @requestnetwork/currency run build' - - run: - name: 'Build smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run build' + name: 'Build all packages with lerna' + command: 'yarn build --concurrency=10' - run: name: 'Deploy test contract from smart-contracts' command: 'yarn workspace @requestnetwork/smart-contracts run deploy' @@ -131,7 +122,7 @@ jobs: - run: *step_wait_for_node - run: name: 'Test all' - command: 'yarn test' + command: 'yarn test --concurrency=10' - store_test_results: path: packages/integration-test/reports/ - store_test_results: From c563bc5641b6b512fc7d18a3cc4321cfad5cf69e Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 06:50:56 -0300 Subject: [PATCH 18/43] fix: performance --- .circleci/config.yml | 95 +++++++++++++++++++++++++------------------- nx.json | 17 ++++---- package.json | 2 +- 3 files changed, 64 insertions(+), 50 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2159d0f97..b539ef169 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,10 +59,10 @@ references: done echo Failed waiting for Node initialization && exit 1 jobs: - install: + build: docker: - *node_image - resource_class: large + resource_class: xlarge working_directory: *working_directory steps: - checkout @@ -78,7 +78,9 @@ jobs: key: yarn-packages-{{ checksum "yarn.lock" }} paths: - ~/.cache/yarn - + - run: + name: Build all packages with lerna + command: 'yarn build --since master' - persist_to_workspace: root: *working_directory paths: @@ -96,35 +98,17 @@ jobs: - run: name: 'lint package.json files' command: 'yarn run packageJsonLint' - test: + test-unit: docker: - *node_image - - *ipfs_image - - *ganache_image - - *postgres_image - - *graph_image resource_class: xlarge working_directory: *working_directory steps: - attach_workspace: at: *working_directory - run: - name: 'Build all packages with lerna' - command: 'yarn build --concurrency=10' - - run: - name: 'Deploy test contract from smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' - - run: *step_graph_deploy - - run: - name: 'Start request-node' - command: 'yarn start:request-node' - background: true - - run: *step_wait_for_node - - run: - name: 'Test all' - command: 'yarn test --concurrency=10' - - store_test_results: - path: packages/integration-test/reports/ + name: 'Test unit' + command: 'yarn test --since master --ignore @requestnetwork/smart-contracts --ignore @requestnetwork/payment-detection --ignore @requestnetwork/payment-processor --ignore @requestnetwork/integration-test' - store_test_results: path: packages/lit-protocol-cipher/reports/ - store_test_results: @@ -133,18 +117,12 @@ jobs: path: packages/request-logic/reports/ - store_test_results: path: packages/request-node/reports/ - - store_test_results: - path: packages/smart-contracts/reports/ - store_test_results: path: packages/transaction-manager/reports/ - store_test_results: path: packages/epk-signature/reports/ - store_test_results: path: packages/web3-signature/reports/ - - store_test_results: - path: packages/payment-detection/reports/ - - store_test_results: - path: packages/payment-processor/reports/ - store_test_results: path: packages/advanced-logic/reports/ - store_test_results: @@ -161,6 +139,38 @@ jobs: path: packages/utils/reports/ - store_test_results: path: packages/multi-format/reports/ + test-integration: + docker: + - *node_image + - *ipfs_image + - *ganache_image + - *postgres_image + - *graph_image + resource_class: xlarge + working_directory: *working_directory + steps: + - attach_workspace: + at: *working_directory + - run: + name: 'Deploy test contract from smart-contracts' + command: 'yarn workspace @requestnetwork/smart-contracts run deploy' + - run: *step_graph_deploy + - run: + name: 'Start request-node' + command: 'yarn start:request-node' + background: true + - run: *step_wait_for_node + - run: + name: 'Test all' + command: 'yarn test --since master --scope @requestnetwork/smart-contracts --scope @requestnetwork/payment-detection --scope @requestnetwork/payment-processor --scope @requestnetwork/integration-test' + - store_test_results: + path: packages/integration-test/reports/ + - store_test_results: + path: packages/smart-contracts/reports/ + - store_test_results: + path: packages/payment-detection/reports/ + - store_test_results: + path: packages/payment-processor/reports/ test-usage-examples: docker: - *node_image @@ -220,24 +230,27 @@ workflows: ## Lerna will run lit, build and test build-and-test: jobs: - - install - - test: + - build + - test-unit: requires: - - install - - lint: + - build + - test-integration: requires: - - test + - build - test-usage-examples: requires: - - test + - build - test-toolbox: requires: - - test + - build + - lint: + requires: + - build # Release a next version package everytime we merge to master - next-release: requires: - - test + - build context: protocol-release filters: branches: @@ -254,7 +267,7 @@ workflows: only: - master jobs: - - install - - test: + - build + - test-unit: requires: - - install + - build diff --git a/nx.json b/nx.json index 20cba77dd..4e3d7bd46 100644 --- a/nx.json +++ b/nx.json @@ -1,24 +1,25 @@ { "tasksRunnerOptions": { "default": { - "runner": "nx/tasks-runners/default", - "options": { - "cacheableOperations": ["build", "test", "lint:check"] - } + "runner": "nx/tasks-runners/default" } }, "targetDefaults": { "lint:check": { - "dependsOn": ["^lint:check"] + "dependsOn": ["^lint:check"], + "cache": true }, "build": { - "dependsOn": ["^build", "lint:check"] + "dependsOn": ["^build", "lint:check"], + "cache": true }, "test": { - "dependsOn": ["build"] + "dependsOn": ["build"], + "cache": true }, "clean": { - "dependsOn": ["^clean"] + "dependsOn": ["^clean"], + "cache": true } } } diff --git a/package.json b/package.json index fc9be2742..dd34a3dd3 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "publish-prerelease": "yarn lerna publish --preid development --skip-git --yes --canary", "deploy:contracts": "yarn workspace @requestnetwork/smart-contracts deploy", "start:request-node": "yarn workspace @requestnetwork/request-node start", - "test": "lerna run test --concurrency=1", + "test": "lerna run test", "format": "prettier . -w", "format:check": "prettier . -c", "link:all": "for d in packages/*; do cd $d; yarn link; cd -; done", From 9312fcaa120f99b3f19e6cef76254bd23c6b935a Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 07:04:38 -0300 Subject: [PATCH 19/43] fix: tests --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b539ef169..93495cf6d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,11 +108,9 @@ jobs: at: *working_directory - run: name: 'Test unit' - command: 'yarn test --since master --ignore @requestnetwork/smart-contracts --ignore @requestnetwork/payment-detection --ignore @requestnetwork/payment-processor --ignore @requestnetwork/integration-test' + command: 'yarn test --since master --ignore @requestnetwork/request-client.js --ignore @requestnetwork/smart-contracts --ignore @requestnetwork/payment-detection --ignore @requestnetwork/payment-processor --ignore @requestnetwork/integration-test' - store_test_results: path: packages/lit-protocol-cipher/reports/ - - store_test_results: - path: packages/request-client.js/reports/ - store_test_results: path: packages/request-logic/reports/ - store_test_results: @@ -162,7 +160,9 @@ jobs: - run: *step_wait_for_node - run: name: 'Test all' - command: 'yarn test --since master --scope @requestnetwork/smart-contracts --scope @requestnetwork/payment-detection --scope @requestnetwork/payment-processor --scope @requestnetwork/integration-test' + command: 'yarn test --since master --scope @requestnetwork/request-client.js --scope @requestnetwork/smart-contracts --scope @requestnetwork/payment-detection --scope @requestnetwork/payment-processor --scope @requestnetwork/integration-test' + - store_test_results: + path: packages/request-client.js/reports/ - store_test_results: path: packages/integration-test/reports/ - store_test_results: From 52f2fbc6d8a2f7308bc1f5ddbf70665771862a4f Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 07:19:43 -0300 Subject: [PATCH 20/43] fix: test for lit provider --- nx.json | 17 ++++++++--------- packages/lit-protocol-cipher/package.json | 5 ++++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/nx.json b/nx.json index 4e3d7bd46..20cba77dd 100644 --- a/nx.json +++ b/nx.json @@ -1,25 +1,24 @@ { "tasksRunnerOptions": { "default": { - "runner": "nx/tasks-runners/default" + "runner": "nx/tasks-runners/default", + "options": { + "cacheableOperations": ["build", "test", "lint:check"] + } } }, "targetDefaults": { "lint:check": { - "dependsOn": ["^lint:check"], - "cache": true + "dependsOn": ["^lint:check"] }, "build": { - "dependsOn": ["^build", "lint:check"], - "cache": true + "dependsOn": ["^build", "lint:check"] }, "test": { - "dependsOn": ["build"], - "cache": true + "dependsOn": ["build"] }, "clean": { - "dependsOn": ["^clean"], - "cache": true + "dependsOn": ["^clean"] } } } diff --git a/packages/lit-protocol-cipher/package.json b/packages/lit-protocol-cipher/package.json index 78c211451..627d559a4 100644 --- a/packages/lit-protocol-cipher/package.json +++ b/packages/lit-protocol-cipher/package.json @@ -36,7 +36,7 @@ "lint": "eslint . --fix", "lint:check": "eslint .", "prepare": "yarn run build", - "test": "yarn node --experimental-vm-modules $(yarn bin jest)", + "test": "jest", "test:watch": "yarn test --watch" }, "dependencies": { @@ -54,7 +54,10 @@ }, "devDependencies": { "@types/node": "18.11.9", + "@types/jest": "29.5.6", + "jest": "29.5.0", "jest-junit": "16.0.0", + "ts-jest": "29.1.0", "ts-node": "10.9.1", "typescript": "5.1.3" } From f6182ff9d9cce5c4eaae8a60552d94677ec944e9 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 07:26:05 -0300 Subject: [PATCH 21/43] fix: package lint --- packages/lit-protocol-cipher/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lit-protocol-cipher/package.json b/packages/lit-protocol-cipher/package.json index 627d559a4..cc506e45e 100644 --- a/packages/lit-protocol-cipher/package.json +++ b/packages/lit-protocol-cipher/package.json @@ -53,8 +53,8 @@ "ethers": "5.7.2" }, "devDependencies": { - "@types/node": "18.11.9", "@types/jest": "29.5.6", + "@types/node": "18.11.9", "jest": "29.5.0", "jest-junit": "16.0.0", "ts-jest": "29.1.0", From 559b602a240f681de43fe433aa2b32d76ff9a41b Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Fri, 6 Dec 2024 18:32:35 -0300 Subject: [PATCH 22/43] fix: include integration tests to nightly run --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 93495cf6d..4d9c04d04 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -271,3 +271,6 @@ workflows: - test-unit: requires: - build + - test-integration: + requires: + - build From 25a6656bccaad70327040ee23a52f99f691b118d Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 9 Dec 2024 13:39:01 -0300 Subject: [PATCH 23/43] fix: revert test-nightly --- .circleci/config.yml | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d9c04d04..55aa35595 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -195,6 +195,34 @@ jobs: name: 'Build toolbox' command: 'yarn workspace @requestnetwork/toolbox run build' + test-nightly: + docker: + - *node_image + - *ipfs_image + - *ganache_image + - *postgres_image + - *graph_image + resource_class: xlarge + working_directory: *working_directory + steps: + - attach_workspace: + at: *working_directory + - run: + name: 'Deploy test contract from smart-contracts' + command: 'yarn workspace @requestnetwork/smart-contracts run deploy' + - run: *step_graph_deploy + - run: + name: 'Start request-node' + command: 'yarn start:request-node' + background: true + - run: *step_wait_for_node + - run: + name: 'Test integration-test (erc20)' + command: 'yarn workspace @requestnetwork/integration-test run test:erc20 --ci --maxWorkers=1' + - run: + name: 'Test integration-test (btc)' + command: 'yarn workspace @requestnetwork/integration-test run test:btc --ci --maxWorkers=1' + # Release a next version package everytime we merge to master next-release: docker: @@ -268,9 +296,6 @@ workflows: - master jobs: - build - - test-unit: - requires: - - build - - test-integration: + - test-nightly: requires: - build From 1bcc4f69011f56cc0ad744c7fd382ec6bc5d5830 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 9 Dec 2024 13:42:11 -0300 Subject: [PATCH 24/43] fix: resource_class for test nightly --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55aa35595..060bd32bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -202,7 +202,6 @@ jobs: - *ganache_image - *postgres_image - *graph_image - resource_class: xlarge working_directory: *working_directory steps: - attach_workspace: From ec075772f6182d36662c953a7b51ac579e3184d4 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 9 Dec 2024 15:47:07 -0300 Subject: [PATCH 25/43] fix: per review suggestions --- .circleci/config.yml | 44 +++++++++++++++++++++++------ package.json | 5 ++-- packages/request-logic/package.json | 2 +- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 060bd32bf..1d62a8130 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,7 +62,7 @@ jobs: build: docker: - *node_image - resource_class: xlarge + resource_class: large working_directory: *working_directory steps: - checkout @@ -101,7 +101,7 @@ jobs: test-unit: docker: - *node_image - resource_class: xlarge + resource_class: large working_directory: *working_directory steps: - attach_workspace: @@ -137,14 +137,41 @@ jobs: path: packages/utils/reports/ - store_test_results: path: packages/multi-format/reports/ - test-integration: + test-integration-with-smart-contracts: docker: - *node_image - *ipfs_image - *ganache_image - *postgres_image - *graph_image - resource_class: xlarge + resource_class: large + working_directory: *working_directory + steps: + - attach_workspace: + at: *working_directory + - run: + name: 'Deploy test contract from smart-contracts' + command: 'yarn workspace @requestnetwork/smart-contracts run deploy' + - run: *step_graph_deploy + - run: + name: 'Test all' + command: 'yarn test --since master --scope @requestnetwork/request-client.js --scope @requestnetwork/smart-contracts --scope @requestnetwork/payment-detection --scope @requestnetwork/payment-processor' + - store_test_results: + path: packages/request-client.js/reports/ + - store_test_results: + path: packages/smart-contracts/reports/ + - store_test_results: + path: packages/payment-detection/reports/ + - store_test_results: + path: packages/payment-processor/reports/ + test-integration-with-request-node: + docker: + - *node_image + - *ipfs_image + - *ganache_image + - *postgres_image + - *graph_image + resource_class: large working_directory: *working_directory steps: - attach_workspace: @@ -160,11 +187,9 @@ jobs: - run: *step_wait_for_node - run: name: 'Test all' - command: 'yarn test --since master --scope @requestnetwork/request-client.js --scope @requestnetwork/smart-contracts --scope @requestnetwork/payment-detection --scope @requestnetwork/payment-processor --scope @requestnetwork/integration-test' + command: 'yarn test --since master --scope --scope @requestnetwork/integration-test' - store_test_results: path: packages/request-client.js/reports/ - - store_test_results: - path: packages/integration-test/reports/ - store_test_results: path: packages/smart-contracts/reports/ - store_test_results: @@ -261,7 +286,10 @@ workflows: - test-unit: requires: - build - - test-integration: + - test-integration-with-smart-contracts: + requires: + - build + - test-integration-with-request-node: requires: - build - test-usage-examples: diff --git a/package.json b/package.json index dd34a3dd3..163e313f0 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,9 @@ "build": "lerna run build", "clean": "lerna run clean", "build:tsc": "tsc -b packages/**/tsconfig.build.json", - "lint": "lerna run lint:check", + "lint": "lerna run lint", "lint:ci": "yarn format:check && yarn lint:check && yarn packageJsonLint", - "lint:fix": "eslint . --fix --quiet", - "lint:check": "eslint . --quiet", + "lint:check": "lerna run lint:check", "lint-staged": "lint-staged", "lerna": "lerna", "packageJsonLint": "npmPkgJsonLint ./packages", diff --git a/packages/request-logic/package.json b/packages/request-logic/package.json index c40109371..71e1b7faf 100644 --- a/packages/request-logic/package.json +++ b/packages/request-logic/package.json @@ -35,7 +35,7 @@ "clean": "rm -rf dist tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo", "example": "ts-node specs/example/example.ts", "lint": "eslint . --fix", - "lint:check": "eslint . --ignore-pattern 'specs'", + "lint:check": "eslint .", "test": "jest", "test:watch": "yarn test --watch" }, From f29351fdd5ae5c3f398d7608af0161f915557183 Mon Sep 17 00:00:00 2001 From: Rodrigo Serviuc Pavezi Date: Mon, 9 Dec 2024 15:50:02 -0300 Subject: [PATCH 26/43] Update .circleci/config.yml Co-authored-by: Alexandre ABRIOUX --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d62a8130..1eea8d9bb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -279,7 +279,7 @@ jobs: --force-publish=${FORCE_PUBLISH} workflows: - ## Lerna will run lit, build and test + ## Lerna will run lint, build and test build-and-test: jobs: - build From 0dc6d3fa7651e235cf2f59bec7025f2aedad3d61 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 9 Dec 2024 15:53:36 -0300 Subject: [PATCH 27/43] fix: require tests before doing a next release --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d62a8130..61f36853a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -305,7 +305,13 @@ workflows: # Release a next version package everytime we merge to master - next-release: requires: + - lint - build + - test-unit + - test-integration-with-smart-contracts + - test-integration-with-request-node + - test-usage-examples + - test-toolbox context: protocol-release filters: branches: From 77f4031472d18b05d355482dc0cedfacf5b6947c Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 9 Dec 2024 16:21:19 -0300 Subject: [PATCH 28/43] fix: test reports --- .circleci/config.yml | 71 ++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 46 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a4f4f77f..758e9ec06 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,35 +108,12 @@ jobs: at: *working_directory - run: name: 'Test unit' - command: 'yarn test --since master --ignore @requestnetwork/request-client.js --ignore @requestnetwork/smart-contracts --ignore @requestnetwork/payment-detection --ignore @requestnetwork/payment-processor --ignore @requestnetwork/integration-test' + command: 'yarn test --since master --ignore @requestnetwork/request-client.js --ignore @requestnetwork/smart-contracts --ignore @requestnetwork/payment-detection --ignore @requestnetwork/payment-processor --ignore @requestnetwork/integration-test -- --ci --reporters=default --reporters=jest-junit' + environment: + JEST_JUNIT_OUTPUT_DIR: './reports/junit/' + JEST_JUNIT_OUTPUT_NAME: 'results.xml' - store_test_results: - path: packages/lit-protocol-cipher/reports/ - - store_test_results: - path: packages/request-logic/reports/ - - store_test_results: - path: packages/request-node/reports/ - - store_test_results: - path: packages/transaction-manager/reports/ - - store_test_results: - path: packages/epk-signature/reports/ - - store_test_results: - path: packages/web3-signature/reports/ - - store_test_results: - path: packages/advanced-logic/reports/ - - store_test_results: - path: packages/data-access/reports/ - - store_test_results: - path: packages/ethereum-storage/reports/ - - store_test_results: - path: packages/epk-decryption/reports/ - - store_test_results: - path: packages/thegraph-data-access/reports/ - - store_test_results: - path: packages/currency/reports/ - - store_test_results: - path: packages/utils/reports/ - - store_test_results: - path: packages/multi-format/reports/ + path: reports/junit/ test-integration-with-smart-contracts: docker: - *node_image @@ -155,15 +132,12 @@ jobs: - run: *step_graph_deploy - run: name: 'Test all' - command: 'yarn test --since master --scope @requestnetwork/request-client.js --scope @requestnetwork/smart-contracts --scope @requestnetwork/payment-detection --scope @requestnetwork/payment-processor' - - store_test_results: - path: packages/request-client.js/reports/ - - store_test_results: - path: packages/smart-contracts/reports/ + command: 'yarn test --since master --scope @requestnetwork/request-client.js --scope @requestnetwork/smart-contracts --scope @requestnetwork/payment-detection --scope @requestnetwork/payment-processor -- --ci --reporters=default --reporters=jest-junit' + environment: + JEST_JUNIT_OUTPUT_DIR: './reports/junit/' + JEST_JUNIT_OUTPUT_NAME: 'results.xml' - store_test_results: - path: packages/payment-detection/reports/ - - store_test_results: - path: packages/payment-processor/reports/ + path: reports/junit/ test-integration-with-request-node: docker: - *node_image @@ -187,15 +161,12 @@ jobs: - run: *step_wait_for_node - run: name: 'Test all' - command: 'yarn test --since master --scope --scope @requestnetwork/integration-test' - - store_test_results: - path: packages/request-client.js/reports/ - - store_test_results: - path: packages/smart-contracts/reports/ + command: 'yarn test --since master --scope --scope @requestnetwork/integration-test -- --ci --reporters=default --reporters=jest-junit' + environment: + JEST_JUNIT_OUTPUT_DIR: './reports/junit/' + JEST_JUNIT_OUTPUT_NAME: 'results.xml' - store_test_results: - path: packages/payment-detection/reports/ - - store_test_results: - path: packages/payment-processor/reports/ + path: reports/junit/ test-usage-examples: docker: - *node_image @@ -242,10 +213,18 @@ jobs: - run: *step_wait_for_node - run: name: 'Test integration-test (erc20)' - command: 'yarn workspace @requestnetwork/integration-test run test:erc20 --ci --maxWorkers=1' + command: 'yarn workspace @requestnetwork/integration-test run test:erc20 --ci --maxWorkers=1 --reporters=default --reporters=jest-junit' + environment: + JEST_JUNIT_OUTPUT_DIR: './reports/junit/' + JEST_JUNIT_OUTPUT_NAME: 'erc20-results.xml' - run: name: 'Test integration-test (btc)' - command: 'yarn workspace @requestnetwork/integration-test run test:btc --ci --maxWorkers=1' + command: 'yarn workspace @requestnetwork/integration-test run test:btc --ci --maxWorkers=1 --reporters=default --reporters=jest-junit' + environment: + JEST_JUNIT_OUTPUT_DIR: './reports/junit/' + JEST_JUNIT_OUTPUT_NAME: 'btc-results.xml' + - store_test_results: + path: reports/junit/ # Release a next version package everytime we merge to master next-release: From dff9da16b846b656fd499f84f91f43069a742977 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 9 Dec 2024 17:18:48 -0300 Subject: [PATCH 29/43] fix: lint --- packages/request-logic/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/request-logic/tsconfig.json b/packages/request-logic/tsconfig.json index c2f3900f6..66f27db6c 100644 --- a/packages/request-logic/tsconfig.json +++ b/packages/request-logic/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../tsconfig", - "include": ["src/", "test/"] + "include": ["src/", "test/", "specs/"] } From 5fea3f23e80a395c162839d90c7f84ecd5ea4f20 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 9 Dec 2024 18:05:43 -0300 Subject: [PATCH 30/43] fix: eslint by ignoring specs --- packages/request-logic/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/request-logic/package.json b/packages/request-logic/package.json index 71e1b7faf..c40109371 100644 --- a/packages/request-logic/package.json +++ b/packages/request-logic/package.json @@ -35,7 +35,7 @@ "clean": "rm -rf dist tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo", "example": "ts-node specs/example/example.ts", "lint": "eslint . --fix", - "lint:check": "eslint .", + "lint:check": "eslint . --ignore-pattern 'specs'", "test": "jest", "test:watch": "yarn test --watch" }, From 9e6535399da32ca7a3cbac558ee7926d7fc05c5c Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Mon, 9 Dec 2024 18:20:58 -0300 Subject: [PATCH 31/43] fix: revert include --- packages/request-logic/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/request-logic/tsconfig.json b/packages/request-logic/tsconfig.json index 66f27db6c..c2f3900f6 100644 --- a/packages/request-logic/tsconfig.json +++ b/packages/request-logic/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../tsconfig", - "include": ["src/", "test/", "specs/"] + "include": ["src/", "test/"] } From 01d4af852fd9282ae33189c042ef80dec87e0671 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Mon, 9 Dec 2024 17:47:16 -0500 Subject: [PATCH 32/43] Remove unused anchors --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 758e9ec06..ec105dfc0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,8 +2,6 @@ version: 2.1 references: working_directory: &working_directory ~/repo - attach_workspace: &attach_workspace - image_name: &image_name 'cimg/python:3.7' node_image: &node_image image: cimg/node:18.18 environment: From fd5d178504d8bd939eefacf233a1cbc8f33515a5 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Mon, 9 Dec 2024 19:13:22 -0500 Subject: [PATCH 33/43] Split long lines into multi lines --- .circleci/config.yml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ec105dfc0..60a749478 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,7 +106,17 @@ jobs: at: *working_directory - run: name: 'Test unit' - command: 'yarn test --since master --ignore @requestnetwork/request-client.js --ignore @requestnetwork/smart-contracts --ignore @requestnetwork/payment-detection --ignore @requestnetwork/payment-processor --ignore @requestnetwork/integration-test -- --ci --reporters=default --reporters=jest-junit' + command: 'yarn test \ + --since master \ + --ignore @requestnetwork/request-client.js \ + --ignore @requestnetwork/smart-contracts \ + --ignore @requestnetwork/payment-detection \ + --ignore @requestnetwork/payment-processor \ + --ignore @requestnetwork/integration-test \ + -- \ + --ci \ + --reporters=default \ + --reporters=jest-junit' environment: JEST_JUNIT_OUTPUT_DIR: './reports/junit/' JEST_JUNIT_OUTPUT_NAME: 'results.xml' @@ -130,7 +140,16 @@ jobs: - run: *step_graph_deploy - run: name: 'Test all' - command: 'yarn test --since master --scope @requestnetwork/request-client.js --scope @requestnetwork/smart-contracts --scope @requestnetwork/payment-detection --scope @requestnetwork/payment-processor -- --ci --reporters=default --reporters=jest-junit' + command: 'yarn test \ + --since master \ + --scope @requestnetwork/request-client.js \ + --scope @requestnetwork/smart-contracts \ + --scope @requestnetwork/payment-detection \ + --scope @requestnetwork/payment-processor \ + -- \ + --ci \ + --reporters=default \ + --reporters=jest-junit' environment: JEST_JUNIT_OUTPUT_DIR: './reports/junit/' JEST_JUNIT_OUTPUT_NAME: 'results.xml' @@ -159,7 +178,13 @@ jobs: - run: *step_wait_for_node - run: name: 'Test all' - command: 'yarn test --since master --scope --scope @requestnetwork/integration-test -- --ci --reporters=default --reporters=jest-junit' + command: 'yarn test \ + --since master \ + --scope @requestnetwork/integration-test \ + -- \ + --ci \ + --reporters=default \ + --reporters=jest-junit' environment: JEST_JUNIT_OUTPUT_DIR: './reports/junit/' JEST_JUNIT_OUTPUT_NAME: 'results.xml' From 538493949f2200a051aaec0a40bb76e0c1871d0b Mon Sep 17 00:00:00 2001 From: MantisClone Date: Mon, 9 Dec 2024 19:27:28 -0500 Subject: [PATCH 34/43] Use new yarn deploy:contracts script --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 60a749478..043560e21 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -136,7 +136,7 @@ jobs: at: *working_directory - run: name: 'Deploy test contract from smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' + command: 'yarn deploy:contracts' - run: *step_graph_deploy - run: name: 'Test all' @@ -169,7 +169,7 @@ jobs: at: *working_directory - run: name: 'Deploy test contract from smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' + command: 'yarn deploy:contracts' - run: *step_graph_deploy - run: name: 'Start request-node' @@ -227,7 +227,7 @@ jobs: at: *working_directory - run: name: 'Deploy test contract from smart-contracts' - command: 'yarn workspace @requestnetwork/smart-contracts run deploy' + command: 'yarn deploy:contracts' - run: *step_graph_deploy - run: name: 'Start request-node' From 683efd7f75a0b8decb7001c58ed9f592e7990da2 Mon Sep 17 00:00:00 2001 From: MantisClone Date: Mon, 9 Dec 2024 19:29:24 -0500 Subject: [PATCH 35/43] Rename test steps --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 043560e21..00e89842f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -139,7 +139,7 @@ jobs: command: 'yarn deploy:contracts' - run: *step_graph_deploy - run: - name: 'Test all' + name: 'Test request-client.js, smart-contracts, payment-detection and payment-processor' command: 'yarn test \ --since master \ --scope @requestnetwork/request-client.js \ @@ -177,7 +177,7 @@ jobs: background: true - run: *step_wait_for_node - run: - name: 'Test all' + name: 'Test integration-test' command: 'yarn test \ --since master \ --scope @requestnetwork/integration-test \ From f8f850f43b2811dcab3093a4a56d0f8102c1dbd4 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 05:24:04 -0300 Subject: [PATCH 36/43] fix: test results reporting --- .circleci/config.yml | 46 ++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 00e89842f..a1e87f75a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -112,16 +112,12 @@ jobs: --ignore @requestnetwork/smart-contracts \ --ignore @requestnetwork/payment-detection \ --ignore @requestnetwork/payment-processor \ - --ignore @requestnetwork/integration-test \ - -- \ - --ci \ - --reporters=default \ - --reporters=jest-junit' + --ignore @requestnetwork/integration-test' environment: - JEST_JUNIT_OUTPUT_DIR: './reports/junit/' - JEST_JUNIT_OUTPUT_NAME: 'results.xml' + JEST_JUNIT_OUTPUT_DIR: './reports' + JEST_JUNIT_OUTPUT_NAME: 'jest-results.xml' - store_test_results: - path: reports/junit/ + path: reports test-integration-with-smart-contracts: docker: - *node_image @@ -145,16 +141,12 @@ jobs: --scope @requestnetwork/request-client.js \ --scope @requestnetwork/smart-contracts \ --scope @requestnetwork/payment-detection \ - --scope @requestnetwork/payment-processor \ - -- \ - --ci \ - --reporters=default \ - --reporters=jest-junit' + --scope @requestnetwork/payment-processor' environment: - JEST_JUNIT_OUTPUT_DIR: './reports/junit/' - JEST_JUNIT_OUTPUT_NAME: 'results.xml' + JEST_JUNIT_OUTPUT_DIR: './reports' + JEST_JUNIT_OUTPUT_NAME: 'jest-results.xml' - store_test_results: - path: reports/junit/ + path: reports test-integration-with-request-node: docker: - *node_image @@ -180,16 +172,12 @@ jobs: name: 'Test integration-test' command: 'yarn test \ --since master \ - --scope @requestnetwork/integration-test \ - -- \ - --ci \ - --reporters=default \ - --reporters=jest-junit' + --scope @requestnetwork/integration-test' environment: - JEST_JUNIT_OUTPUT_DIR: './reports/junit/' - JEST_JUNIT_OUTPUT_NAME: 'results.xml' + JEST_JUNIT_OUTPUT_DIR: './reports' + JEST_JUNIT_OUTPUT_NAME: 'jest-results.xml' - store_test_results: - path: reports/junit/ + path: reports test-usage-examples: docker: - *node_image @@ -236,18 +224,18 @@ jobs: - run: *step_wait_for_node - run: name: 'Test integration-test (erc20)' - command: 'yarn workspace @requestnetwork/integration-test run test:erc20 --ci --maxWorkers=1 --reporters=default --reporters=jest-junit' + command: 'yarn workspace @requestnetwork/integration-test run test:erc20' environment: - JEST_JUNIT_OUTPUT_DIR: './reports/junit/' + JEST_JUNIT_OUTPUT_DIR: './reports' JEST_JUNIT_OUTPUT_NAME: 'erc20-results.xml' - run: name: 'Test integration-test (btc)' - command: 'yarn workspace @requestnetwork/integration-test run test:btc --ci --maxWorkers=1 --reporters=default --reporters=jest-junit' + command: 'yarn workspace @requestnetwork/integration-test run test:btc' environment: - JEST_JUNIT_OUTPUT_DIR: './reports/junit/' + JEST_JUNIT_OUTPUT_DIR: './reports' JEST_JUNIT_OUTPUT_NAME: 'btc-results.xml' - store_test_results: - path: reports/junit/ + path: reports # Release a next version package everytime we merge to master next-release: From 4b5338fc571df7ee6817c1a4779e78e15854c3c0 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 05:46:39 -0300 Subject: [PATCH 37/43] fix: multiple line command --- .circleci/config.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a1e87f75a..9c9edf9ad 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,13 +106,14 @@ jobs: at: *working_directory - run: name: 'Test unit' - command: 'yarn test \ + command: | + yarn test \ --since master \ --ignore @requestnetwork/request-client.js \ --ignore @requestnetwork/smart-contracts \ --ignore @requestnetwork/payment-detection \ --ignore @requestnetwork/payment-processor \ - --ignore @requestnetwork/integration-test' + --ignore @requestnetwork/integration-test environment: JEST_JUNIT_OUTPUT_DIR: './reports' JEST_JUNIT_OUTPUT_NAME: 'jest-results.xml' @@ -136,12 +137,13 @@ jobs: - run: *step_graph_deploy - run: name: 'Test request-client.js, smart-contracts, payment-detection and payment-processor' - command: 'yarn test \ - --since master \ - --scope @requestnetwork/request-client.js \ - --scope @requestnetwork/smart-contracts \ - --scope @requestnetwork/payment-detection \ - --scope @requestnetwork/payment-processor' + command: | + yarn test \ + --since master \ + --scope @requestnetwork/request-client.js \ + --scope @requestnetwork/smart-contracts \ + --scope @requestnetwork/payment-detection \ + --scope @requestnetwork/payment-processor' environment: JEST_JUNIT_OUTPUT_DIR: './reports' JEST_JUNIT_OUTPUT_NAME: 'jest-results.xml' @@ -170,9 +172,10 @@ jobs: - run: *step_wait_for_node - run: name: 'Test integration-test' - command: 'yarn test \ - --since master \ - --scope @requestnetwork/integration-test' + command: | + yarn test \ + --since master \ + --scope @requestnetwork/integration-test environment: JEST_JUNIT_OUTPUT_DIR: './reports' JEST_JUNIT_OUTPUT_NAME: 'jest-results.xml' From 6bd11caaff71c08b820332a1111995978493c182 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 06:03:37 -0300 Subject: [PATCH 38/43] fix: syntax issue --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9c9edf9ad..1fb5d83a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -143,7 +143,7 @@ jobs: --scope @requestnetwork/request-client.js \ --scope @requestnetwork/smart-contracts \ --scope @requestnetwork/payment-detection \ - --scope @requestnetwork/payment-processor' + --scope @requestnetwork/payment-processor environment: JEST_JUNIT_OUTPUT_DIR: './reports' JEST_JUNIT_OUTPUT_NAME: 'jest-results.xml' From 5db9b2aff03bc5b266253eaa520d7861f0a8078f Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 06:18:06 -0300 Subject: [PATCH 39/43] fix: test reporting --- .circleci/config.yml | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1fb5d83a0..3d90d9b01 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -114,11 +114,8 @@ jobs: --ignore @requestnetwork/payment-detection \ --ignore @requestnetwork/payment-processor \ --ignore @requestnetwork/integration-test - environment: - JEST_JUNIT_OUTPUT_DIR: './reports' - JEST_JUNIT_OUTPUT_NAME: 'jest-results.xml' - store_test_results: - path: reports + path: packages test-integration-with-smart-contracts: docker: - *node_image @@ -144,11 +141,8 @@ jobs: --scope @requestnetwork/smart-contracts \ --scope @requestnetwork/payment-detection \ --scope @requestnetwork/payment-processor - environment: - JEST_JUNIT_OUTPUT_DIR: './reports' - JEST_JUNIT_OUTPUT_NAME: 'jest-results.xml' - store_test_results: - path: reports + path: packages test-integration-with-request-node: docker: - *node_image @@ -176,11 +170,8 @@ jobs: yarn test \ --since master \ --scope @requestnetwork/integration-test - environment: - JEST_JUNIT_OUTPUT_DIR: './reports' - JEST_JUNIT_OUTPUT_NAME: 'jest-results.xml' - store_test_results: - path: reports + path: packages/integration-test/reports test-usage-examples: docker: - *node_image @@ -228,17 +219,11 @@ jobs: - run: name: 'Test integration-test (erc20)' command: 'yarn workspace @requestnetwork/integration-test run test:erc20' - environment: - JEST_JUNIT_OUTPUT_DIR: './reports' - JEST_JUNIT_OUTPUT_NAME: 'erc20-results.xml' - run: name: 'Test integration-test (btc)' command: 'yarn workspace @requestnetwork/integration-test run test:btc' - environment: - JEST_JUNIT_OUTPUT_DIR: './reports' - JEST_JUNIT_OUTPUT_NAME: 'btc-results.xml' - store_test_results: - path: reports + path: packages/integration-test/reports # Release a next version package everytime we merge to master next-release: From 7c3836e015949e2f5c38a45aa74c039668ba0a72 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 06:37:54 -0300 Subject: [PATCH 40/43] test: store_test_results path --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d90d9b01..9a0111b92 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,7 +115,7 @@ jobs: --ignore @requestnetwork/payment-processor \ --ignore @requestnetwork/integration-test - store_test_results: - path: packages + path: packages/ test-integration-with-smart-contracts: docker: - *node_image @@ -142,7 +142,7 @@ jobs: --scope @requestnetwork/payment-detection \ --scope @requestnetwork/payment-processor - store_test_results: - path: packages + path: packages/ test-integration-with-request-node: docker: - *node_image @@ -171,7 +171,7 @@ jobs: --since master \ --scope @requestnetwork/integration-test - store_test_results: - path: packages/integration-test/reports + path: packages/integration-test/reports/ test-usage-examples: docker: - *node_image @@ -223,7 +223,7 @@ jobs: name: 'Test integration-test (btc)' command: 'yarn workspace @requestnetwork/integration-test run test:btc' - store_test_results: - path: packages/integration-test/reports + path: packages/integration-test/reports/ # Release a next version package everytime we merge to master next-release: From 629d90e3fb841d0e1a96818a441bf49874bc0935 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 07:05:19 -0300 Subject: [PATCH 41/43] chore: update store_test_results paths in CircleCI config for multiple packages --- .circleci/config.yml | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9a0111b92..978534296 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,7 +115,36 @@ jobs: --ignore @requestnetwork/payment-processor \ --ignore @requestnetwork/integration-test - store_test_results: - path: packages/ + path: packages/advance-logic/reports/ + - store_test_results: + path: packages/currency/reports/ + - store_test_results: + path: packages/data-access/reports/ + - store_test_results: + path: packages/data-format/reports/ + - store_test_results: + path: packages/epk-cipher/reports/ + - store_test_results: + path: packages/epk-decryption/reports/ + - store_test_results: + path: packages/ethereum-storage/reports/ + - store_test_results: + path: packages/lit-protocol-cipher/reports/ + - store_test_results: + path: packages/multi-format/reports/ + - store_test_results: + path: packages/request-logic/reports/ + - store_test_results: + path: packages/request-node/reports/ + - store_test_results: + path: packages/thegraph-data-access/reports/ + - store_test_results: + path: packages/transaction-manager/reports/ + - store_test_results: + path: packages/utils/reports/ + - store_test_results: + path: packages/web3-signature/reports/ + test-integration-with-smart-contracts: docker: - *node_image @@ -142,7 +171,13 @@ jobs: --scope @requestnetwork/payment-detection \ --scope @requestnetwork/payment-processor - store_test_results: - path: packages/ + path: packages/request-client.js/reports/ + - store_test_results: + path: packages/smart-contracts/reports/ + - store_test_results: + path: packages/payment-detection/reports/ + - store_test_results: + path: packages/payment-processor/reports/ test-integration-with-request-node: docker: - *node_image From 6ac59b704ea0a96f3b5377f2672577845ee12c14 Mon Sep 17 00:00:00 2001 From: rodrigopavezi Date: Tue, 10 Dec 2024 11:50:27 -0300 Subject: [PATCH 42/43] chore: update lerna publish scripts in package.json for improved release management --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 163e313f0..b73d74497 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,9 @@ "lint-staged": "lint-staged", "lerna": "lerna", "packageJsonLint": "npmPkgJsonLint ./packages", - "publish-npm": "lerna publish --conventional-commits --exact", - "publish-manual-prerelease": "lerna publish prerelease --conventional-commits --exact", - "publish-prerelease": "yarn lerna publish --preid development --skip-git --yes --canary", + "publish-npm": "yarn lerna publish --conventional-commits --exact --message \"chore(release): publish %s\" --no-changelog --yes", + "publish-manual-prerelease": "lerna publish prerelease --conventional-commits --conventional-prerelease --exact --no-git-tag-version --no-push --preid next --no-verify-access --dist-tag next", + "publish-prerelease": "FORCE_PUBLISH=$($(yarn bin)/lerna changed --json | jq '. | map(.name) | join (\",\")' -r) && echo $FORCE_PUBLISH && $(yarn bin)/lerna publish --conventional-commits --conventional-prerelease --exact --no-git-tag-version --no-push --preid next --no-verify-access --dist-tag next --yes --force-publish=${FORCE_PUBLISH}", "deploy:contracts": "yarn workspace @requestnetwork/smart-contracts deploy", "start:request-node": "yarn workspace @requestnetwork/request-node start", "test": "lerna run test", From e8c817952029aba69a7427d400a7003bb36a0766 Mon Sep 17 00:00:00 2001 From: Rodrigo Serviuc Pavezi Date: Tue, 10 Dec 2024 15:04:26 -0300 Subject: [PATCH 43/43] Update package.json Co-authored-by: MantisClone --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b73d74497..2aa708e33 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,9 @@ "lint-staged": "lint-staged", "lerna": "lerna", "packageJsonLint": "npmPkgJsonLint ./packages", - "publish-npm": "yarn lerna publish --conventional-commits --exact --message \"chore(release): publish %s\" --no-changelog --yes", + "publish-npm": "lerna publish --conventional-commits --exact --message \"chore(release): publish %s\" --no-changelog --yes", "publish-manual-prerelease": "lerna publish prerelease --conventional-commits --conventional-prerelease --exact --no-git-tag-version --no-push --preid next --no-verify-access --dist-tag next", - "publish-prerelease": "FORCE_PUBLISH=$($(yarn bin)/lerna changed --json | jq '. | map(.name) | join (\",\")' -r) && echo $FORCE_PUBLISH && $(yarn bin)/lerna publish --conventional-commits --conventional-prerelease --exact --no-git-tag-version --no-push --preid next --no-verify-access --dist-tag next --yes --force-publish=${FORCE_PUBLISH}", + "publish-prerelease": "FORCE_PUBLISH=$(lerna changed --json | jq '. | map(.name) | join (\",\")' -r) && echo $FORCE_PUBLISH && lerna publish --conventional-commits --conventional-prerelease --exact --no-git-tag-version --no-push --preid next --no-verify-access --dist-tag next --yes --force-publish=${FORCE_PUBLISH}", "deploy:contracts": "yarn workspace @requestnetwork/smart-contracts deploy", "start:request-node": "yarn workspace @requestnetwork/request-node start", "test": "lerna run test",