forked from XargonWan/Synthetic_Heart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·56 lines (47 loc) · 1.75 KB
/
run_tests.sh
File metadata and controls
executable file
·56 lines (47 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
set -e
# Ensure a local log directory is used
export LOG_DIR=${LOG_DIR:-./logs}
mkdir -p "$LOG_DIR"
if ! command -v uv >/dev/null 2>&1; then
echo "uv command not found. Installing uv with pip..."
python -m pip install --upgrade pip
python -m pip install uv
fi
echo "Syncing dependencies with uv..."
# Installs project dependencies from uv.lock/pyproject.toml
uv sync --frozen
echo "Installing test dependencies..."
# Installs pytest/asyncio into the environment explicitly
# (Since these might not be in your main pyproject.toml yet)
uv pip install pytest pytest-asyncio unittest-xml-reporting
# Run the tests but capture the exit code so the script itself always exits 0
set +e
echo "Running tests..."
# 'uv run' executes the script inside the environment we just prepped
uv run run_tests.py
TEST_EXIT=$?
set -e
# GitHub Actions output
if [ -n "$GITHUB_OUTPUT" ]; then
echo "result=$TEST_EXIT" >> "$GITHUB_OUTPUT"
fi
# GitHub Actions summary
if [ -n "$GITHUB_STEP_SUMMARY" ]; then
if [ $TEST_EXIT -eq 0 ]; then
echo "✅ Tests passed" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "## Test Results" >> "$GITHUB_STEP_SUMMARY"
echo "- Component loading: ✅ Verified" >> "$GITHUB_STEP_SUMMARY"
echo "- Message chain: ✅ Functional" >> "$GITHUB_STEP_SUMMARY"
echo "- Prompt generation: ✅ Valid JSON" >> "$GITHUB_STEP_SUMMARY"
echo "- Core validation: ✅ Working" >> "$GITHUB_STEP_SUMMARY"
else
echo "❌ Tests failed with exit code $TEST_EXIT" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "## Failed Tests" >> "$GITHUB_STEP_SUMMARY"
echo "Check the test output above for details." >> "$GITHUB_STEP_SUMMARY"
fi
fi
# Always succeed so CI can handle the result separately
exit 0