Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Hiltunen <shiltunen@gitlab.com>2022-06-28 15:39:34 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2022-06-30 16:46:40 +0300
commit6706767471bccc2a54ebaaa7ee71a6552e3cdee6 (patch)
treef7bbf4fa9e221f84e23abc0e94577efaa12f0f2f
parentcb10b93bfbac641213c566fd46bec78682f3d923 (diff)
Don't build packed binaries as part of prepare-tests in CIsmh-pack-aux-binaries
Our makefile forcefully rebuilds Gitaly binaries on every run. This causes the prepare-tests target to always rebuild the packed binaries. While the packed executables are a dependency that should be built prior to running tests, they can't be built in CI due to the CI running without privileges. Skip rebuilding the packed exectutables as part of prepare-tests if we are running in CI. SKIP_RSPEC_BUILD is used for the same reason to skip rspec build. This commit renames the variable to a more general name and skips the packed binary building in CI during tests.
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--Makefile9
2 files changed, 7 insertions, 4 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f14361e56..2591e48a0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -104,7 +104,7 @@ include:
# But the actual tests should run unprivileged. This assures that we pay
# proper attention to permission bits and that we don't modify the source
# directory.
- - setpriv --reuid=${TEST_UID} --regid=${TEST_UID} --clear-groups --no-new-privs make ${TEST_TARGET} SKIP_RSPEC_BUILD=YesPlease $(test "${GIT_VERSION}" = default && echo WITH_BUNDLED_GIT=YesPlease)
+ - setpriv --reuid=${TEST_UID} --regid=${TEST_UID} --clear-groups --no-new-privs make ${TEST_TARGET} UNPRIVILEGED_CI_SKIP=YesPlease $(test "${GIT_VERSION}" = default && echo WITH_BUNDLED_GIT=YesPlease)
after_script:
- |
diff --git a/Makefile b/Makefile
index 97b375810..1a92ff873 100644
--- a/Makefile
+++ b/Makefile
@@ -339,7 +339,10 @@ export GITALY_TESTING_GIT_BINARY ?= ${GIT_PREFIX}/bin/git
endif
.PHONY: prepare-tests
-prepare-tests: libgit2 prepare-test-repos ${SOURCE_DIR}/.ruby-bundle ${GOTESTSUM} ${GITALY_PACKED_EXECUTABLES}
+prepare-tests: libgit2 prepare-test-repos ${SOURCE_DIR}/.ruby-bundle ${GOTESTSUM}
+ifndef UNPRIVILEGED_CI_SKIP
+prepare-tests: ${GITALY_PACKED_EXECUTABLES}
+endif
${Q}mkdir -p "$(dir ${TEST_REPORT})"
.PHONY: prepare-test-repos
@@ -384,10 +387,10 @@ rspec: prepare-tests
${Q}cd ${GITALY_RUBY_DIR} && PATH='${SOURCE_DIR}/internal/testhelper/testdata/home/bin:${PATH}' bundle exec rspec
# This is a workaround for our unprivileged CI builds. We manually execute the
-# build target as privileged user, but then run the rspec target unprivileged.
+# build target as privileged user, but then run other targets unprivileged.
# We thus cannot rebuild binaries there given that we have no permissions to
# write into the build directory.
-ifndef SKIP_RSPEC_BUILD
+ifndef UNPRIVILEGED_CI_SKIP
rspec: build
endif