-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix exiting in integrated-devnet (#132) [skip ci]
Co-authored-by: Jorma <RedFox20@users.noreply.github.com> Co-authored-by: RedFox <jorma@tempus.finance>
- Loading branch information
1 parent
913d616
commit 2c986d0
Showing
14 changed files
with
186 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
test/integrated-devnet-tests/with-docker-address-occupied/check.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
trap 'kill $(jobs -p)' EXIT | ||
|
||
source ../scripts/check-devnet-is-not-running.sh | ||
|
||
check_devnet_is_not_running | ||
|
||
# run devnet which will cause integrated-devnet to fail | ||
starknet-devnet --host 127.0.0.1 --port 5050 --accounts 0 & | ||
|
||
npx hardhat starknet-compile contracts/contract.cairo | ||
|
||
npx hardhat test --no-compile test/integrated-devnet.test.ts 2>&1 | | ||
../scripts/assert-contains.py "Cannot spawn integrated-devnet: 127.0.0.1:5050 already occupied." |
13 changes: 13 additions & 0 deletions
13
test/integrated-devnet-tests/with-docker-address-occupied/hardhat.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import "../dist/src/index.js"; | ||
|
||
module.exports = { | ||
starknet: { | ||
network: process.env.NETWORK | ||
}, | ||
networks: { | ||
integratedDevnet: { | ||
dockerizedVersion: process.env.STARKNET_DEVNET, | ||
url: "http://127.0.0.1:5050" | ||
} | ||
} | ||
}; |
4 changes: 4 additions & 0 deletions
4
test/integrated-devnet-tests/with-docker-address-occupied/network.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "../../network.schema", | ||
"integrated-devnet": true | ||
} |
12 changes: 12 additions & 0 deletions
12
test/integrated-devnet-tests/with-docker-wrong-cli/check.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
source ../scripts/check-devnet-is-not-running.sh | ||
|
||
check_devnet_is_not_running | ||
|
||
npx hardhat starknet-compile contracts/contract.cairo | ||
|
||
npx hardhat test --no-compile test/integrated-devnet.test.ts 2>&1 | | ||
../scripts/assert-contains.py "starknet-devnet: error: argument --accounts: invalid int value: 'invalid_value'" |
14 changes: 14 additions & 0 deletions
14
test/integrated-devnet-tests/with-docker-wrong-cli/hardhat.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import "../dist/src/index.js"; | ||
|
||
module.exports = { | ||
starknet: { | ||
network: process.env.NETWORK | ||
}, | ||
networks: { | ||
integratedDevnet: { | ||
dockerizedVersion: process.env.STARKNET_DEVNET, | ||
url: "http://127.0.0.1:5050", | ||
args: ["--accounts", "invalid_value"] | ||
} | ||
} | ||
}; |
4 changes: 4 additions & 0 deletions
4
test/integrated-devnet-tests/with-docker-wrong-cli/network.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "../../network.schema", | ||
"integrated-devnet": true | ||
} |
15 changes: 15 additions & 0 deletions
15
test/integrated-devnet-tests/with-venv-address-occupied/check.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
trap 'kill $(jobs -p)' EXIT | ||
|
||
source ../scripts/check-devnet-is-not-running.sh | ||
|
||
check_devnet_is_not_running | ||
starknet-devnet --host 127.0.0.1 --port 5050 --accounts 0 & | ||
|
||
npx hardhat starknet-compile contracts/contract.cairo | ||
|
||
npx hardhat test --no-compile test/integrated-devnet.test.ts 2>&1 | | ||
../scripts/assert-contains.py "Cannot spawn integrated-devnet: 127.0.0.1:5050 already occupied." |
13 changes: 13 additions & 0 deletions
13
test/integrated-devnet-tests/with-venv-address-occupied/hardhat.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import "../dist/src/index.js"; | ||
|
||
module.exports = { | ||
starknet: { | ||
network: process.env.NETWORK | ||
}, | ||
networks: { | ||
integratedDevnet: { | ||
venv: process.env.STARKNET_DEVNET_PATH, | ||
url: "http://127.0.0.1:5050" | ||
} | ||
} | ||
}; |
4 changes: 4 additions & 0 deletions
4
test/integrated-devnet-tests/with-venv-address-occupied/network.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "../../network.schema", | ||
"integrated-devnet": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
source ../scripts/check-devnet-is-not-running.sh | ||
|
||
check_devnet_is_not_running | ||
|
||
npx hardhat starknet-compile contracts/contract.cairo | ||
|
||
npx hardhat test --no-compile test/integrated-devnet.test.ts 2>&1 | | ||
../scripts/assert-contains.py "starknet-devnet: error: argument --accounts: invalid int value: 'invalid_value'" |
14 changes: 14 additions & 0 deletions
14
test/integrated-devnet-tests/with-venv-wrong-cli/hardhat.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import "../dist/src/index.js"; | ||
|
||
module.exports = { | ||
starknet: { | ||
network: process.env.NETWORK | ||
}, | ||
networks: { | ||
integratedDevnet: { | ||
venv: process.env.STARKNET_DEVNET_PATH, | ||
url: "http://127.0.0.1:5050", | ||
args: ["--accounts", "invalid_value"] | ||
} | ||
} | ||
}; |
4 changes: 4 additions & 0 deletions
4
test/integrated-devnet-tests/with-venv-wrong-cli/network.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$schema": "../../network.schema", | ||
"integrated-devnet": true | ||
} |