#!/bin/bash # Bash script to run MarketAlly.AIPlugin.Learning tests # Usage: ./RunTests.sh [test-filter] [verbosity-level] TEST_FILTER=${1:-""} VERBOSITY=${2:-"normal"} COVERAGE=${3:-"false"} LOGGER=${4:-"false"} echo "๐Ÿงช Running MarketAlly.AIPlugin.Learning Tests" echo "=============================================" # Change to test project directory SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$SCRIPT_DIR" # Build the test project first echo "๐Ÿ”จ Building test project..." dotnet build --configuration Debug --verbosity quiet if [ $? -ne 0 ]; then echo "โŒ Build failed. Please fix compilation errors first." exit 1 fi echo "โœ… Build successful." # Prepare test command TEST_COMMAND="dotnet test --configuration Debug --verbosity $VERBOSITY --logger console" # Add test filter if specified if [ -n "$TEST_FILTER" ]; then TEST_COMMAND="$TEST_COMMAND --filter \"$TEST_FILTER\"" echo "๐Ÿ” Running tests with filter: $TEST_FILTER" fi # Add coverage collection if requested if [ "$COVERAGE" = "true" ]; then TEST_COMMAND="$TEST_COMMAND --collect:\"XPlat Code Coverage\"" echo "๐Ÿ“Š Code coverage collection enabled." fi # Add additional loggers if requested if [ "$LOGGER" = "true" ]; then TEST_COMMAND="$TEST_COMMAND --logger trx --logger html" echo "๐Ÿ“ Additional loggers enabled (TRX, HTML)." fi echo "" echo "๐Ÿš€ Executing: $TEST_COMMAND" echo "" # Execute the test command eval $TEST_COMMAND # Check test results if [ $? -eq 0 ]; then echo "" echo "โœ… All tests passed!" if [ "$COVERAGE" = "true" ]; then echo "๐Ÿ“Š Code coverage reports generated in TestResults folder." fi else echo "" echo "โŒ Some tests failed. Check the output above for details." exit 1 fi echo "" echo "๐Ÿ“ˆ Test Summary by Category:" echo " โ€ข SecurityService Tests: Security validation and sanitization" echo " โ€ข UnifiedContextService Tests: Revolutionary context integration" echo " โ€ข LLMContextService Tests: Intelligent code analysis" echo " โ€ข LearningOrchestrator Tests: End-to-end learning workflows" echo " โ€ข Configuration Tests: Settings validation and data annotations" echo " โ€ข Exception Tests: Custom exception hierarchy" echo " โ€ข Plugin Tests: Main plugin interface and integration" echo " โ€ข Integration Tests: Full service integration scenarios" echo ""