bpf unit tests: Run tests on changes to pks/bpf/** #25911
Merged
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.
The Go program used to run the BPF unit tests has a few dependencies on other Cilium packages, namely:
In the past, we nearly merged a change that would break the unit tests, because the CI skipped the unit tests job for the related PR. The reason was that the changes didn't touch BPF files (or the runner's sources), but the way we collect programs and perform relocations from an ELF file in pkg/bpf/collection.go.
To avoid repeating this in the future, let's mark
pkg/bpf/**
updates as a trigger for the unit tests. The other dependency packages could be added too, but they seem less critical (and less likely to break the tests), so we leave them aside for now.Reference: #25837 (review)