Skip to content

Commit 31786e9

Browse files
author
SentienceDEV
committed
fix tests
1 parent 34dce91 commit 31786e9

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

.github/workflows/test.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ jobs:
3030
playwright install chromium
3131
3232
- name: Install dependencies
33+
shell: bash
3334
run: |
3435
pip cache purge || true
3536
pip uninstall -y sentienceapi || true
36-
# Clean any bytecode cache
37-
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
38-
find . -type f -name "*.pyc" -delete 2>/dev/null || true
37+
# Clean any bytecode cache (cross-platform Python approach)
38+
python -c "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.pyc')]" || true
39+
python -c "import pathlib, shutil; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('__pycache__') if p.is_dir()]" || true
3940
pip install --no-cache-dir -e ".[dev]"
4041
pip install pre-commit mypy types-requests
4142
@@ -50,17 +51,31 @@ jobs:
5051
- name: Verify source code
5152
shell: bash
5253
run: |
53-
echo "=== Checking agent_runtime.py line 345 ==="
54-
sed -n '340,350p' sentience/agent_runtime.py
55-
echo "=== Verifying assert_ method exists ==="
56-
grep -n "def assert_" sentience/agent_runtime.py
57-
echo "=== Checking for assertTrue (should NOT exist) ==="
58-
if grep -n "assertTrue" sentience/agent_runtime.py; then
59-
echo "ERROR: Found assertTrue - this should have been removed!"
60-
exit 1
61-
else
62-
echo "Good: no assertTrue found"
63-
fi
54+
python << 'EOF'
55+
# Check agent_runtime.py line 345
56+
print("=== Checking agent_runtime.py line 345 ===")
57+
with open('sentience/agent_runtime.py', 'r', encoding='utf-8') as f:
58+
lines = f.readlines()
59+
print(''.join(lines[339:350]))
60+
61+
# Verify assert_ method exists
62+
print("\n=== Verifying assert_ method exists ===")
63+
with open('sentience/agent_runtime.py', 'r', encoding='utf-8') as f:
64+
lines = f.readlines()
65+
for i, line in enumerate(lines, 1):
66+
if 'def assert_' in line:
67+
print(f'{i}:{line}', end='')
68+
69+
# Check for assertTrue (should NOT exist)
70+
print("\n=== Checking for assertTrue (should NOT exist) ===")
71+
with open('sentience/agent_runtime.py', 'r', encoding='utf-8') as f:
72+
content = f.read()
73+
if 'assertTrue' in content:
74+
print('ERROR: Found assertTrue - this should have been removed!')
75+
exit(1)
76+
else:
77+
print('Good: no assertTrue found')
78+
EOF
6479
6580
- name: Lint with pre-commit
6681
continue-on-error: true

0 commit comments

Comments
 (0)