Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/unit-test-on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
run: make rust-tests
- name: Tests
run: make test TARGET_ARCH=${{ matrix.target_arch }}
- name: sudo tests
run: make sudo-tests

check-ebpf-blobs:
name: Check for differences in the eBPF binary blobs
Expand Down
190 changes: 190 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
members = [
"rust-crates/symblib",
"rust-crates/symblib-capi",
"rust-crates/custom-labels-example"
]
resolver = "2"

Expand Down
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ LDFLAGS := -X go.opentelemetry.io/ebpf-profiler/vc.version=$(VERSION) \
-extldflags=-static

GO_TAGS := osusergo,netgo
EBPF_FLAGS :=
EBPF_FLAGS :=

GO_FLAGS := -buildvcs=false -ldflags="$(LDFLAGS)"

Expand Down Expand Up @@ -117,6 +117,17 @@ vanity-import-fix: $(PORTO)
test: generate ebpf test-deps
go test $(GO_FLAGS) -tags $(GO_TAGS) ./...


SUDOTEST_DIRS := ./customlabelstest

target/release/custom-labels-example:
cargo build --release --bin custom-labels-example

sudo-tests: generate ebpf target/release/custom-labels-example
$(foreach test_dir, $(SUDOTEST_DIRS), \
sudo go test $(GO_FLAGS) -tags $(GO_TAGS) "$(test_dir)" \
)

TESTDATA_DIRS:= \
nativeunwind/elfunwindinfo/testdata \
libpf/pfelf/testdata \
Expand All @@ -127,9 +138,12 @@ test-deps:
($(MAKE) -C "$(testdata_dir)") || exit ; \
)

TEST_INTEGRATION_BINARY_DIRS := tracer processmanager/ebpf support
TEST_INTEGRATION_BINARY_DIRS := tracer processmanager/ebpf support go_labels

integration-test-binaries: generate ebpf
# Call it a ".test" even though it isn't to get included into bluebox initramfs
GOTOOLCHAIN=go1.23.7 go build -tags $(GO_TAGS) -o ./support/go_labels_canary1.23.test ./go_labels
GOTOOLCHAIN=go1.24.1 go build -tags $(GO_TAGS) -o ./support/go_labels_canary1.24.test ./go_labels
$(foreach test_name, $(TEST_INTEGRATION_BINARY_DIRS), \
(go test -ldflags='-extldflags=-static' -trimpath -c \
-tags $(GO_TAGS),static_build,integration \
Expand Down
Loading
Loading