Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,3 @@ For automated contributors specifically:
- Integration tests stay in the crate's `tests/` directory.
- OpenHuman's `scripts/externalize-inline-tests.mjs <repo-root> --write` moves
inline test modules out mechanically; without `--write` it only reports.
- Existing `test.rs` and `<module>_test.rs` files predate this rule. Rename each
to `<module>_tests.rs` (keep its `mod` name, add the `#[path]` attribute) the
next time you touch it.
1 change: 1 addition & 0 deletions crates/tinybox-cli/src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,4 +1255,5 @@ where
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
Comment on lines +1258 to 1259

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Rename the test module identifiers too

The compatibility note permitting renamed files to retain mod test is removed in this commit, but this declaration—and the other renamed declarations—still uses the legacy singular identifier. Complete the migration by declaring mod tests (and similarly renaming forward_test, classify_test, and scan_test) so the resulting source follows the repository's required test-module form.

AGENTS.md reference: AGENTS.md:L315-L324

Useful? React with 👍 / 👎.

1 change: 1 addition & 0 deletions crates/tinybox-cli/src/document/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ pub(crate) fn write<T: Serialize>(path: &Path, value: &T) -> Result<()> {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-cli/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,5 @@ struct Lock {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-cli/src/templates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ impl Templates for FileTemplates {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-core/src/capability/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,5 @@ impl SandboxCapabilities {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-core/src/clock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,5 @@ impl Clock for FixedClock {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-core/src/detach/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,5 @@ pub fn stop(process: &ProcessId, grace: std::time::Duration) -> ExecRequest {
pub const DEFAULT_GRACE: std::time::Duration = std::time::Duration::from_secs(5);

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-core/src/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,5 @@ impl Error {
pub type Result<T> = std::result::Result<T, Error>;

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-core/src/identity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ fn validate(kind: &'static str, value: &str) -> Result<()> {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-core/src/passthrough/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,5 @@ impl Sandbox for PassthroughSandbox {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
2 changes: 2 additions & 0 deletions crates/tinybox-core/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use crate::spec::BoxSpec;

mod forward;
#[cfg(test)]
#[path = "forward_tests.rs"]
mod forward_test;
mod types;

Expand Down Expand Up @@ -223,4 +224,5 @@ pub trait Sandbox: std::fmt::Debug + Send + Sync + 'static {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
3 changes: 3 additions & 0 deletions crates/tinybox-core/src/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ pub mod executor;
pub mod scan;

#[cfg(test)]
#[path = "classify_tests.rs"]
mod classify_test;
#[cfg(test)]
#[path = "scan_tests.rs"]
mod scan_test;
#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-core/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,5 @@ impl BoxSpec {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-core/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,5 @@ impl Store for MemoryStore {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-core/src/template/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,5 @@ impl Templates for MemoryTemplates {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-docker/src/oneshot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,5 @@ fn cap(text: &mut String, note: &str) {
}

#[cfg(all(test, unix))]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-docker/src/sandbox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,5 @@ impl Sandbox for DockerSandbox {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-host/src/local/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,5 @@ impl LocalHost {
const EXIT_CODE_UNAVAILABLE: i32 = 128;

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-linux/src/sandbox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,5 @@ impl Sandbox for NamespaceSandbox {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-microvm/src/cpio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ fn pad(out: &mut Vec<u8>) {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-microvm/src/sandbox/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,5 @@ async fn write(host: &dyn Host, path: &str, bytes: &[u8]) -> Result<()> {
}

#[cfg(test)]
#[path = "config/config_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-microvm/src/sandbox/guest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,5 @@ pub(super) fn parse_console(console: &str, sandbox: &str) -> Result<(String, i32
}

#[cfg(test)]
#[path = "guest/guest_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-microvm/src/sandbox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,5 @@ impl Sandbox for MicroVmSandbox {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-module/src/tinybus_module/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ tinybus_module::module_export_optional_static! {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-ssh/src/host/forward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,5 @@ fn exit_diagnostic(tunnel: &mut SshTunnel) -> String {
}

#[cfg(test)]
#[path = "forward/forward_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-ssh/src/host/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,5 @@ impl Host for SshHost {
const LOCAL_HOST_NAME: &str = "local";

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-sync/src/exclude/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,5 @@ impl Exclusions {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-sync/src/fingerprint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ pub(crate) struct Entry {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinybox-sync/src/transfer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,5 @@ pub fn default_destination(name: &str) -> PathBuf {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
Loading