agentleFS
jhlee0409jhlee0409/proc-janitor/tests/AGENTS.md

proc-janitor / tests

AGENTS.md7 starsChanged 9 months agoMITView on GitHub

The file

We found no rules to list in this file: it reads as prose or reference rather than instructions.

Files
AGENTS.md
<!-- Parent: ../AGENTS.md --><!-- Generated: 2026-02-06 -->

tests

Purpose

Integration tests that invoke the compiled proc-janitor binary directly and verify CLI behavior.

Key Files

FileDescription
integration_test.rs25 integration tests covering all major CLI commands plus the reload/grace-period regression

For AI Agents

Working In This Directory

  • Tests invoke the compiled binary next to the test executable — cargo build must succeed first
  • binary_path() resolves the binary; sandbox() + pj(&home) run it against a private $HOME
  • Every test MUST use pj(&home), never Command::new(binary_path()). All state proc-janitor touches (~/.config/proc-janitor/config.toml, ~/.proc-janitor/{proc-janitor.pid,sessions.json,stats.jsonl,logs/}) derives from $HOME. Without the sandbox, tests mutate the developer's live state and race each other — a test that starts a daemon writes the PID file another test asserts is absent
  • Tests should not assume any specific config exists; write one into the sandbox if the test needs it
  • Tests should not kill unrelated processes — use nonexistent PIDs, unique markers, or own children

Testing Requirements

cargo build && cargo test --test integration_test

Test Coverage

TestWhat It Verifies
test_help_command--help exits 0, output contains "proc-janitor"
test_config_showconfig show outputs scan_interval
test_scan_commandscan exits 0
test_scan_json_output--json scan produces valid JSON with orphans and orphan_count
test_status_commandstatus handles daemon-not-running gracefully
test_session_listsession list exits 0
test_tree_commandtree exits 0
test_clean_commandclean exits 0
test_clean_with_pid_filterclean --pid 99999 exits 0
test_clean_with_pattern_filterclean --pattern nonexistent exits 0
test_reload_preserves_grace_periodRepeated config reloads do not restart an orphan's grace period (spawns a uniquely-marked PPID=1 probe, touches the config every 1s with grace_period = 3, asserts the probe is still terminated)
<!-- MANUAL: -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.