Perfect mocking mechanism

Aperta
#591 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python, shell
Ambito
cli, testing-qa

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Python
Stelle
1.2k
Fork
127
Merge medio
2h 13m
PR unite (30g)
1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tmux-python/libtmux

Tutte le issue di tmux-python/libtmux

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.