From 5ea2d00ac3bb0ac2033d72ced2a6d5eef0b3f2bf Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Fri, 24 May 2024 16:22:58 -0600 Subject: [PATCH 1/7] chore: give volume access to docker file in test runner for coverage reports --- docker-compose.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 5182f08e..482ee91b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -37,3 +37,5 @@ services: - GATEWAY_HOST=arlocal - GATEWAY_PORT=1984 - GATEWAY_PROTOCOL=http + volumes: + - .:/app From 07d5ed594c7e14d8eafbd3ec9b6fe63a9b7fc0af Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Fri, 24 May 2024 16:26:22 -0600 Subject: [PATCH 2/7] chore(test): create volume mount for coverage folder --- docker-compose.yaml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 482ee91b..4c94fb0b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -38,4 +38,4 @@ services: - GATEWAY_PORT=1984 - GATEWAY_PROTOCOL=http volumes: - - .:/app + - ./coverage:/app/coverage diff --git a/package.json b/package.json index 93308ed1..ff82c82b 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "test:unit": "yarn clean && jest --config=jest.config.mjs", "test:integration": "yarn clean && jest --config=jest.integration.config.mjs", "test:integration:local": "yarn clean && jest --config=jest.integration.config.mjs --runInBand", - "test:docker": "docker-compose up --exit-code-from test-runner --build", + "test:docker": "mkdir -p coverage && docker-compose up --exit-code-from test-runner --build", "prepare": "husky install", "example:esm": "cd examples/esm && yarn && node index.mjs", "example:cjs": "cd examples/cjs && yarn && node index.cjs", From f897cdaa5e30e8522324297e6947a8c9c7ede20a Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Fri, 24 May 2024 16:54:11 -0600 Subject: [PATCH 3/7] chore(test): running test in github action --- Dockerfile.test | 3 +++ package.json | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile.test b/Dockerfile.test index 4ec1504a..c9b6e1e2 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -3,5 +3,8 @@ WORKDIR /app COPY . . +RUN mkdir -p coverage +RUN chmod -R 777 coverage + RUN yarn clean && yarn install CMD yarn test diff --git a/package.json b/package.json index ff82c82b..39970904 100644 --- a/package.json +++ b/package.json @@ -69,9 +69,9 @@ "format:fix": "prettier --write .", "test": "yarn test:unit && yarn test:integration", "test:unit": "yarn clean && jest --config=jest.config.mjs", - "test:integration": "yarn clean && jest --config=jest.integration.config.mjs", + "test:integration": "yarn clean && jest --config=jest.integration.config.mjs --runInBand", "test:integration:local": "yarn clean && jest --config=jest.integration.config.mjs --runInBand", - "test:docker": "mkdir -p coverage && docker-compose up --exit-code-from test-runner --build", + "test:docker": "docker-compose up --exit-code-from test-runner --build", "prepare": "husky install", "example:esm": "cd examples/esm && yarn && node index.mjs", "example:cjs": "cd examples/cjs && yarn && node index.cjs", From 0f3b4c063c5c3085ac0bb63e34b1aeed8f46d4cf Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Fri, 24 May 2024 17:08:44 -0600 Subject: [PATCH 4/7] chore(test): add dockerignore and update test docker command --- .dockerignore | 9 +++++++++ Dockerfile.test | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..c994810f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +dist +lib +bundles +tests/wallets +tests/contracts +examples +.github +.husky +.vscode diff --git a/Dockerfile.test b/Dockerfile.test index c9b6e1e2..dfd7e875 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -4,7 +4,7 @@ WORKDIR /app COPY . . RUN mkdir -p coverage -RUN chmod -R 777 coverage +RUN chmod -R 755 coverage -RUN yarn clean && yarn install +RUN yarn install CMD yarn test From 14c17dc142458049b951e594a67c1e0380b8b9c0 Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Fri, 24 May 2024 17:11:14 -0600 Subject: [PATCH 5/7] chore(test): remove coverage from cleanup script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39970904..743892e5 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "build:esm": "yarn tsc -p tsconfig.json", "build:cjs": "yarn tsc -p tsconfig.cjs.json && echo \"{\\\"type\\\": \\\"commonjs\\\"}\" > lib/cjs/package.json", "build": "yarn clean && yarn build:web && yarn build:esm && yarn build:cjs", - "clean": "rimraf [ lib coverage bundles tests/contracts tests/wallets ]", + "clean": "rimraf [ lib bundles tests/contracts tests/wallets ]", "lint": "eslint src", "lint:fix": "eslint src --fix", "format": "prettier --check .", From a608de77a66c40e944dbf0e4b3eefc516d275cfc Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Sun, 5 May 2024 18:00:10 -0600 Subject: [PATCH 6/7] chore(test): update test scripts --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 743892e5..cd884cf3 100644 --- a/package.json +++ b/package.json @@ -62,15 +62,15 @@ "build:esm": "yarn tsc -p tsconfig.json", "build:cjs": "yarn tsc -p tsconfig.cjs.json && echo \"{\\\"type\\\": \\\"commonjs\\\"}\" > lib/cjs/package.json", "build": "yarn clean && yarn build:web && yarn build:esm && yarn build:cjs", - "clean": "rimraf [ lib bundles tests/contracts tests/wallets ]", + "clean": "rimraf [ lib bundles coverage tests/contracts tests/wallets ]", "lint": "eslint src", "lint:fix": "eslint src --fix", "format": "prettier --check .", "format:fix": "prettier --write .", "test": "yarn test:unit && yarn test:integration", - "test:unit": "yarn clean && jest --config=jest.config.mjs", - "test:integration": "yarn clean && jest --config=jest.integration.config.mjs --runInBand", - "test:integration:local": "yarn clean && jest --config=jest.integration.config.mjs --runInBand", + "test:unit": "jest --config=jest.config.mjs", + "test:integration": "jest --config=jest.integration.config.mjs --runInBand", + "test:integration:local": "jest --config=jest.integration.config.mjs --runInBand", "test:docker": "docker-compose up --exit-code-from test-runner --build", "prepare": "husky install", "example:esm": "cd examples/esm && yarn && node index.mjs", From 4621d3905f53653cf2af12226e55ec79920d365e Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Sun, 5 May 2024 18:00:50 -0600 Subject: [PATCH 7/7] chore(test): update package.json scripts --- package.json | 1 - run-integration-tests.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index cd884cf3..f7cf4767 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,6 @@ "test": "yarn test:unit && yarn test:integration", "test:unit": "jest --config=jest.config.mjs", "test:integration": "jest --config=jest.integration.config.mjs --runInBand", - "test:integration:local": "jest --config=jest.integration.config.mjs --runInBand", "test:docker": "docker-compose up --exit-code-from test-runner --build", "prepare": "husky install", "example:esm": "cd examples/esm && yarn && node index.mjs", diff --git a/run-integration-tests.sh b/run-integration-tests.sh index 5678fba9..468cd32c 100755 --- a/run-integration-tests.sh +++ b/run-integration-tests.sh @@ -2,7 +2,7 @@ docker compose up -d # Run tests and capture the exit code -yarn dotenv -e .env.test yarn test:integration:local +yarn dotenv -e .env.test yarn test:integration exit_code=$? # Tear down the docker-compose setup