Skip to content

Commit 3e31d41

Browse files
author
James Zhu
committed
Update test files to support Qwen integration and improve test configurations
- Add Qwen support to skill app types - Update test configurations to use proper endpoint structures - Improve security validation tests - Rename and update test scripts - Add comprehensive test runner script - Fix tool integration tests
1 parent a77bbd3 commit 3e31d41

14 files changed

Lines changed: 367 additions & 153 deletions

tests/run_comprehensive_tests.sh

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#!/bin/bash
2+
3+
# Script to run all Python test files individually and report results
4+
echo "Starting comprehensive test execution..."
5+
echo "======================================"
6+
7+
# Find all test files and store them in an array
8+
TEST_FILES=($(find . -type f -name "*test*.py" | grep -v .venv | sort))
9+
10+
# Counter for tracking
11+
TOTAL_TESTS=${#TEST_FILES[@]}
12+
PASSED_TESTS=0
13+
FAILED_TESTS=0
14+
SKIPPED_TESTS=0
15+
FAILED_LIST=()
16+
17+
echo "Found $TOTAL_TESTS test files to execute."
18+
echo ""
19+
20+
# Loop through each test file
21+
for i in "${!TEST_FILES[@]}"; do
22+
test_file="${TEST_FILES[$i]}"
23+
echo "[$((i+1))/$TOTAL_TESTS] Running: $test_file"
24+
25+
# Execute the test
26+
result=$(python -m pytest "$test_file" -v 2>&1)
27+
exit_code=$?
28+
29+
if [ $exit_code -eq 0 ]; then
30+
# Check if the test passed by looking for "passed" in output
31+
if echo "$result" | grep -q "failed"; then
32+
echo " ❌ FAILED - has failed tests"
33+
FAILED_TESTS=$((FAILED_TESTS + 1))
34+
FAILED_LIST+=("$test_file")
35+
elif echo "$result" | grep -q "passed"; then
36+
echo " ✅ PASSED"
37+
PASSED_TESTS=$((PASSED_TESTS + 1))
38+
else
39+
echo " ⚠️ SKIPPED or NO TESTS"
40+
SKIPPED_TESTS=$((SKIPPED_TESTS + 1))
41+
fi
42+
else
43+
echo " ❌ FAILED - execution error"
44+
FAILED_TESTS=$((FAILED_TESTS + 1))
45+
FAILED_LIST+=("$test_file")
46+
fi
47+
48+
# Show summary of this test run if it has results
49+
if echo "$result" | grep -q "passed\|failed\|skipped"; then
50+
passed_count=$(echo "$result" | grep -o "[0-9]\+ passed" | head -1 | grep -o "[0-9]\+")
51+
failed_count=$(echo "$result" | grep -o "[0-9]\+ failed" | head -1 | grep -o "[0-9]\+")
52+
skipped_count=$(echo "$result" | grep -o "[0-9]\+ skipped" | head -1 | grep -o "[0-9]\+")
53+
54+
[[ -z "$passed_count" ]] && passed_count=0
55+
[[ -z "$failed_count" ]] && failed_count=0
56+
[[ -z "$skipped_count" ]] && skipped_count=0
57+
58+
echo " Summary: $passed_count passed, $failed_count failed, $skipped_count skipped"
59+
fi
60+
echo ""
61+
done
62+
63+
# Final summary
64+
echo "======================================"
65+
echo "COMPREHENSIVE TEST EXECUTION COMPLETE"
66+
echo "======================================"
67+
echo "Total tests executed: $TOTAL_TESTS"
68+
echo "✅ Passed: $PASSED_TESTS"
69+
echo "❌ Failed: $FAILED_TESTS"
70+
echo "⚠️ Skipped/No tests: $SKIPPED_TESTS"
71+
echo ""
72+
73+
if [ $FAILED_TESTS -gt 0 ]; then
74+
echo "Failed tests:"
75+
for failed_test in "${FAILED_LIST[@]}"; do
76+
echo " - $failed_test"
77+
done
78+
echo ""
79+
exit 1
80+
else
81+
echo "🎉 All tests passed!"
82+
exit 0
83+
fi

tests/test_cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ def test_cli_help_contains_install_command(self):
4646

4747
def test_cli_version(self, runner):
4848
"""Test 'version' command."""
49+
from code_assistant_manager import __version__
4950
result = runner.invoke(app, ["version"])
5051
assert result.exit_code == 0
5152
version_output = result.stdout
5253
assert "code-assistant-manager" in version_output
53-
assert "1.1.0" in version_output, "Version command should output 1.1.0"
54+
assert __version__ in version_output, f"Version command should output {__version__}"
5455

5556
def test_cli_no_arguments(self):
5657
"""Test CLI with no arguments."""

0 commit comments

Comments
 (0)