Test: add comprehensive IPFIX coverage tests (+31.4% coverage)#137
Open
dmabry wants to merge 1 commit into
Open
Test: add comprehensive IPFIX coverage tests (+31.4% coverage)#137dmabry wants to merge 1 commit into
dmabry wants to merge 1 commit into
Conversation
Add 29 new tests targeting previously untested IPFIX code paths: Options Template & Data: - OptionsTemplateFlowSet.Generate (scope/data field validation) - OptionsDataFlowSet.Generate (record fields, FlowSetID) - GenerateOptionsDataIPFIX (process metadata, PID) - Options Data ToBytes serialization & buffer length verification - Options Template + Data combined roundtrip parsing Minimal IPFIX Profile: - MinimalIPFIXProfile.Name/TemplateFields - MinimalIPFIXFlow.Generate (IPv4, IPv6, all protocol ports) Extended IPFIX Profile: - ExtendedIPFIXProfile.Name/TemplateFields Generic IPFIX Profile: - GenericIPFIXProfile.Name - GenericFlow.Generate all 14 protocol port mappings Debug helpers: - Header.size(), Header.String() - TemplateFlowSet.size(), DataFlowSet.size() - GetIPFIXSizes() Edge cases: - IsValidIPFIX: too-short, empty, wrong version - UpdateTimeStamp: too-short, empty, payload preservation - DataFlowSet.Generate with zero flow count Coverage: 53.3% → 84.7% (+31.4 percentage points)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 29 new tests targeting previously untested IPFIX code paths, bringing package coverage from 53.3% → 84.7%.
New Tests (633 lines)
Options Template & Data
OptionsTemplateFlowSet.Generate— scope/data field validationOptionsDataFlowSet.Generate— record fields, FlowSetIDGenerateOptionsDataIPFIX— process metadata, PID verificationToBytesserialization & buffer length verificationMinimal IPFIX Profile
MinimalIPFIXProfile.Name/TemplateFieldsMinimalIPFIXFlow.Generate— IPv4, IPv6, all protocol portsExtended IPFIX Profile
ExtendedIPFIXProfile.Name/TemplateFieldsGeneric IPFIX Profile
GenericIPFIXProfile.NameGenericFlow.Generate— all 14 protocol port mappingsDebug Helpers
Header.size(),Header.String()TemplateFlowSet.size(),DataFlowSet.size()GetIPFIXSizes()Edge Cases
IsValidIPFIX: too-short, empty, wrong versionUpdateTimeStamp: too-short, empty, payload preservationDataFlowSet.Generatewith zero flow countCoverage Delta
OptionsDataFlowSet.GenerateGenerateOptionsDataIPFIXMinimalIPFIXFlow.GenerateMinimalIPFIXProfile.TemplateFieldsExtendedIPFIXProfile.TemplateFieldsHeader.size(),String()TemplateFlowSet.size()DataFlowSet.size()GetIPFIXSizes()ToBytesUpdateTimeStampVerified
go build✅go vet ./...✅go test -v ./ipfix/ -count 1✅ 29 new tests passinggo test -race ./...✅ No races detected