Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[chores] Improve test suite

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend, testing

Direzione di ricerca

Inizia esaminando tests.snmp.base.TestSNMP e i test esistenti dei backend AirOS e OpenWrt. Verifica la copertura dei metodi OpenWRT e AirOS elencati, quindi valuta l’uso di test locali al package e di snmpsim per il mocking. Il lavoro è completato quando è stato deciso e implementato un approccio per l’organizzazione dei test e per la copertura SNMP mancante.

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

Descrizione

Follow up to #48 / #46

  • Configure nose to automatically find test files. This will eliminate the need of importing modules in __init__.py. Prefixing test file names with test_ should do most of the work, (Done in #59)
  • Add tests for missing coverage. Most of the missing coverage can be easily tested. (To be done in #62)
  • Add .coveragerc file as done here: https://github.com/openwisp/openwisp-controller/blob/master/.coveragerc (Done in #59)
  • Use logger instead of print statements. Check if there's a difference between logger module of Python 2 and Python 3. If there is, delegate this to https://github.com/openwisp/netengine/issues/49 (Done in #59)

Open for discussion

  • Consider moving some tests inside the package like we do for other modules. This enables users to run or extend tests.
  • Currently most parts of netengine.backends.snmp.SNMP are not tested directly in tests.snmp.base.TestSNMP but they are tested in tests for AirOS and OpenWrt backend. Do we want to keep it this way or find a way to make tests more modular?
  • There is lack of proper tests for following methods of netengine.backends.snmp.OpenWRT:
    • get_interfaces
    • interfaces_MAC
    • interfaces_speed
    • interfaces_state
    • interfaces_bytes
    • interfaces_type
    • interface_addr_and_mask
  • The above point also applies on netengine.backends.snmp.AirOS
  • Using snmpsim for mocking an SNMP device
Lingua principale
Python
Stelle
42
Fork
18
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

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 openwisp/netengine

Tutte le issue di openwisp/netengine

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.