upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/common/mod.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-07 17:36:44 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-07 17:36:44 +0000
commite7c18cf2a96b1f45e5f21a83ee1fe2e18a6dc7e2 (patch)
treed0f6b3af68841658e7f1338990651aaf841fc469 /tests/common/mod.rs
parent42bf1196003c0b39179d8c9d2c07ecf9a83a4a74 (diff)
test: add SimpleGitServer helper for dumb HTTP git serving
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.
Diffstat (limited to 'tests/common/mod.rs')
-rw-r--r--tests/common/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/common/mod.rs b/tests/common/mod.rs
index f511163..e70bd71 100644
--- a/tests/common/mod.rs
+++ b/tests/common/mod.rs
@@ -2,10 +2,12 @@
2#![allow(dead_code)] // Test helpers may not be used in all test configurations 2#![allow(dead_code)] // Test helpers may not be used in all test configurations
3#![allow(unused_imports)] // Re-exports may not be used in all test configurations 3#![allow(unused_imports)] // Re-exports may not be used in all test configurations
4 4
5pub mod git_server;
5pub mod purgatory_helpers; 6pub mod purgatory_helpers;
6pub mod relay; 7pub mod relay;
7pub mod sync_helpers; 8pub mod sync_helpers;
8 9
10pub use git_server::SimpleGitServer;
9pub use purgatory_helpers::*; 11pub use purgatory_helpers::*;
10pub use relay::TestRelay; 12pub use relay::TestRelay;
11pub use sync_helpers::*; 13pub use sync_helpers::*;