nr-ebpf-agent: Add Comprehensive Global Value Inheritance Test Coverage #2021
+508
−21
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.
Overview
This PR adds comprehensive test coverage validating global value inheritance for the nr-ebpf-agent chart and fixes all pre-existing test failures. The chart uses the common-library pattern; this work adds explicit validation tests and fixes implementation bugs discovered during testing.
Changes
Fixed Pre-Existing Bugs
Cluster Name Test Path - Fixed env var path in test expectations
containers[1].env[0](doesn't exist)containers[0].env[10](DEPLOYMENT_NAME)Registry Doubling Bug - Fixed image path construction
docker.io/newrelic/...in repository fielddocker.io/docker.io/...newrelic/...)ebpf-agent Global Registry Support - Added common-library helper
.Values.ebpfAgent.image.repositorynewrelic.common.images.imagehelper for global.images.registry supportInvalid Test Removal - Removed test for non-existent container
containers[1](ebpfClient) but nr-ebpf-agent DaemonSet has only 1 containerAdded Global Value Support
global.serviceAccount.annotationssupport for OTel collector ServiceAccount (IRSA/Workload Identity/Pod Identity)global.proxysupport for OTel collector with proper precedenceglobal.fedramp.enabledsupport for gov endpoint selectionglobal.images.registrysupport for ebpf-agent container (via template fix)Added Comprehensive Global Value Inheritance Tests
tests/global_inheritance_test.yamlTest Results
Before This PR: 26/30 passing (86.7%) - 4 test failures
After This PR: 29/29 passing (100%) - All bugs fixed
Global Values Coverage
All 27 global values from the nri-bundle global contract assessed:
Legend:
Yes- Chart includes explicit helm-unittest test coverage with dedicated test casesN/A- Value hardcoded or not configurable (reason documented in Notes)No- Value not applicable to this chart typeTesting Approach: This chart validates applicable global values through helm-unittest tests. While common-library helpers handle implementation, each chart must independently validate that global values work in its specific context.
Files Modified
charts/nr-ebpf-agent/values.yaml- Removeddocker.io/prefix from image repositoriescharts/nr-ebpf-agent/templates/nr-ebpf-agent-daemonset.yaml- Updated to use common-library image helpercharts/nr-ebpf-agent/templates/otel-collector-daemonset.yaml- Added proxy support, FedRAMP endpoint selectioncharts/nr-ebpf-agent/templates/otel-collector-service-account.yaml- Added global.serviceAccount.annotations merge logiccharts/nr-ebpf-agent/templates/otel-collector-config.yaml- Leverages common-library verboseLog for debug loggingcharts/nr-ebpf-agent/tests/global_inheritance_test.yaml- Fixed test paths, removed invalid test, 29 comprehensive test casesNo Breaking Changes
Build Status
Changelog Entry