Merge pull request #56 from entireio/soph/ssh-e2e-docker · Entire
Merge pull request #56 from entireio/soph/ssh-e2e-docker
32e319d→main·
Soph·2mo ago·6 files·+338 added/-4 removed
Add Docker SSH end-to-end test
Changes
- docs
- Mtesting.md+11
- internal/syncer
- Assh_docker_test.go+298
- Msyncer.go+1/-1
- mise-tasks/lint
- Mgo+20/-3
- Mgomod+4
- Mmise.toml+4
31 unmodified lines
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
41 unmodified lines
89
90
91
92
93
94
95
31 unmodified lines
That test uses a real `git-http-backend` source/target pair and checks that a smaller `--target-max-pack-bytes` planning limit produces at least as many planned checkpoints as a larger one, while still planning to the branch tip.
## Docker SSH End-To-End Test
Optional end-to-end sync against a real `sshd` running in Docker:
```bash
env GOCACHE=/tmp/go-build GITSYNC_E2E_SSH_DOCKER=1 go test ./internal/syncer -run TestRun_SSHDockerSync -v
```
That path builds a disposable Docker image with `openssh-server` and `git`, mounts local bare source/target repositories into the container, configures a temporary SSH keypair plus an isolated SSH config passed via a wrapper `ssh` binary, and runs a real SSH-based sync through `git-upload-pack` / `git-receive-pack`.
## Live Linux Smokes
Optional live Linux bootstrap smoke:
- `mise run test` — default suite
- `mise run test:ci` — default suite with race detection
- `mise run test:git-http-backend` — `git-http-backend` end-to-end
- `mise run test:ssh-docker` — Docker-based SSH end-to-end
- `mise run test:linux-smoke` — live Linux bootstrap smoke
- `mise run test:linux-smoke:batched` — live Linux batched bootstrap smoke
Mdocs/testing.md+11
...
func TestRun_SSHDockerSync(t *testing.T) {
...
}
func writeSSHServerDockerContext(t *testing.T, dir string) {
t.Helper()
if err := os.MkdirAll(dir, 0o755); err != nil {
t.Fatalf("mkdir docker context: %v", err)
}
...
}