summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2021-05-19 18:14:05 +0100
committerSean McGivern <sean@gitlab.com>2021-05-20 16:19:17 +0000
commit2600bf7ac3b70e7df0e164087241bfda0b73ea8f (patch)
treea340747a59851134feff42a5a2ff9276f7a02306
parentb13bc6e5141ce5a45469c8ab0aa888badcedd9b5 (diff)
downloadgitlab-shell-2600bf7ac3b70e7df0e164087241bfda0b73ea8f.tar.gz
Set up a test Gitaly server in CI and provide a docker-compose file
-rw-r--r--.gitlab-ci.yml7
-rw-r--r--README.md14
-rw-r--r--docker-compose.yml8
3 files changed, 29 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3210b35..5f8dca5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -30,6 +30,8 @@ default:
- gitlab-org-docker
.test:
+ variables:
+ GITALY_CONNECTION_INFO: '{"address":"tcp://gitaly:8075", "storage":"default"}'
before_script:
# Set up the environment to run integration tests (still written in Ruby)
- apt-get update -qq && apt-get install -y ruby ruby-dev
@@ -42,6 +44,11 @@ default:
- cp config.yml.example config.yml
- go version
- which go
+ services:
+ - name: registry.gitlab.com/gitlab-org/build/cng/gitaly:latest
+ # Disable the hooks so we don't have to stub the GitLab API
+ command: ["bash", "-c", "mkdir -p /home/git/repositories && rm -rf /srv/gitlab-shell/hooks/* && exec /usr/bin/env GITALY_TESTING_NO_GIT_HOOKS=1 /scripts/process-wrapper"]
+ alias: gitaly
script:
- make verify test
diff --git a/README.md b/README.md
index 0fe39e3..3231646 100644
--- a/README.md
+++ b/README.md
@@ -60,6 +60,20 @@ Run both test and verify (the default Makefile target):
bundle install
make validate
+### Gitaly
+
+Some tests need a Gitaly server. The
+[`docker-compose.yml`](./docker-compose.yml) file will run Gitaly on
+port 8075. To tell the tests where Gitaly is, set
+`GITALY_CONNECTION_INFO`:
+
+ export GITALY_CONNECTION_INFO='{"address": "tcp://localhost:8075", "storage": "default"}'
+ make test
+
+If no `GITALY_CONNECTION_INFO` is set, the test suite will still run, but any
+tests requiring Gitaly will be skipped. They will always run in the CI
+environment.
+
## Git LFS remark
Starting with GitLab 8.12, GitLab supports Git LFS authentication through SSH.
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..28ab3cf
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,8 @@
+version: '3.1'
+services:
+ gitaly:
+ environment:
+ - GITALY_TESTING_NO_GIT_HOOKS=1
+ image: registry.gitlab.com/gitlab-org/build/cng/gitaly:latest
+ ports:
+ - '8075:8075'