Perfect mocking mechanism

Đang mở
#591 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python, shell
Lĩnh vực
cli, testing-qa

Hướng nghiên cứu

Start by reading test_waiter.py and the existing subprocess mocking around Waiter, then review the linked flakiness issues for the real failure cases. Define a low-level mock for shell responses that models real tmux use cases while preserving existing real-tmux tests; done should include deterministic tests for Waiter behavior and a clear approach to optional real-session tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

Waiter (test_waiter) flakes a lot.

  • #373
  • #582
  • #583
  • #584

Proposal

For cases like Waiter, may we need an object to simulate shell responses perfectly for the sake of testing correct behavior of test_waiter.py

We're testing the correct behavior of Waiter

In this case, we want to be sure that in various instances, including simulated ones that are exact to real tmux use cases, waiter behaves as designed.

We want correct mocks

Examine mocking of subprocess responses. In the same way responses mocks requests, this would "tap in" at a low level, while also ensuring our existing tests using real tmux still work without any additional effort.

Maybe also permit real tests

Perhaps also allow e2e tests that use real tmux sessions in the backend too

We don't want to lose benefit of testing against real world scenarios:

  1. Existing fuzziness cause by environments, different shells
  2. Shell updates, OS updates
  3. Tmux updates
Ngôn ngữ chính
Python
Star
1.2k
Fork
127
Merge trung bình
2 giờ 13 phút
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của tmux-python/libtmux

Tất cả issue của tmux-python/libtmux

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.