Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧 Dependencies + DOCKER_COMPOSE_RUN_TESTS_ARGS #39

Merged
merged 3 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/oft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"devDependencies": {
"@babel/core": "^7.23.3",
"@layerzerolabs/eslint-config-next": "^1.5.60",
"@layerzerolabs/lz-evm-oapp-v2": "latest",
"@layerzerolabs/prettier-config-next": "^1.5.60",
"@layerzerolabs/lz-evm-oapp-v2": "~1.5.61",
"@layerzerolabs/prettier-config-next": "^1.5.61",
"@layerzerolabs/solhint-config": "^1.5.58",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@rushstack/eslint-patch": "^1.5.1",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@layerzerolabs/prettier-config-next": "^1.5.60",
"@layerzerolabs/prettier-config-next": "^1.5.61",
"@types/node": "~18.18.9",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
Expand Down
32 changes: 18 additions & 14 deletions packages/ua-utils-evm-hardhat-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,28 @@
</a>
</p>

<h1 align="center">@layerzerolabs/utils-evm-hardhat</h1>
<h1 align="center">@layerzerolabs/utils-evm-hardhat-test</h1>

<!-- The badges section -->
<p align="center">
<!-- Shields.io NPM published package version -->
<a href="https://www.npmjs.com/package/@layerzerolabs/utils-evm-hardhat"><img alt="NPM Version" src="https://img.shields.io/npm/v/@layerzerolabs/utils-evm-hardhat"/></a>
<!-- Shields.io NPM downloads -->
<a href="https://www.npmjs.com/package/@layerzerolabs/utils-evm-hardhat"><img alt="Downloads" src="https://img.shields.io/npm/dm/@layerzerolabs/utils-evm-hardhat"/></a>
<!-- Shields.io license badge -->
<a href="https://www.npmjs.com/package/@layerzerolabs/utils-evm-hardhat"><img alt="NPM License" src="https://img.shields.io/npm/l/@layerzerolabs/utils-evm-hardhat"/></a>
</p>
## Development

## Installation
This package provides integration tests for `@layerzerolabs/utils-evm-hardhat` executed within a containerized setup. To run the test suite, simply run:

```bash
yarn add @layerzerolabs/utils-evm-hardhat
# You can use the alias command from this package directory
yarn test

# Or use turbo and run from project root
yarn test --filter=utils-evm-hardhat-test

pnpm add @layerzerolabs/utils-evm-hardhat
# Or just use the actual test command from this package directory
docker compose run --rm tests
```

In case you're running the tests from the project root, it might sometimes be useful to rebuild the containers
(for example when adding/removing dependencies) and as a lazy developer, you might not be happy about `cd`ing to the package directory
and run the command from there. For that usecase the `$DOCKER_COMPOSE_RUN_TESTS_ARGS` environment variable has been added:

npm install @layerzerolabs/utils-evm-hardhat
```bash
# To rebuild the containers before running tests from the project root
DOCKER_COMPOSE_RUN_TESTS_ARGS=--build yarn test --filter=utils-evm-hardhat-test
```
8 changes: 2 additions & 6 deletions packages/ua-utils-evm-hardhat-test/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,12 @@ services:
condition: service_healthy
# Can't say I love the fact that the deploy scripts are inlined here
# but at least it's all in this file that bootstraps the whole environment
#
# The "&" at the end of the lines and "wait" work together to execute the deployments
# in parallel and wait until they are all complete
command:
- /bin/bash
- -c
- |
npx hardhat --network vengaboys deploy --reset &
npx hardhat --network britney deploy --reset &
wait
npx hardhat --network vengaboys deploy --reset
npx hardhat --network britney deploy --reset

# ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
#
Expand Down
8 changes: 4 additions & 4 deletions packages/ua-utils-evm-hardhat-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "MIT",
"scripts": {
"lint": "npx eslint '**/*.{js,ts,json}'",
"test": "docker compose run --rm tests"
"test": "docker compose run --rm $DOCKER_COMPOSE_RUN_TESTS_ARGS tests"
},
"devDependencies": {
"@ethersproject/abstract-signer": "^5.7.0",
Expand All @@ -22,9 +22,9 @@
"@gnosis.pm/safe-core-sdk-types": "^1.0.0",
"@gnosis.pm/safe-ethers-lib": "^1.0.0",
"@gnosis.pm/safe-service-client": "1.1.1",
"@layerzerolabs/lz-definitions": "~1.5.61",
"@layerzerolabs/lz-evm-sdk-v1": "~1.5.61",
"@layerzerolabs/lz-evm-sdk-v2": "~1.5.61",
"@layerzerolabs/lz-definitions": "~1.5.62",
"@layerzerolabs/lz-evm-sdk-v1": "~1.5.62",
"@layerzerolabs/lz-evm-sdk-v2": "~1.5.62",
"@layerzerolabs/utils-evm-hardhat": "~0.0.1",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@types/chai-as-promised": "^7.1.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/ua-utils-evm-hardhat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@gnosis.pm/safe-core-sdk-types": "^1.0.0",
"@gnosis.pm/safe-ethers-lib": "^1.0.0",
"@gnosis.pm/safe-service-client": "1.1.1",
"@layerzerolabs/lz-definitions": "~1.5.61",
"@layerzerolabs/lz-definitions": "~1.5.62",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@types/mocha": "^10.0.6",
"cli-ux": "^6.0.9",
Expand All @@ -56,7 +56,7 @@
"@gnosis.pm/safe-core-sdk-types": "^1.0.0",
"@gnosis.pm/safe-ethers-lib": "^1.0.0",
"@gnosis.pm/safe-service-client": "1.1.1",
"@layerzerolabs/lz-definitions": "~1.5.58",
"@layerzerolabs/lz-definitions": "~1.5.62",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"ethers": "^5.5.2",
"hardhat": "^2.19.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/ua-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"test": "jest"
},
"devDependencies": {
"@layerzerolabs/lz-definitions": "~1.5.58",
"@layerzerolabs/lz-definitions": "~1.5.62",
"@types/jest": "^29.5.10",
"fast-check": "^3.14.0",
"jest": "^29.7.0",
Expand All @@ -42,7 +42,7 @@
"zod": "^3.22.4"
},
"peerDependencies": {
"@layerzerolabs/lz-definitions": "~1.5.58",
"@layerzerolabs/lz-definitions": "~1.5.62",
"zod": "^3.22.4"
}
}
6 changes: 3 additions & 3 deletions packages/utils-evm-hardhat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@ethersproject/wallet": "^5.7.0",
"@layerzerolabs/lz-definitions": "~1.5.61",
"@layerzerolabs/lz-evm-sdk-v1": "~1.5.61",
"@layerzerolabs/lz-definitions": "~1.5.62",
"@layerzerolabs/lz-evm-sdk-v1": "~1.5.62",
"@types/chai-as-promised": "^7.1.7",
"@types/mocha": "^10.0.6",
"chai": "^4.3.10",
Expand All @@ -54,7 +54,7 @@
"peerDependencies": {
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@layerzerolabs/lz-definitions": "~1.5.58",
"@layerzerolabs/lz-definitions": "~1.5.62",
"hardhat": "^2.19.0",
"hardhat-deploy": "^0.9.19"
}
Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1646,14 +1646,14 @@
prettier "^2.8.3"
prettier-plugin-solidity "^1.1.1"

