Add failure simulation to training curriculum

Schema enhancement:
- Add failure_simulation property to validation section
- Define failure types: insufficient_funds, invalid_password, network_failure, invalid_resource, permission_denied, timeout
- Include recovery_operation for error handling tests

Stage 1 example:
- Add insufficient_funds test for wallet_send
- Add invalid_password test for wallet_send
- Add invalid_resource test for wallet_balance
This commit is contained in:
aitbc
2026-05-07 11:55:18 +02:00
parent 52e6e532a4
commit 19d6f61bfe
2 changed files with 70 additions and 0 deletions

View File

@@ -352,6 +352,42 @@
"coverage_report": true,
"passing_score": 80
},
"failure_simulation": [
{
"test_name": "Insufficient funds error",
"operation": "wallet_send",
"failure_type": "insufficient_funds",
"test_case": {
"wallet": "training-wallet",
"to": "recipient-address",
"amount": "1000000",
"password": "training123"
},
"expected_error": "Insufficient funds",
"recovery_operation": "wallet_balance"
},
{
"test_name": "Invalid password error",
"operation": "wallet_send",
"failure_type": "invalid_password",
"test_case": {
"wallet": "training-wallet",
"to": "recipient-address",
"amount": "10",
"password": "wrong-password"
},
"expected_error": "Invalid password"
},
{
"test_name": "Invalid wallet error",
"operation": "wallet_balance",
"failure_type": "invalid_resource",
"test_case": {
"wallet": "non-existent-wallet"
},
"expected_error": "Wallet not found"
}
],
"mock_data": {
"wallets": ["test-wallet-1", "test-wallet-2"],
"addresses": ["0x1234567890abcdef", "0x0987654321fedcba"],

View File

@@ -238,6 +238,40 @@
"type": "object",
"required": ["exam_tests", "passing_score"],
"properties": {
"failure_simulation": {
"type": "array",
"description": "Failure simulation tests to verify error handling",
"items": {
"type": "object",
"properties": {
"test_name": {
"type": "string",
"description": "Failure simulation test name"
},
"operation": {
"type": "string",
"description": "Operation to test with failure conditions"
},
"failure_type": {
"type": "string",
"enum": ["insufficient_funds", "invalid_password", "network_failure", "invalid_resource", "permission_denied", "timeout"],
"description": "Type of failure to simulate"
},
"test_case": {
"type": "object",
"description": "Test input parameters designed to trigger failure"
},
"expected_error": {
"type": "string",
"description": "Expected error message or error code"
},
"recovery_operation": {
"type": "string",
"description": "Operation to recover from failure (optional)"
}
}
}
},
"exam_tests": {
"type": "array",
"items": {