feat(infra-monitoring): v2 daemonsets integration tests - #11442
Merged
Conversation
… infraM/v2_endpoints_integration_tests
…ods_integration_tests
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ods_integration_tests
…integration_tests
…paces_integration_tests
…s_integration_tests
- rename groupby_namespace -> test_statefulsets_groupby, parametrize over k8s.statefulset.name + k8s.namespace.name; adds the statefulset-name-in-groupBy branch (statefulSetName populated) that the other endpoints all cover Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- rename groupby_namespace -> test_jobs_groupby, parametrize over k8s.job.name + k8s.namespace.name; adds the job-name-in-groupBy branch (jobName populated) that the other endpoints all cover Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…integration_tests
- rename groupby_namespace -> test_daemonsets_groupby, parametrize over k8s.daemonset.name + k8s.namespace.name; adds the daemonset-name-in-groupBy branch (daemonSetName populated) that the other endpoints all cover Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nikhilmantri0902
requested review from
a team,
srikanthccv and
vikrantgupta25
as code owners
June 9, 2026 06:48
…paces_integration_tests
…clusters_integration_tests
…lumes_integration_tests
…loyments_integration_tests
…_statefulsets_integration_tests
…2_jobs_integration_tests
…sets_integration_tests
therealpandey
approved these changes
Jun 15, 2026
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.
Pull Request
📄 Summary
First end-to-end integration tests for
POST /api/v2/infra_monitoring/daemonsets.Screenshots / Screen Recordings (if applicable)
N/A — backend test addition; no UI.
Issues closed by this PR
Part of https://github.com/SigNoz/engineering-pod/issues/4980
✅ Change Type
🐛 Bug Context
N/A — not a bug fix.
🧪 Testing Strategy
53 tests across 21 functions in
tests/integration/tests/inframonitoring/10_daemonsets.py+ 9 JSONL datasets + 1 expected-values JSON (generated bytests/gen_daemonsets_datasets.py).test_daemonsets_happy_path— shape, 11 record fields (daemonSetName, 6 float metrics,desiredNodes/currentNodesasint,podCountsByPhase,meta); meta carriesk8s.daemonset.name/k8s.namespace.name/k8s.cluster.nametest_daemonsets_value_accuracy— exact 6 float metric values + node counts + phase counts. Locks in Sum vs Avg split: cpu/memory = SpaceAggregationSum; cpu_request/limit + memory_request/limit =SpaceAggregationAvg; desired/current = latest-summed. v1/v2 parity confirmed by code reading (
pkg/query-service/app/inframetrics/daemonsets.go:21-90↔pkg/modules/inframonitoring/implinframonitoring/daemonsets_constants.go:24-242)test_daemonsets_missing_metrics— seed onlyk8s.pod.cpu.usage, other 8 of 9 required metrics flagged → records=[], total=0test_daemonsets_filter_and / in / not_in / contains— each QB v5 operatortest_daemonsets_filter_combos×4 — AND+IN, AND+NOT IN, AND+CONTAINS, IN+CONTAINStest_daemonsets_filter_bad_attr_name,test_daemonsets_filter_bad_grammar×2 — 400 pathstest_daemonsets_pod_phase_aggregation— 4 Running + 1 Pending + 2 Failedtest_daemonsets_desired_current_counts— desired=5, current=3 (node-scheduling lag — DS targets 5 nodes, only 3 currently scheduled), 2 Running pods seeded. Locks ininttyping + distinguishesnode counts from phase counts
test_daemonsets_base_filter_drops_non_daemonset_pods— seed 1 DS pod + 1 standalone + 1 Deployment pod + 1 StatefulSet pod; only the real DS row appears. DocumentsdaemonSetsBaseFilterExpr(
daemonsets_constants.go:10,:63-69)test_daemonsets_groupby_namespace—groupBy=[k8s.namespace.name]→ 2 records,daemonSetName="", meta surfacesk8s.namespace.nametest_daemonsets_pagination_sync— K=7, limit=3, offsets {0,3,6}: page invariants, total invariant, full partitiontest_daemonsets_offset_beyond_total— empty records, total unchangedtest_daemonsets_total_invariant_across_orderby— 8 metric columns × 2 directions = 16 calls,total==Ktest_daemonsets_orderby_correctness×16 — 8 columns (cpu,cpu_request,cpu_limit,memory,memory_request,memory_limit,desired_nodes,current_nodes) × 2 directions. Exercises everyentry in
orderByToDaemonSetsQueryNamestest_daemonsets_orderby_by_daemonset_name×2 — metadata-name branch (PaginateMetadataByName)test_daemonsets_validation_errors×12 — allValidate()rules includingorderBy=k8s.daemonset.name+ non-empty groupBy rejectiontest_daemonsets_auth×2 — 401 no token, 200 adminManual verification:
📝 Changelog
📋 Checklist
👀 Notes for Reviewers