docs: enhance benchmark command with business logic validation tests

- Add 2 ETH-based validation tests to benchmark script
- Validates ExecuteBacktest_With_ETH_FifteenMinutes_Data_Should_Return_LightBacktest
- Validates ExecuteBacktest_With_ETH_FifteenMinutes_Data_Second_File_Should_Return_LightBacktest
- Ensures performance optimizations don't break trading logic
- Update command documentation with comprehensive validation details
- All 3 validation levels must pass for benchmark success
This commit is contained in:
2025-11-11 12:32:56 +07:00
parent 578709d9b7
commit fc036bb7de
4 changed files with 65 additions and 33 deletions

View File

@@ -29,8 +29,8 @@ COMMIT_HASH=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
BRANCH_NAME=$(git branch --show-current 2>/dev/null || echo "unknown")
ENVIRONMENT="development"
# Run the performance test and capture output
echo "📊 Running performance test..."
# Run the main performance test and capture output
echo "📊 Running main performance test..."
TEST_OUTPUT=$(dotnet test src/Managing.Workers.Tests/Managing.Workers.Tests.csproj \
--filter "ExecuteBacktest_With_Large_Dataset_Should_Show_Performance_Telemetry" \
--verbosity minimal \
@@ -38,13 +38,29 @@ TEST_OUTPUT=$(dotnet test src/Managing.Workers.Tests/Managing.Workers.Tests.cspr
# Check if test passed
if echo "$TEST_OUTPUT" | grep -q "Passed.*1"; then
echo -e "${GREEN}Test passed!${NC}"
echo -e "${GREEN}Performance test passed!${NC}"
else
echo -e "${RED}Test failed!${NC}"
echo -e "${RED}Performance test failed!${NC}"
echo "$TEST_OUTPUT"
exit 1
fi
# Run business logic validation tests
echo "📊 Running business logic validation tests..."
VALIDATION_OUTPUT=$(dotnet test src/Managing.Workers.Tests/Managing.Workers.Tests.csproj \
--filter "ExecuteBacktest_With_ETH_FifteenMinutes_Data_Should_Return_LightBacktest|ExecuteBacktest_With_ETH_FifteenMinutes_Data_Second_File_Should_Return_LightBacktest" \
--verbosity minimal \
--logger "console;verbosity=detailed" 2>&1)
# Check if validation tests passed
if echo "$VALIDATION_OUTPUT" | grep -q "Passed.*2"; then
echo -e "${GREEN}✅ Business logic validation tests passed!${NC}"
else
echo -e "${RED}❌ Business logic validation tests failed!${NC}"
echo "$VALIDATION_OUTPUT"
exit 1
fi
# Extract performance metrics from the output - use more robust parsing
CANDLES_COUNT=$(echo "$TEST_OUTPUT" | grep "📈 Total Candles Processed:" | sed 's/.*: //' | sed 's/[^0-9]//g' | xargs)
EXECUTION_TIME=$(echo "$TEST_OUTPUT" | grep "⏱️ Total Execution Time:" | sed 's/.*: //' | sed 's/s//' | sed 's/,/./g' | awk '{print $NF}' | xargs | awk -F' ' '{if (NF==2) print ($1+$2)/2; else print $1}')