Commit 375bc2ad authored by Jacob Vosmaer's avatar Jacob Vosmaer

Merge branch 'ac-fix-workhorse-make-test' into 'master'

Fix workhorse make test

See merge request gitlab-org/gitlab!77305
parents dff90d82 832848cf
......@@ -9,3 +9,4 @@ testdata/alt-public
/_build
coverage.html
/*.toml
/gitaly.pid
......@@ -65,7 +65,12 @@ install: $(EXE_ALL)
.PHONY: test
test: prepare-tests
$(call message,$@)
go test -tags "$(BUILD_TAGS)" ./... ;\
@if [ -z "$${GITALY_ADDRESS+x}" ] ; then \
echo "To run gitaly integration tests set GITALY_ADDRESS=tcp://127.0.0.1:8075" ; \
else \
$(MAKE) run-gitaly ; \
fi
@go test -tags "$(BUILD_TAGS)" ./... ;\
status="$$?" ;\
if [ -f "$(GITALY_PID_FILE)" ] ; then \
echo "Clean up Gitaly server for workhorse integration test" ;\
......@@ -93,27 +98,24 @@ clean-build:
rm -rf $(TARGET_DIR)
.PHONY: prepare-tests
prepare-tests: run-gitaly
prepare-tests: testdata/data/group/test.git $(EXE_ALL)
prepare-tests: testdata/scratch
.PHONY: run-gitaly
run-gitaly: gitaly.pid
run-gitaly: $(GITALY_PID_FILE)
$(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=workhorse/$(GITALY_PID_FILE) $(GITALY) workhorse/gitaly.toml ; \
fi \
} &
$(call message, "Starting gitaly")
cd ..; GITALY_TESTING_NO_GIT_HOOKS=1 GITALY_PID_FILE=workhorse/$(GITALY_PID_FILE) $(GITALY) workhorse/gitaly.toml &
gitaly.toml: ../tmp/tests/gitaly/config.toml
sed -e 's/^socket_path.*$$/listen_addr = "0.0.0.0:8075"/;s/^\[auth\]$$//;s/^token.*$$//;s/^internal_socket_dir.*$$//' \
$< > $@
../tmp/tests/gitaly/config.toml:
$(call message, "Building a complete test environment")
cd .. ; ./scripts/setup-test-env
testdata/data/group/test.git:
$(call message,$@)
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