Files
hakorune/tests/E2E_TESTS.md
Moe Charm 70af0fe566 feat: Add HTTP status tests and dynamic plugin documentation
- Add e2e_vm_http_status_404/500 tests to verify HTTP status handling
- ResultBox properly returns Ok(Response) for HTTP errors, Err for connection failures
- Create dynamic-plugin-flow.md documenting MIR→VM→Registry→Plugin flow
- Add vm-stats test files for HTTP 404/500 status codes
- Update net-plugin.md with HTTP error handling clarification
- Create E2E_TESTS.md documenting all E2E test behaviors
- Add mir-26-instruction-diet.md for MIR optimization plans
- Add vm-stats-cookbook.md for VM statistics usage guide
- Update MIR verifier to properly track self-assignment patterns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-23 16:33:32 +09:00

51 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# E2E Tests Documentation
最終更新: 2025-08-23
## E2E Plugin Net Tests (e2e_plugin_net.rs)
### HTTP Tests
#### 基本的なHTTP通信
- `e2e_http_ok_test` - 基本的なHTTP通信の成功ケース
- `e2e_http_post_and_headers` - POSTリクエストとヘッダー処理
- `e2e_http_empty_body` - 空ボディのレスポンス処理
- `e2e_http_multiple_requests_order` - 複数リクエストの順序処理
#### HTTPステータスコード処理
- `e2e_vm_http_status_404` - 404 Not Found レスポンス処理
- サーバーが404ステータスで応答 → クライアントは `Result.Ok(HttpResponseBox)` を受信
- `response.getStatus()` で 404、`response.readBody()` で "NF" を取得
- `e2e_vm_http_status_500` - 500 Internal Server Error レスポンス処理
- サーバーが500ステータスで応答 → クライアントは `Result.Ok(HttpResponseBox)` を受信
- `response.getStatus()` で 500、`response.readBody()` で "ERR" を取得
#### HTTPエラー処理
- `e2e_vm_http_client_error_result` - 接続失敗時のエラー処理
- ポート8099への接続失敗 → `Result.Err(ErrorBox)` を返す
- エラーメッセージ: "connect failed for 127.0.0.1:8099/nope"
### Socket Tests
- `e2e_socket_echo` - ソケットエコーサーバー
- `e2e_socket_timeout` - ソケットタイムアウト処理
## E2E Plugin Net Additional Tests (e2e_plugin_net_additional.rs)
### 高度なHTTPエラー処理
- `e2e_vm_http_client_error_result` - VM環境での接続エラー処理
- `e2e_vm_http_empty_body` - VM環境での空ボディ処理
## HTTPエラーハンドリングの重要な区別
### 接続失敗Transport Layer Error
- **状況**: サーバーに到達できないunreachable
- **結果**: `Result.Err(ErrorBox)`
- **例**: ポートが閉じている、ホストが存在しない
### HTTPステータスエラーApplication Layer Error
- **状況**: サーバーに到達したがアプリケーションエラー
- **結果**: `Result.Ok(HttpResponseBox)`
- **例**: 404 Not Found、500 Internal Server Error
- **理由**: トランスポート層は成功、HTTPプロトコルとして正常な応答
この区別により、ネットワークレベルのエラーとアプリケーションレベルのエラーを適切に処理できます。