From c81205d083940063e79f7551012b82a93a5a2e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Jakub=20Nani=C5=A1ta?= Date: Thu, 10 Oct 2024 13:16:19 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=B2=20Preinstall=20binaries=20when=20r?= =?UTF-8?q?unning=20user=20tests=20(#916)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/proud-falcons-hear.md | 5 +++++ packages/decode-lz-options/package.json | 2 +- tests-user/tests/build-lz-options.bats | 9 +++++++++ tests-user/tests/create-lz-oapp.bats | 3 +++ tests-user/tests/decode-lz-options.bats | 9 +++++++++ tests-user/tests/devtools-cli.bats | 3 +++ .../tests/devtools-evm-hardhat-export-deployments.bats | 3 +++ tests-user/tests/verify-contract.bats | 3 +++ 8 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .changeset/proud-falcons-hear.md diff --git a/.changeset/proud-falcons-hear.md b/.changeset/proud-falcons-hear.md new file mode 100644 index 000000000..3e2f3a78d --- /dev/null +++ b/.changeset/proud-falcons-hear.md @@ -0,0 +1,5 @@ +--- +"decode-lz-options": patch +--- + +Fix the binary binding for decode-lz-options diff --git a/packages/decode-lz-options/package.json b/packages/decode-lz-options/package.json index ac882223b..2110334d9 100644 --- a/packages/decode-lz-options/package.json +++ b/packages/decode-lz-options/package.json @@ -14,7 +14,7 @@ }, "license": "MIT", "bin": { - "build-lz-options": "./cli.js" + "decode-lz-options": "./cli.js" }, "files": [ "cli.js", diff --git a/tests-user/tests/build-lz-options.bats b/tests-user/tests/build-lz-options.bats index 081d4af12..7ca744acd 100644 --- a/tests-user/tests/build-lz-options.bats +++ b/tests-user/tests/build-lz-options.bats @@ -1,4 +1,13 @@ +# This will be run at the start of this testing suite, +# similar to beforeAll() in jest +setup() { + # Load bats-assert and bats-support + load "../lib/bats-support/load.bash" + load "../lib/bats-assert/load.bash" + # Install the binary so that we avoid race conditions + flock --verbose bats.lock npm install -g build-lz-options +} @test "should output version" { npx --yes build-lz-options --version diff --git a/tests-user/tests/create-lz-oapp.bats b/tests-user/tests/create-lz-oapp.bats index 2ad5d27f7..6d082119d 100644 --- a/tests-user/tests/create-lz-oapp.bats +++ b/tests-user/tests/create-lz-oapp.bats @@ -17,6 +17,9 @@ setup() { # Setup a directory for all the projects created by this test PROJECTS_DIRECTORY=$(mktemp -d) + + # Install the binary so that we avoid race conditions + flock --verbose bats.lock npm install -g create-lz-oapp } teardown() { diff --git a/tests-user/tests/decode-lz-options.bats b/tests-user/tests/decode-lz-options.bats index cf58379a7..b83cfbc39 100644 --- a/tests-user/tests/decode-lz-options.bats +++ b/tests-user/tests/decode-lz-options.bats @@ -1,4 +1,13 @@ +# This will be run at the start of this testing suite, +# similar to beforeAll() in jest +setup() { + # Load bats-assert and bats-support + load "../lib/bats-support/load.bash" + load "../lib/bats-assert/load.bash" + # Install the binary so that we avoid race conditions + flock --verbose bats.lock npm install -g decode-lz-options +} @test "should output version" { npx --yes decode-lz-options --version diff --git a/tests-user/tests/devtools-cli.bats b/tests-user/tests/devtools-cli.bats index 14ddc2fcf..832b64746 100644 --- a/tests-user/tests/devtools-cli.bats +++ b/tests-user/tests/devtools-cli.bats @@ -17,6 +17,9 @@ setup() { # Setup a directory for all the projects created by this test PROJECTS_DIRECTORY=$(mktemp -d) + + # Install the binary so that we avoid race conditions + flock --verbose bats.lock npm install -g @layerzerolabs/devtools-cli } teardown() { diff --git a/tests-user/tests/devtools-evm-hardhat-export-deployments.bats b/tests-user/tests/devtools-evm-hardhat-export-deployments.bats index 91aa18056..092990d87 100644 --- a/tests-user/tests/devtools-evm-hardhat-export-deployments.bats +++ b/tests-user/tests/devtools-evm-hardhat-export-deployments.bats @@ -4,6 +4,9 @@ setup() { # Load bats-assert and bats-support load "../lib/bats-support/load.bash" load "../lib/bats-assert/load.bash" + + # Install the binary so that we avoid race conditions + flock --verbose bats.lock npm install -g @layerzerolabs/export-deployments } @test "should output version" { diff --git a/tests-user/tests/verify-contract.bats b/tests-user/tests/verify-contract.bats index d7eaf9a16..6b56143c0 100644 --- a/tests-user/tests/verify-contract.bats +++ b/tests-user/tests/verify-contract.bats @@ -4,6 +4,9 @@ setup() { # Load bats-assert and bats-support load "../lib/bats-support/load.bash" load "../lib/bats-assert/load.bash" + + # Install the binary so that we avoid race conditions + flock --verbose bats.lock npm install -g @layerzerolabs/verify-contract } @test "should output version" {