Skip to content

Commit

Permalink
Merge pull request #107 from ar-io/test-revert
Browse files Browse the repository at this point in the history
chore(test): fix codecoverage reports for tests running in docker
  • Loading branch information
dtfiedler authored May 28, 2024
2 parents 8f7413a + 4621d39 commit fccce2c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist
lib
bundles
tests/wallets
tests/contracts
examples
.github
.husky
.vscode
5 changes: 4 additions & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ WORKDIR /app

COPY . .

RUN yarn clean && yarn install
RUN mkdir -p coverage
RUN chmod -R 755 coverage

RUN yarn install
CMD yarn test
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ services:
- GATEWAY_HOST=arlocal
- GATEWAY_PORT=1984
- GATEWAY_PROTOCOL=http
volumes:
- ./coverage:/app/coverage
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@
"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 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",
"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:docker": "docker-compose up --exit-code-from test-runner --build",
"prepare": "husky install",
"example:esm": "cd examples/esm && yarn && node index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fccce2c

Please sign in to comment.