New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elf: skip BenchmarkWriteELF if ELF file wasn't built #17536
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @tklauser!
f4c26f2
to
d8f5ac4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM++ with one comment. Thank you @tklauser!
d8f5ac4
to
6073db5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM++ 👏🏿🤙🏾🎉 let's ship it, thank you @tklauser!
When running `go test -run=^$ -bench=. ./...` on the Cilium source, BenchmarkWriteELF currently fails with: --- FAIL: BenchmarkWriteELF elf_test.go:201: failed to open ELF file ../../test/bpf/elf-demo.o: open ../../test/bpf/elf-demo.o: no such file or directory That particular file is only built when running tests/benchmarks using the Makefile-based flow. In order to still allow Cilium's benchmarks suite to run without errors when invoked using native `go test -bench`, just skip BenchmarkWriteELF if the ELF file doesn't exist. In the future we might want to embed that ELF file into the test/benchmark itself using bpf2go [1]. [1] https://pkg.go.dev/github.com/cilium/ebpf/cmd/bpf2go For cilium#17535 Reported-by: Emmanuel T Odeke <emmanuel@orijtech.com> Signed-off-by: Tobias Klauser <tobias@cilium.io>
6073db5
to
6ef84f6
Compare
Reviews are in. Travis CI and GH actions passed, no need to run full CI. Marking as ready to merge. |
This will skip the test when running the tests standalone (i.e. via `go test` and not via Makefile). See cilium#17536 for more details about this particular file, which applied the same principle to the benchmark in that test suite. See also cilium#16914 Reported-by: Hemanth Malla <hemanth.malla@datadoghq.com> Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
This will skip the test when running the tests standalone (i.e. via `go test` and not via Makefile). See #17536 for more details about this particular file, which applied the same principle to the benchmark in that test suite. See also #16914 Reported-by: Hemanth Malla <hemanth.malla@datadoghq.com> Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
When running
go test -run=^$ -bench=. ./...
on the Cilium source,BenchmarkWriteELF currently fails with:
That particular file is only built when running tests/benchmarks using
the Makefile-based flow. In order to still allow Cilium's benchmarks
suite to run without errors when invoked using native
go test -bench
,just skip BenchmarkWriteELF if the ELF file doesn't exist.
In the future we might want to embed that ELF file into the
test/benchmark itself using bpf2go [1].
[1] https://pkg.go.dev/github.com/cilium/ebpf/cmd/bpf2go
For #17535