Skip to content

Add basic tests for stackwhere#4

Merged
dylandreimerink merged 1 commit intomainfrom
feature/basic-tests
May 7, 2026
Merged

Add basic tests for stackwhere#4
dylandreimerink merged 1 commit intomainfrom
feature/basic-tests

Conversation

@dylandreimerink
Copy link
Copy Markdown
Member

This commit adds basic tests for stackwhere. We use a simple C file with a few functions and inlined functions to test the call stack functionality of stackwhere.

@dylandreimerink dylandreimerink force-pushed the feature/basic-tests branch 2 times, most recently from 48a0b28 to 5c505a9 Compare May 7, 2026 14:20
@dylandreimerink dylandreimerink requested a review from Copilot May 7, 2026 14:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a small DWARF/BPF fixture and Go tests to validate stackwhere’s stack slot and total stack usage calculations, and wires the tests into CI.

Changes:

  • Add testdata/basic.c fixture (compiled to basic.o) intended to exercise stack slot reuse and inlining.
  • Add Go unit tests for getStackSlotUsage and getProgramStackUsage using testdata/basic.o.
  • Extend GitHub Actions CI to run go test and to enforce that generated testdata artifacts are up to date.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
testdata/Makefile Adds commands to (re)build the BPF fixture object(s).
testdata/basic.c Adds a C BPF fixture designed to produce predictable DWARF stack layout.
cmd/stackwhere/program_test.go Adds a unit test for stack slot grouping from DWARF.
cmd/stackwhere/collection_test.go Adds a unit test for total per-program stack usage.
.github/workflows/ci.yaml Adds go test and a job to ensure testdata outputs are current.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread testdata/Makefile Outdated
Comment thread .github/workflows/ci.yaml Outdated
Comment thread testdata/basic.c Outdated
Comment thread testdata/basic.c Outdated
Comment thread cmd/stackwhere/program_test.go Outdated
Comment thread testdata/basic.c Outdated
This commit adds basic tests for stackwhere. We use a simple C file with
a few functions and inlined functions to test the call stack
functionality of stackwhere.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
@dylandreimerink dylandreimerink merged commit e5481b2 into main May 7, 2026
3 checks passed
@dylandreimerink dylandreimerink deleted the feature/basic-tests branch May 7, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants