mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-06 07:28:23 +00:00
Add a test helper that serves git repositories over HTTP using git's dumb HTTP protocol. This enables integration tests that need to fetch git data from an external URL without requiring a full git HTTP backend. Features: - Creates bare clone of source repository - Runs git update-server-info to generate required metadata - Serves static files over HTTP using hyper - Automatic cleanup on drop - Path traversal protection Tests included: - Server starts and stops correctly - info/refs endpoint is accessible - git ls-remote works against server - git fetch works against server - Path traversal is blocked This helper will be used in Phase 3 to test PR clone tag sync, where the PR event's clone URL points to an external git server that is NOT an ngit-grasp relay.
14 lines
393 B
Rust
14 lines
393 B
Rust
//! Common test utilities
|
|
#![allow(dead_code)] // Test helpers may not be used in all test configurations
|
|
#![allow(unused_imports)] // Re-exports may not be used in all test configurations
|
|
|
|
pub mod git_server;
|
|
pub mod purgatory_helpers;
|
|
pub mod relay;
|
|
pub mod sync_helpers;
|
|
|
|
pub use git_server::SimpleGitServer;
|
|
pub use purgatory_helpers::*;
|
|
pub use relay::TestRelay;
|
|
pub use sync_helpers::*;
|