Skip to content

Commit

Permalink
Load env file in e2e env
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Feb 9, 2024
1 parent c96a5f2 commit 8333cea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/cli/test/scripts/e2e_test_env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const {forkConfig} = defineSimTestConfig({
BELLATRIX_FORK_EPOCH: bellatrixForkEpoch,
CAPELLA_FORK_EPOCH: capellaForkEpoch,
runTillEpoch: Infinity,
initialNodes: 2,
});

const env = await SimulationEnvironment.initWithDefaults(
Expand Down
10 changes: 5 additions & 5 deletions scripts/run_e2e_env.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

DIR=$(dirname "$0")

function start_app() {
mkdir -p test-logs/e2e-test-env
source ../.env.test
export LODESTAR_PRESET=minimal
nohup node --loader ts-node/esm packages/cli/test/scripts/e2e_test_env.ts > test-logs/e2e-test-env/simulation.out 2>&1 &
export DOTENV_CONFIG_PATH="$DIR/../.env.test"
nohup node -r dotenv/config --loader ts-node/esm packages/cli/test/scripts/e2e_test_env.ts > test-logs/e2e-test-env/simulation.out 2>&1 &
echo $! > test-logs/e2e-test-env/simulation.pid
echo "Wait for the node to be ready"
npx wait-port -t 120000 0.0.0.0:5001
}

function stop_app() {
kill -9 $(cat test-logs/e2e-test-env/simulation.pid)
# Incase the process pid file is not present
kill -9 $(lsof -t -i:5001)
kill -s TERM $(cat test-logs/e2e-test-env/simulation.pid)
}


Expand Down

0 comments on commit 8333cea

Please sign in to comment.