"@layerzerolabs/lz-definitions@^1.5.61", "@layerzerolabs/lz-definitions@~1.5.61":
"@layerzerolabs/lz-definitions@^1.5.61":
version "1.5.61"
resolved "https://registry.yarnpkg.com/@layerzerolabs/lz-definitions/-/lz-definitions-1.5.61.tgz#a3f9d6d07fcd5e6939147f6deac70fc64d4e7487"
integrity sha512-GQGqkXtW0bl1hiW7S7IJhqpSJqULrxzW2gbDi5KwHQ+RsZDJ4utzlB4CkhqaU5vbxzbaNV6lVQBzhSvcuBekig==
dependencies:
tiny-invariant "^1.3.1"

"@layerzerolabs/lz-definitions@~1.5.58":
"@layerzerolabs/lz-definitions@~1.5.62":
version "1.5.62"
resolved "https://registry.yarnpkg.com/@layerzerolabs/lz-definitions/-/lz-definitions-1.5.62.tgz#f457b3d39625a8346ceabaf0dfeec470a42aa080"
integrity sha512-+U5jOFcHFR8JRc7R4z8OO7Z7DvOFl49S1V7wHmBhs3DYDvQELjyp0KFxSUoeI/LNS6FCa6XBlbLm1eFr3A1v6g==
Expand All @@ -1674,7 +1674,7 @@
lodash "^4.17.21"
solidity-bytes-utils "^0.8.0"

