Skip to content

Commit 319fc3b

Browse files
d-e-s-odanielocfb
authored andcommitted
Rename tests requiring root
We have some complicated and non-obvious logic for skipping certain tests when running cargo test from the root of the crate in CI, but then an explicit invocation from the libbpf-rs/ sub-directory attempting to run those skipped tests (now under sudo). Simplify the logic and hopefully make it somewhat more obvious by prefixing all tests that require root with `test_sudo_`. Note: this is a workaround for what I'd call a bug in Cargo. I opened rust-lang/cargo#12147 in the hopes that this will be addressed eventually (though I don't know how realistic that is). If we are still getting confusion even with this more explicit naming, we may want to consider moving (or copying) libbpf-rs's .cargo/ directory into the workspace root. Signed-off-by: Daniel Müller <[email protected]>
1 parent e0da4b6 commit 319fc3b

File tree

3 files changed

+60
-60
lines changed

3 files changed

+60
-60
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ jobs:
5757
- name: Build
5858
run: cargo build --profile=${{ matrix.profile }} --locked --verbose --workspace --exclude runqslower
5959
- name: Run tests
60-
# Skip BTF & map tests which require sudo
61-
run: cargo test --profile=${{ matrix.profile }} --locked --verbose --workspace --exclude runqslower -- --skip test_object --skip test_tc --skip test_map_info --include-ignored
62-
- name: Run BTF tests
63-
run: cd libbpf-rs && cargo test --profile=${{ matrix.profile }} --locked --verbose -- test_object test_tc
60+
# Skip tests which require sudo
61+
run: cargo test --profile=${{ matrix.profile }} --locked --verbose --workspace --exclude runqslower -- --skip test_sudo_ --include-ignored
62+
- name: Run root tests
63+
run: cd libbpf-rs && cargo test --profile=${{ matrix.profile }} --locked --verbose -- test_sudo_
6464

6565
build-minimum:
6666
name: Build using minimum versions of dependencies

0 commit comments

Comments
 (0)