influxdata / influxdata/telegraf
Add tests for internal/snmp
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
## Feature Request
Opening a feature request kicks off a discussion.
### Proposal:
Add tests for [internal/snmp](https://pkg.go.dev/github.com/influxdata/telegraf/internal/snmp) package:
- [ ] `ClearCache`
- [ ] `GetIndex`
- [x] `LoadMibsFromPath` #10551
- [ ] `NewWrapper`
- [ ] `SetAgent`
- [ ] `SnmpTranslateCall`
- [x] `TrapLookup` #10430
Some of these are already covered by tests in plugin/inputs/snmp, but best is to test them at the correct place.
### Current behavior:
Changes in code do change behaviour of some plugins.
### Desired behavior:
Tests prevent changes in behaviour to the end-users.
Contributor guide
Research direction
Start by reading the internal/snmp package and the existing tests under plugin/inputs/snmp, since the issue notes that some functions are already covered there. Add package-level tests for the unchecked functions: ClearCache, GetIndex, NewWrapper, SetAgent, and SnmpTranslateCall. The work is done when these behaviors are covered without duplicating the completed LoadMibsFromPath and TrapLookup items.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100