-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add testnet cleanup on interrupted test run
- Introduced `_cleanup_testnet` function to handle testnet cleanup. - Modified the trap to call `_interrupted` function on SIGINT. - Added `pytest_keyboard_interrupt` hook to create a status file. - Updated `setup_venv.sh` to create venv only if it doesn't exist. - Enhanced `testenv_setup_teardown` to handle interrupted test runs.
- Loading branch information
Showing
3 changed files
with
67 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
#!/bin/bash | ||
|
||
VENV_DIR="${VENV_DIR:-"$WORKDIR/.env"}" | ||
_VENV_DIR="${_VENV_DIR:-"$WORKDIR/.env"}" | ||
|
||
if [ "${1:-""}" = "clean" ]; then | ||
rm -rf "$VENV_DIR" | ||
rm -rf "$_VENV_DIR" | ||
fi | ||
|
||
_REQS_INSTALLED="true" | ||
if [ ! -e "$_VENV_DIR" ]; then | ||
_REQS_INSTALLED="" | ||
python3 -m venv "$_VENV_DIR" | ||
fi | ||
|
||
python3 -m venv "$VENV_DIR" | ||
# shellcheck disable=SC1090,SC1091 | ||
. "$VENV_DIR/bin/activate" | ||
. "$_VENV_DIR/bin/activate" | ||
|
||
PYTHONPATH="$(echo "$VIRTUAL_ENV"/lib/python3*/site-packages):$PYTHONPATH" | ||
export PYTHONPATH | ||
|
||
pip install -r requirements_freeze.txt | ||
if [ -z "$_REQS_INSTALLED" ]; then | ||
pip install -r requirements_freeze.txt | ||
fi | ||
|
||
unset _VENV_DIR _REQS_INSTALLED |
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