We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This issue is the follow-up to this conversation #3143 (comment)
The idea is to make a more simple use of the btfFile global variable in case we want to test multiple BTF files in a single test.
btfFile
I think what we can do here is using a callback to set the btfFile, then perform the test, and global variable like this.
func RunTestOnSingleBtf(t *testing.T, btfFname string, test func(t *testing.T)) { if err := btfFileExists(btfFname); err != nil { t.Fatal(err) } btfFile = btfFname t.Run(btfFname, test) btfFile = "" } func TestFindBtfFuncParamFromHook(t *testing.T) { RunTestOnSingleBtf(t, defaults.DefaultBTFFile, testFindBtfFuncParamFromHook) RunTestOnSingleBtf(t, "/path/to/my/btf/2", testFindBtfFuncParamFromHook) RunTestOnSingleBtf(t, "/path/to/my/btf/3", testFindBtfFuncParamFromHook) }
In FindBtfFuncParamFromHook we could also remove the use LoadBtf() by simply using NewBtf()
FindBtfFuncParamFromHook
tetragon/pkg/btf/btf.go
Lines 118 to 120 in fc759c4
Similarly we could refactor this below code by using such a function
tetragon/pkg/btf/validation_test.go
Lines 56 to 63 in fc759c4
@kkourt, do you think it's close enough to what you were thinking of ?
The text was updated successfully, but these errors were encountered:
@kkourt, do you think it's close enough to what you were thinking of? Yes, thanks for writing up!
Sorry, something went wrong.
LoadBtf()
Successfully merging a pull request may close this issue.
This issue is the follow-up to this conversation #3143 (comment)
The idea is to make a more simple use of the
btfFile
global variable in case we want to test multiple BTF files in a single test.I think what we can do here is using a callback to set the
btfFile
, then perform the test, and global variable like this.In
FindBtfFuncParamFromHook
we could also remove the use LoadBtf() by simply using NewBtf()tetragon/pkg/btf/btf.go
Lines 118 to 120 in fc759c4
Similarly we could refactor this below code by using such a function
tetragon/pkg/btf/validation_test.go
Lines 56 to 63 in fc759c4
@kkourt, do you think it's close enough to what you were thinking of ?
The text was updated successfully, but these errors were encountered: