Commit 726cd4f9 authored by Alessio Caiazza's avatar Alessio Caiazza Committed by Quang-Minh Nguyen

Run workhorse-gitaly integration tests w/out docker

parent 82fc506e
...@@ -9,15 +9,11 @@ workhorse:verify: ...@@ -9,15 +9,11 @@ workhorse:verify:
.workhorse:test: .workhorse:test:
extends: .workhorse:rules:workhorse extends: .workhorse:rules:workhorse
services:
- name: registry.gitlab.com/gitlab-org/build/cng/gitaly:master-ubi8
# Disable the hooks so we don't have to stub the GitLab API
command: ["/usr/bin/env", "GITALY_TESTING_NO_GIT_HOOKS=1", "/scripts/process-wrapper"]
alias: gitaly
variables: variables:
GITALY_ADDRESS: "tcp://gitaly:8075" GITALY_ADDRESS: "tcp://127.0.0.1:8075"
stage: test stage: test
needs: [] needs:
- setup-test-env
script: script:
- go version - go version
- apt-get update && apt-get -y install libimage-exiftool-perl - apt-get update && apt-get -y install libimage-exiftool-perl
......
...@@ -13,6 +13,8 @@ else ...@@ -13,6 +13,8 @@ else
BUILD_TIME := $(shell date -u "$(DATE_FMT)") BUILD_TIME := $(shell date -u "$(DATE_FMT)")
endif endif
GOBUILD := go build -ldflags "-X main.Version=$(VERSION_STRING) -X main.BuildTime=$(BUILD_TIME)" GOBUILD := go build -ldflags "-X main.Version=$(VERSION_STRING) -X main.BuildTime=$(BUILD_TIME)"
GITALY := tmp/tests/gitaly/_build/bin/gitaly
GITALY_PID_FILE := gitaly.pid
EXE_ALL := gitlab-resize-image gitlab-zip-cat gitlab-zip-metadata gitlab-workhorse EXE_ALL := gitlab-resize-image gitlab-zip-cat gitlab-zip-metadata gitlab-workhorse
INSTALL := install INSTALL := install
BUILD_TAGS := tracer_static tracer_static_jaeger continuous_profiler_stackdriver BUILD_TAGS := tracer_static tracer_static_jaeger continuous_profiler_stackdriver
...@@ -63,7 +65,15 @@ install: $(EXE_ALL) ...@@ -63,7 +65,15 @@ install: $(EXE_ALL)
.PHONY: test .PHONY: test
test: prepare-tests test: prepare-tests
$(call message,$@) $(call message,$@)
@go test -tags "$(BUILD_TAGS)" ./... go test -tags "$(BUILD_TAGS)" ./... ;\
status="$$?" ;\
if [ -f "$(GITALY_PID_FILE)" ] ; then \
kill -9 $$(cat $(GITALY_PID_FILE)) ;\
rm $(GITALY_PID_FILE) ;\
else \
echo "Gitaly integration test not running" ;\
fi ;\
exit "$$status"
@echo SUCCESS @echo SUCCESS
.PHONY: clean .PHONY: clean
...@@ -82,9 +92,27 @@ clean-build: ...@@ -82,9 +92,27 @@ clean-build:
rm -rf $(TARGET_DIR) rm -rf $(TARGET_DIR)
.PHONY: prepare-tests .PHONY: prepare-tests
prepare-tests: run-gitaly
prepare-tests: testdata/data/group/test.git $(EXE_ALL) prepare-tests: testdata/data/group/test.git $(EXE_ALL)
prepare-tests: testdata/scratch prepare-tests: testdata/scratch
.PHONY: run-gitaly
run-gitaly: gitaly.pid
$(GITALY_PID_FILE): gitaly.toml
@{ \
if [ -z "$${GITALY_ADDRESS+x}" ] ; then \
echo "To run gitaly integration tests set GITALY_ADDRESS=tcp://127.0.0.1:8075" ; \
else \
cd .. ; \
GITALY_TESTING_NO_GIT_HOOKS=1 GITALY_PID_FILE=$(GITALY_PID_FILE) $(GITALY) workhorse/gitaly.toml ; \
fi \
} &
gitaly.toml: ../tmp/tests/gitaly/config.toml
sed -e 's/^socket_path.*$$/listen_addr = "0.0.0.0:8075"/' \
$< > $@
testdata/data/group/test.git: testdata/data/group/test.git:
$(call message,$@) $(call message,$@)
git clone --quiet --bare https://gitlab.com/gitlab-org/gitlab-test.git $@ git clone --quiet --bare https://gitlab.com/gitlab-org/gitlab-test.git $@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment