Add batched linux bootstrap smoke · Entire
Add batched linux bootstrap smoke
eee02e3→main·
Soph·3mo ago·3 files·+26 added/-2 removed
Sessions
21576324299fView transcript
Changes
3
- MREADME.md+11
- internal/syncer
- Mlive_bootstrap_test.go+11/-2
- Mmise.toml+4
287 unmodified lines
That is useful for large-source relay and memory measurement checks while keeping the target local and disposable.
There is also a batched variant of the same Linux smoke:
```bash
env GOCACHE=/tmp/go-build GITSYNC_E2E_LIVE_LINUX=1 go test ./internal/syncer -run TestBootstrap_LiveLinuxSourceBatched -v
```
The `mise` tasks are:
- `mise run test:linux-smoke`
- `mise run test:linux-smoke:batched`
## Planned Bootstrap Path
There is a dedicated `bootstrap` command path for large initial syncs into an empty target. The intent is to relay a fetched source pack directly into target `receive-pack` instead of decoding the full object graph into local memory first.
`` 12 unmodified lines
const liveLinuxEnv = "GITSYNC_E2E_LIVE_LINUX"
func TestBootstrap_LiveLinuxSource(t *testing.T) { runLiveLinuxBootstrap(t, 0, "bootstrap") }
func TestBootstrap_LiveLinuxSourceBatched(t testing.T) { runLiveLinuxBootstrap(t, 5121024*1024, "bootstrap-batch") }
func runLiveLinuxBootstrap(t *testing.T, batchMaxPackBytes int64, wantRelayMode string) { if os.Getenv(liveLinuxEnv) == "" { t.Skip("set GITSYNC_E2E_LIVE_LINUX=1 to run the live linux bootstrap smoke test") }
Source: Endpoint{URL: "https://github.com/torvalds/linux.git"},
Target: Endpoint{URL: server.RepoURL("target.git")},
Branches: []string{"master"},
BatchMaxPackBytes: batchMaxPackBytes,
ProtocolMode: protocolModeAuto,
ShowStats: true,
MeasureMemory: true,
if result.Pushed != 1 {
t.Fatalf("expected one pushed ref, got %+v", result)
}
if !result.Relay || result.RelayMode != "bootstrap" {
t.Fatalf("expected bootstrap relay result, got %+v", result)
}
if !result.Relay || result.RelayMode != wantRelayMode {
t.Fatalf("expected %s relay result, got %+v", wantRelayMode, result)
}
if !result.Measurement.Enabled {
t.Fatalf("expected measurement to be enabled")
}
}
Minternal/syncer/live_bootstrap_test.go+11/-2
19 unmodified lines
description = "Run optional live linux bootstrap smoke test" run = "GITSYNC_E2E_LIVE_LINUX=1 go test ./internal/syncer -run TestBootstrap_LiveLinuxSource -timeout 60m -v"
[tasks."test:linux-smoke:batched"] description = "Run optional live linux batched bootstrap smoke test" run = "GITSYNC_E2E_LIVE_LINUX=1 go test ./internal/syncer -run TestBootstrap_LiveLinuxSourceBatched -timeout 60m -v"
[tasks.build] description = "Build git-sync" run = "go build ./cmd/git-sync"
Mmise.toml+4