Skip to content

Git designed for AI agents.

test: fixes found by the first full CI run

Federico Elia4a7156e9d4c2
diff --git a/Makefile b/Makefile
index 3d65d83..ad7a6d0 100644
--- a/Makefile
+++ b/Makefile
@@ -282,7 +282,10 @@ GITALY_INSTALLED_EXECUTABLES = $(filter-out ${GITALY_PACKED_EXECUTABLES}, ${GITA
# TEST_OPTIONS: any additional options
# TEST_PACKAGES: packages which shall be tested
# TEST_LOG_DIR: specify the output log dir. By default, all logs will be discarded
+# Some tests build helper binaries with `go build`. The test PATH puts a guarding
+# git wrapper first, which Go's VCS stamping would call, so stamping is off.
run_go_tests = PATH='${SOURCE_DIR}/internal/testhelper/testdata/home/bin:${PATH}' \
+ GOFLAGS='-buildvcs=false ${GOFLAGS}' \
TEST_TMP_DIR='${TEST_TMP_DIR}' \
TEST_LOG_DIR='${TEST_LOG_DIR}' \
${GOTESTSUM} --format ${TEST_FORMAT} --junitfile '${TEST_JUNIT_REPORT}' --jsonfile '${TEST_JSON_REPORT}' ${GOTESTSUM_OPTIONS} -- -ldflags '${GO_LDFLAGS}' -tags '${SERVER_BUILD_TAGS}' ${TEST_OPTIONS} ${TEST_PACKAGES}
diff --git a/internal/grpc/middleware/customfieldshandler/customfields_handler_test.go b/internal/grpc/middleware/customfieldshandler/customfields_handler_test.go
index 4f80af9..3dad920 100644
--- a/internal/grpc/middleware/customfieldshandler/customfields_handler_test.go
+++ b/internal/grpc/middleware/customfieldshandler/customfields_handler_test.go
@@ -103,8 +103,11 @@ func TestInterceptor(t *testing.T) {
_, err := client.RefExists(ctx, req)
require.NoError(t, err)
},
+ // git commands no longer spawn `git rev-parse --show-object-format` to choose
+ // attr.tree (the object format is read from the repository config), so each
+ // command counts once.
expectedLogData: map[string]interface{}{
- "command.count": 3,
+ "command.count": 2,
},
},
{
@@ -124,7 +127,7 @@ func TestInterceptor(t *testing.T) {
}
},
expectedLogData: map[string]interface{}{
- "command.count": 2,
+ "command.count": 1,
},
},
}