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
make: pick up all privileged tests in make tests-privileged
#10734
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.
Nice find!
a81cf0f
to
7c866ae
Compare
test-me-please |
Cherry-picked @christarazi's fix from #10729 to be able to run tests (commit fe4bbd5e3430f3768190c63870ae3e8e538c0d9f in this PR). |
This seems like an innocent mistake during #8954. #8954 (comment) Signed-off-by: Chris Tarazi <chris@isovalent.com>
As seen in #10729 some privileged tests currently aren't picked up by the `tests-privileged` rule because it expects the `privileged_tests` build tag to directly follow `+build`. However, some `*_test.go` files use additional build tags before that. Account for that when evaluating the privileged tests to run. At current `HEAD` this will pick up 3 more privileged test packages: ``` % grep --include='*.go' -ril '+build privileged_tests' . | wc -l 16 % grep --include='*.go' -ril '+build [^!]*privileged_tests' . | wc -l 19 ``` Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Fix the follow test build errors: ``` # github.com/cilium/cilium/pkg/sysctl [github.com/cilium/cilium/pkg/sysctl.test] pkg/sysctl/sysctl_linux_privileged_test.go:43:4: cannot use "1" (type string) as type []byte in field value pkg/sysctl/sysctl_linux_privileged_test.go:48:4: cannot use "1" (type string) as type []byte in field value pkg/sysctl/sysctl_linux_privileged_test.go:53:4: cannot use "1" (type string) as type []byte in field value pkg/sysctl/sysctl_linux_privileged_test.go:58:4: cannot use "1" (type string) as type []byte in field value pkg/sysctl/sysctl_linux_privileged_test.go:64:33: cannot use tc.value (type []byte) as type string in argument to writeSysctl ``` Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
7c866ae
to
ebd4b18
Compare
test-me-please |
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.
Nice! The build tags haven't been very fun to deal with as a newcomer :/
As seen in #10729 some privileged tests currently aren't picked up by
the
tests-privileged
rule because it expects theprivileged_tests
build tag to directly follow
+build
. However, some*_test.go
filesuse additional build tags before that. Account for that when evaluating
the privileged tests to run. At current
HEAD
this will pick up 3 moreprivileged test packages:
To be merged after #10729
/cc @joestringer @christarazi