Skip to content
Open
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
61 changes: 61 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Integration Test

on:
push:
branches: [main, "claude/**"]
pull_request:

jobs:
unit-test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

# internal/bpf and internal/collector embed compiled BPF objects
# (pbmon_bpf.o / pbmon_bpf_ringbuf.o) which are only produced by
# `make ebpf`. The unit-test job skips those two packages; the
# integration-test job covers them end-to-end.
- name: Run unit tests
run: go test -race -count=1 ./internal/model/... ./internal/store/... ./config/... ./ui/...

integration-test:
name: Integration test (eBPF)
runs-on: ubuntu-latest
# eBPF tracepoints require the BPF LSM / CAP_BPF. The standard
# ubuntu-latest runner runs as a passwordless-sudo user on a 5.15+ kernel,
# so `sudo ./pbmon test` works without a privileged container.
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Install clang / llvm
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends clang llvm

- name: Compile eBPF objects
run: make ebpf

- name: Build pbmon binary
run: make build

- name: Show kernel & tool versions
run: |
uname -r
clang --version | head -1
go version

# Raise the locked-memory limit before loading BPF maps.
- name: Run integration test
run: sudo -E ./pbmon test --duration 25s --web-port 0
timeout-minutes: 3
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,10 @@ zz_generated_*_test.go
vendordiff.patch

bin/

# eBPF compiled objects (generated by `make ebpf`)
internal/bpf/pbmon_bpf.o
internal/bpf/pbmon_bpf_ringbuf.o

# Go binary
/pbmon
Loading
Loading