Skip to content

Integration Tests for SSH Upload/ReceivePack Implementation

~Conversation: #218 (closed)

The SSH Upload/RecievePack implementation !132 (merged) does not have proper integration tests.

These need to be added.

We focus on cloning below but pushing should follow the same approach.

The test would roughly look like:

  • prepare test 'origin' repository
  • prepare directory in which to clone
  • run GIT_SSH_COMMAND='go run cmd/test_clone.go /path/to/gitaly-test-socket' git clone git@localhost:foo/bar.git /clone/path/bar.git
  • run a command in /clone/path/bar.git to verify that the repository is there

This way we can test SSH cloning without having to run an SSH server.

The idea is that cmd/test_clone.go acts as the Gitaly SSH client, sending stdin data to the gitaly socket and returning data on stdout/stderr. In a first pass we can fake this by using GIT_SSH_COMMAND='sh -c "exec git upload-pack /path/to/source.git"' to make sure the rest of the test works.

Edited by Jacob Vosmaer
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information