Skip to content

Commit

Permalink
update yarn test commands and add back L1<->L2 tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pscott committed Sep 12, 2024
1 parent 1730682 commit 7cf2a5c
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 23 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,5 @@ jobs:
working-directory: ./starknet
run: scarb test --verbose

# - name: run Hardhat tests
# run: yarn test:l1-execution; yarn test:eth-sig-auth; yarn test:stark-sig-auth; yarn test:eth-tx-auth
# we removed the above line because l1 <--> l2 communication is not yet implemented
- name: run Hardhat tests
run: yarn test-all
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
"scripts": {
"format:ts": "eslint . --ext .ts --fix",
"format:json": "json-format ./tests/data/*.json",
"test:sig-auths": "jest -c jest.config.ts --runInBand",
"chain:l1": "hardhat node",
"chain:l2": "bash './scripts/chain-l2.sh'",
"chain": "yarn chain:l1 & yarn chain:l2",
"test:stark-sig-auth": "bash './scripts/stark-sig-auth-test.sh'",
"test:eth-sig-auth": "bash './scripts/eth-sig-auth-test.sh'",
"test:eth-tx-auth": "bash './scripts/eth-tx-auth-test.sh'",
"test:l1-execution": "bash './scripts/l1-avatar-execution-test.sh'"
"test:l1-execution": "bash './scripts/l1-avatar-execution-test.sh'",
"test-all": "yarn test:stark-sig-auth && yarn test:eth-sig-auth && yarn test:eth-tx-auth && yarn test:l1-execution"
},
"devDependencies": {
"@gnosis.pm/zodiac": "^4.0.3",
Expand Down
3 changes: 0 additions & 3 deletions scripts/chain-l2.sh

This file was deleted.

2 changes: 0 additions & 2 deletions scripts/eth-sig-auth-test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash

kill -9 $(lsof -t -i:5050)
yarn chain:l2 &
sleep 10 &&
yarn hardhat test tests/eth-sig-auth.test.ts
if [ $? -eq 0 ]
then
Expand Down
6 changes: 3 additions & 3 deletions scripts/eth-tx-auth-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

kill -9 $(lsof -t -i:8545)
kill -9 $(lsof -t -i:5050)
yarn chain &
sleep 10 &&
yarn hardhat test tests/eth-tx-auth.test.ts --network 'ethereumLocal' --starknet-network 'starknetLocal'
yarn hardhat node &
sleep 5 &&
yarn hardhat test tests/eth-tx-auth.test.ts --network 'ethereumLocal'
if [ $? -eq 0 ]
then
kill -9 $(lsof -t -i:8545)
Expand Down
6 changes: 3 additions & 3 deletions scripts/l1-avatar-execution-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

kill -9 $(lsof -t -i:8545)
kill -9 $(lsof -t -i:5050)
yarn chain &
sleep 10 &&
yarn hardhat test tests/l1-avatar-execution.test.ts --network 'ethereumLocal' --starknet-network 'starknetLocal'
yarn hardhat node &
sleep 5 &&
yarn hardhat test tests/l1-avatar-execution.test.ts --network 'ethereumLocal'
if [ $? -eq 0 ]
then
kill -9 $(lsof -t -i:8545)
Expand Down
2 changes: 0 additions & 2 deletions scripts/stark-sig-auth-test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash

kill -9 $(lsof -t -i:5050)
yarn chain:l2 &
sleep 10 &&
yarn hardhat test tests/stark-sig-auth.test.ts
if [ $? -eq 0 ]
then
Expand Down
2 changes: 1 addition & 1 deletion tests/l1-avatar-execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('L1 Avatar Execution', function () {

before(async function () {
const devnetConfig = {
args: ["--seed", "42", "--lite-mode", "--dump-on", "exit", "--dump-path", "./dump.pkl", "--host", "127.0.0.1", "--port", "5050"],
args: ["--seed", "42", "--lite-mode", "--dump-on", "request", "--dump-path", "./dump.pkl", "--host", "127.0.0.1", "--port", "5050"],
};
console.log("Spawning devnet...");
starknetDevnet = await StarknetDevnet.spawnVersion('v0.2.0-rc.3', devnetConfig);
Expand Down
2 changes: 1 addition & 1 deletion tests/stark-sig-auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Starknet Signature Authenticator Tests', function () {
console.log('account address:', account_address, 'account pk:', account_pk);

const devnetConfig = {
args: ["--seed", "42", "--lite-mode", "--dump-on", "exit", "--dump-path", "./dump.pkl"],
args: ["--seed", "42", "--lite-mode", "--dump-on", "request", "--dump-path", "./dump.pkl"],
};
console.log("Spawning devnet...");
devnet = await Devnet.spawnVersion("v0.2.0-rc.3", devnetConfig);
Expand Down

0 comments on commit 7cf2a5c

Please sign in to comment.