Skip to content

Commit 449e1d1

Browse files
jdxclaude
andcommitted
fix(ci): set git author/committer identity for e2e tests
The test_env_plugin_shadow_warning test creates a git repo and needs to commit, which fails in CI where no git identity is configured. Set GIT_AUTHOR_NAME/EMAIL and GIT_COMMITTER_NAME/EMAIL in the e2e test harness so all tests can use git commit without extra config. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fdd8c16 commit 449e1d1

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

e2e/backend/test_http_upgrade

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,23 @@ mkdir -p "$VERSION_LIST_DIR"
1414
# Create version list file with two versions
1515
echo -e "1.0.0\n2.0.0" >"$VERSION_LIST_DIR/versions.txt"
1616

17-
# Start Python HTTP server in background
18-
(cd "$VERSION_LIST_DIR" && python3 -m http.server 18123 &>/dev/null) &
17+
# Start Python HTTP server on a random available port
18+
HTTP_PORT_FILE="$TMPDIR/http_server_port"
19+
python3 -c "
20+
import http.server, socketserver, threading, os
21+
s = socketserver.TCPServer(('', 0), lambda *a: http.server.SimpleHTTPRequestHandler(*a, directory='$VERSION_LIST_DIR'))
22+
with open('$HTTP_PORT_FILE', 'w') as f:
23+
f.write(str(s.server_address[1]))
24+
s.serve_forever()
25+
" &
1926
HTTP_SERVER_PID=$!
2027

21-
# Wait for server to start
22-
sleep 1
28+
# Wait for server to start and write port file
29+
for _i in {1..20}; do
30+
if [[ -f $HTTP_PORT_FILE ]]; then break; fi
31+
sleep 0.1
32+
done
33+
HTTP_PORT=$(cat "$HTTP_PORT_FILE")
2334

2435
# Cleanup function
2536
cleanup() {
@@ -28,7 +39,7 @@ cleanup() {
2839
trap cleanup EXIT
2940

3041
# Verify server is running
31-
if ! curl -s http://localhost:18123/versions.txt | grep -q "1.0.0"; then
42+
if ! curl -s "http://localhost:$HTTP_PORT/versions.txt" | grep -q "1.0.0"; then
3243
fail "HTTP server failed to start"
3344
fi
3445

@@ -38,7 +49,7 @@ cat <<EOF >mise.toml
3849
[tools."http:hello-upgrade"]
3950
version = "1.0.0"
4051
url = "https://mise.jdx.dev/test-fixtures/hello-world-{{version}}.tar.gz"
41-
version_list_url = "http://localhost:18123/versions.txt"
52+
version_list_url = "http://localhost:$HTTP_PORT/versions.txt"
4253
bin_path = "hello-world-1.0.0/bin"
4354
postinstall = "chmod +x \$MISE_TOOL_INSTALL_PATH/hello-world-1.0.0/bin/hello-world"
4455
EOF

e2e/run_test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ within_isolated_env() {
7272
CARGO_LLVM_COV="${CARGO_LLVM_COV:-}" \
7373
CARGO_LLVM_COV_SHOW_ENV="${CARGO_LLVM_COV_SHOW_ENV:-}" \
7474
CARGO_LLVM_COV_TARGET_DIR="${CARGO_LLVM_COV_TARGET_DIR:-}" \
75+
GIT_AUTHOR_NAME="test" \
76+
GIT_AUTHOR_EMAIL="test@test.com" \
77+
GIT_COMMITTER_NAME="test" \
78+
GIT_COMMITTER_EMAIL="test@test.com" \
7579
GITHUB_ACTION="${GITHUB_ACTION:-}" \
7680
GITHUB_TOKEN="${GITHUB_TOKEN:-}" \
7781
GOPROXY="${GOPROXY:-}" \

0 commit comments

Comments
 (0)