googleapis / googleapis/google-cloud-cpp
Use a `MockRestClient` in `storage/tests/error_injection_integration_test`
- Ngôn ngữ chính
- C++
- Star
- 659
- Fork
- 462
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 89
Mô tả
This test does some low-level black magic to force a specific type of socket error.
1. The storage library should not be testing this, if anywhere, this belongs in the `RestClient` tests,
2. The storage library should just mock `RestClient` and assume it works.
Even if we decided to "move" these tests: it seems better to assume libcurl works, and just returns the right error code. If we want to make sure our wrappers work when libcurl returns the error codes corresponding to socket errors then (as libcurl cannot be easily mocked) we can use the testbench to force the error type we want.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách đọc storage/tests/error_injection_integration_test và xác định phần thiết lập lỗi socket cấp thấp. Thay thế dependency đó bằng một MockRestClient, đồng thời để việc bao phủ các mã lỗi của RestClient cho các test riêng của nó hoặc testbench, tùy trường hợp. Được xem là hoàn tất khi test storage không còn trực tiếp ép phát sinh lỗi socket và vẫn xác minh cách xử lý lỗi dự kiến.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- cpp
- Lĩnh vực
- testing
- Loại issue
- Tái cấu trúc
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100