Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[chores] Improve test suite

Đang mở
#60 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend, testing

Hướng nghiên cứu

Bắt đầu bằng cách xem xét tests.snmp.base.TestSNMP và các bài kiểm thử backend AirOS và OpenWrt hiện có. Kiểm tra mức độ bao phủ của các phương thức OpenWRT và AirOS được liệt kê, sau đó cân nhắc các bài kiểm thử cục bộ trong package và snmpsim để mocking. Công việc được xem là hoàn tất khi đã quyết định và triển khai một cách tiếp cận cho việc tổ chức kiểm thử và phần bao phủ SNMP còn thiếu.

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

Mô tả

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
Ngôn ngữ chính
Python
Star
42
Fork
18
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

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

Tất cả issue của openwisp/netengine

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.