Skip to content

Commit ea5a771

Browse files
committed
Once again, restore an AI's regression mess.
1 parent f959f59 commit ea5a771

File tree

4 files changed

+17
-75
lines changed

4 files changed

+17
-75
lines changed

install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ if [[ ! -f "pyproject.toml" ]] || [[ ! -d "src/swf_testbed_cli" ]]; then
1515
fi
1616

1717
# Check for required sibling directories
18-
PARENT_DIR=$(dirname "$(pwd)")
19-
SWF_COMMON_LIB="$PARENT_DIR/swf-common-lib"
20-
SWF_MONITOR="$PARENT_DIR/swf-monitor"
18+
SWF_PARENT_DIR=$(dirname "$(pwd)")
19+
export SWF_PARENT_DIR
20+
SWF_COMMON_LIB="$SWF_PARENT_DIR/swf-common-lib"
21+
SWF_MONITOR="$SWF_PARENT_DIR/swf-monitor"
2122

2223
echo "📁 Checking for required repositories..."
2324
if [[ ! -d "$SWF_COMMON_LIB" ]]; then

run_all_tests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ printf "\n%100s\n\n" | tr ' ' '*'
77
# Get the directory of the script
88
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
99

10-
# Use PARENT_DIR if set by install.sh, otherwise exit with error
11-
if [[ -z "$PARENT_DIR" ]]; then
12-
echo "❌ Error: PARENT_DIR not set"
10+
# Use SWF_PARENT_DIR if set by install.sh, otherwise exit with error
11+
if [[ -z "$SWF_PARENT_DIR" ]]; then
12+
echo "❌ Error: SWF_PARENT_DIR not set"
1313
echo " Please run install.sh from swf-testbed directory first"
1414
exit 1
1515
fi
@@ -18,10 +18,10 @@ fi
1818
REPOS=()
1919
while IFS= read -r -d '' dir; do
2020
REPOS+=("$(basename "$dir")")
21-
done < <(find "$PARENT_DIR" -maxdepth 1 -type d -name 'swf-*' -print0 | sort -z)
21+
done < <(find "$SWF_PARENT_DIR" -maxdepth 1 -type d -name 'swf-*' -print0 | sort -z)
2222

2323
for repo in "${REPOS[@]}"; do
24-
REPO_PATH="$PARENT_DIR/$repo"
24+
REPO_PATH="$SWF_PARENT_DIR/$repo"
2525
TEST_SCRIPT="$REPO_PATH/run_tests.sh"
2626
echo "--- Running tests for $repo ---"
2727
if [ -x "$TEST_SCRIPT" ]; then

run_tests.sh

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,17 @@ printf "\n%100s\n\n" | tr ' ' '*'
66

77
# Get the directory of the script
88
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
9-
VENV_DIR="$SCRIPT_DIR/.venv"
10-
REQS_TXT="$SCRIPT_DIR/requirements.txt"
11-
PYPROJECT="$SCRIPT_DIR/pyproject.toml"
129

13-
# If a virtual environment is already active, use it
14-
if [ -n "$VIRTUAL_ENV" ]; then
15-
echo "Using already active Python environment: $VIRTUAL_ENV"
16-
# Otherwise, try to activate the local venv if it exists
17-
elif [ -d "$VENV_DIR" ]; then
18-
echo "Activating Python environment from $VENV_DIR"
19-
source "$VENV_DIR/bin/activate"
20-
# If no environment is active and no venv exists, create a new venv
21-
else
22-
echo "No active Python environment found. Creating venv at $VENV_DIR."
23-
python3 -m venv "$VENV_DIR"
24-
source "$VENV_DIR/bin/activate"
25-
# Install dependencies if requirements.txt or pyproject.toml is present
26-
if [ -f "$REQS_TXT" ]; then
27-
echo "Installing dependencies from requirements.txt..."
28-
pip install -r "$REQS_TXT"
29-
elif [ -f "$PYPROJECT" ]; then
30-
echo "Installing dependencies from pyproject.toml..."
31-
pip install .[test]
32-
else
33-
echo "No requirements.txt or pyproject.toml found. Skipping dependency install."
34-
fi
10+
# Check if a virtual environment is active
11+
if [ -z "$VIRTUAL_ENV" ]; then
12+
echo "❌ Error: No Python virtual environment is active"
13+
echo " Please activate the swf-testbed virtual environment first:"
14+
echo " cd swf-testbed && source .venv/bin/activate"
15+
exit 1
3516
fi
3617

18+
echo "Using Python environment: $VIRTUAL_ENV"
19+
3720
# Run tests if the tests directory exists and is not empty
3821
if [ -d "$SCRIPT_DIR/tests" ] && [ "$(ls -A "$SCRIPT_DIR/tests" 2>/dev/null)" ]; then
3922
echo "Running pytest for swf-testbed..."

testbed_run_all.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)