"@layerzerolabs/lz-evm-oapp-v2@latest":
"@layerzerolabs/lz-evm-oapp-v2@~1.5.61":
version "1.5.61"
resolved "https://registry.yarnpkg.com/@layerzerolabs/lz-evm-oapp-v2/-/lz-evm-oapp-v2-1.5.61.tgz#500bb544d6b155ee308408fd56412cd8bbebcd3e"
integrity sha512-D99pcqEmRl6g3JRMd45XktS/CB5mbfWtT8LrYMKrFyd22rKSh44Oxu/N9ltmSYX3M8bVXJDnRvhjqZjG2iAl7g==
Expand All @@ -1697,19 +1697,19 @@
lodash "^4.17.21"
solidity-bytes-utils "0.8.0"

"@layerzerolabs/lz-evm-sdk-v1@~1.5.61":
version "1.5.61"
resolved "https://registry.yarnpkg.com/@layerzerolabs/lz-evm-sdk-v1/-/lz-evm-sdk-v1-1.5.61.tgz#436a694e96a154ab112a7b23cf68c118915442a0"
integrity sha512-Zezm/bEIfYTde5Hfa7ZmPOyZ5DQ3jFHTPSUBTTJ38elFYJfLADZe21V9ZJb4M+j95j234DalLpscxgBkusHtyw==
"@layerzerolabs/lz-evm-sdk-v1@~1.5.62":
version "1.5.62"
resolved "https://registry.yarnpkg.com/@layerzerolabs/lz-evm-sdk-v1/-/lz-evm-sdk-v1-1.5.62.tgz#68be61930283fb2221afe0c934e5c462dfd97d0a"
integrity sha512-DvOLq77LDi0UTMBxM7veMYtT1WQbQxDK6AeB94Dw2JPJJFhnANyxVaF52/qSWj7lpXQbQQs/nAuijiO+RvUg6Q==
dependencies:
"@ethersproject/abi" "^5.7.0"
"@ethersproject/providers" "^5.7.2"
ethers "^5.7.2"

"@layerzerolabs/lz-evm-sdk-v2@~1.5.61":
version "1.5.61"
resolved "https://registry.yarnpkg.com/@layerzerolabs/lz-evm-sdk-v2/-/lz-evm-sdk-v2-1.5.61.tgz#4b64e677061e782aef8ab417c3ed87fada1bcca2"
integrity sha512-5SoCh+RkqZqyeS3JDio95jj7unVZwMh0HD6Xxsx24DJp/tB88EsRjbkK4TBphn9UfisFy0PvryWr1Wi1Z7DGNQ==
"@layerzerolabs/lz-evm-sdk-v2@~1.5.62":
version "1.5.62"
resolved "https://registry.yarnpkg.com/@layerzerolabs/lz-evm-sdk-v2/-/lz-evm-sdk-v2-1.5.62.tgz#c46768067ee6451823c8ea7db77b0333a37a55fa"
integrity sha512-snyoCWnr3IRdkMDIX97pD8XjDNo3TamOQ3zwwYk35Gmgz1m8MXW1s/ovKm6zRYO4zLy3Hz2XUb7OusH6z8ap4g==
dependencies:
ethers "^5.7.2"

Expand Down Expand Up @@ -1779,7 +1779,7 @@
papaparse "^5.4.1"
winston "^3.10.0"

"@layerzerolabs/prettier-config-next@^1.5.60":
"@layerzerolabs/prettier-config-next@^1.5.61":
version "1.5.61"
resolved "https://registry.yarnpkg.com/@layerzerolabs/prettier-config-next/-/prettier-config-next-1.5.61.tgz#274a95e36cd796d71c5235158e10217a24250ff4"
integrity sha512-V8nOv9x0xAwA7vVhHkS09/xhcJlMdg/A6ycEmw/EQWbP0OP7R1i7RIYB2tghC/7BUuCaQL1DTqMNlwQOdoYMuw==
Expand Down