-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_all_precision_tests.sh
More file actions
executable file
·52 lines (42 loc) · 1.53 KB
/
run_all_precision_tests.sh
File metadata and controls
executable file
·52 lines (42 loc) · 1.53 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
#!/bin/bash
echo "=========================================="
echo "RUNNING ALL REBALANCE TESTS WITH PRECISION DETAILS"
echo "=========================================="
echo
# Array of all test scenarios
scenarios=("1" "2" "3a" "3b" "3c" "3d")
# Run each test and capture full output
for scenario in "${scenarios[@]}"; do
echo "================================================"
echo "SCENARIO $scenario TEST RESULTS"
echo "================================================"
# Run the test and capture output
output=$(flow test "cadence/tests/rebalance_scenario${scenario}_test.cdc" 2>&1)
# Check if test passed or failed
if echo "$output" | grep -q "PASS:"; then
status="✅ PASSED"
else
status="❌ FAILED"
fi
echo "Status: $status"
echo
echo "Precision Details:"
echo "------------------"
# Extract precision information
echo "$output" | grep -E "(Expected.*:|Actual.*:|Difference:|Precision Difference:|Percent Diff:|FAIL:|Cannot withdraw|Insufficient funds)" | tail -30
echo
echo "================================================"
echo
done
# Summary
echo "=========================================="
echo "SUMMARY"
echo "=========================================="
for scenario in "${scenarios[@]}"; do
output=$(flow test "cadence/tests/rebalance_scenario${scenario}_test.cdc" 2>&1)
if echo "$output" | grep -q "PASS:"; then
echo "Scenario $scenario: ✅ PASSED"
else
echo "Scenario $scenario: ❌ FAILED"
fi
done