[chores] Improve test suite
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 42
- Forks
- 18
- Avg merge
- 12h 54m
- Merged PRs (30d)
- 1
Description
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 withtest_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
.coveragercfile 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.SNMPare not tested directly intests.snmp.base.TestSNMPbut 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_interfacesinterfaces_MACinterfaces_speedinterfaces_stateinterfaces_bytesinterfaces_typeinterface_addr_and_mask
- The above point also applies on
netengine.backends.snmp.AirOS - Using snmpsim for mocking an SNMP device
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing tests.snmp.base.TestSNMP and the existing AirOS and OpenWrt backend tests. Check coverage for the listed OpenWRT and AirOS methods, then consider package-local tests and snmpsim for mocking. Done means the test organization and missing SNMP coverage have a decided, implemented approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100