Skip to content

Commit debfc02

Browse files
committed
feat(man): re-enable man sync test with runtime dependency check
Re-enable the `man` test with a `which` check that panics with a diagnostic message and `TEST_SKIP` hint when `man` is not installed, following the same pattern as `fs_errors` and `cross_device_excludes_mount`. Add `man-db` to CI's external test dependency installation step and document it in CONTRIBUTING.md alongside the existing FUSE dependencies. https://claude.ai/code/session_01CrXuWDMVQsiUBoy6ceACsF
1 parent a9facf0 commit debfc02

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
if: runner.os == 'Linux'
4747
run: |
4848
sudo apt update
49-
sudo apt install -y squashfs-tools squashfuse fuse3
49+
sudo apt install -y squashfs-tools squashfuse fuse3 man-db
5050
5151
- name: Test (dev)
5252
shell: bash

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ Some integration tests require external (non-Cargo) tools that are **not** manag
358358
- `squashfs-tools` (provides `mksquashfs`) — cross-device (`--one-file-system`) FUSE test
359359
- `squashfuse` (provides `squashfuse`) — cross-device (`--one-file-system`) FUSE test
360360
- `fuse3` (provides `fusermount3`, `/dev/fuse`) — cross-device (`--one-file-system`) FUSE test
361+
- `man-db` (provides `man`) — man page sync test
361362

362363
Tests that need these tools will panic with a diagnostic message if they are missing. The panic message includes the specific `TEST_SKIP` variable to skip the test via `./test.sh`.
363364

tests/sync_man_page.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ fn roff() {
4040
}
4141

4242
#[test]
43-
#[ignore = "requires man(1); run with --include-ignored to check"]
4443
fn man() {
44+
if which::which("man").is_err() {
45+
panic!(
46+
"{}\n{}",
47+
"error: This test requires `man` but it was not found.",
48+
"hint: Install `man-db` for your platform, \
49+
or rerun via `TEST_SKIP='man' ./test.sh` to skip this test.",
50+
);
51+
}
4552
check("man", "1");
4653
}

0 commit comments

Comments
 (0)