Skip to content

Commit 820e796

Browse files
committed
Merge branch 'jk/tests-without-dns'
Test suite has been taught not to unnecessarily rely on DNS failing a bogus external name. * jk/tests-without-dns: t/lib-bundle-uri: use local fake bundle URLs t5551: do not confirm that bogus url cannot be used t5553: use local url for invalid fetch
2 parents cda7295 + 407cdbd commit 820e796

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

t/lib-bundle-uri-protocol.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ git)
1818
start_git_daemon --export-all --enable=receive-pack
1919
BUNDLE_URI_PARENT="$GIT_DAEMON_DOCUMENT_ROOT_PATH/parent"
2020
BUNDLE_URI_REPO_URI="$GIT_DAEMON_URL/parent"
21-
BUNDLE_URI_BUNDLE_URI="https://example.com/fake.bdl"
21+
BUNDLE_URI_BUNDLE_URI="$BUNDLE_URI_REPO_URI/fake.bdl"
2222
test_set_prereq BUNDLE_URI_GIT
2323
;;
2424
http)
2525
. "$TEST_DIRECTORY"/lib-httpd.sh
2626
start_httpd
2727
BUNDLE_URI_PARENT="$HTTPD_DOCUMENT_ROOT_PATH/http_parent"
2828
BUNDLE_URI_REPO_URI="$HTTPD_URL/smart/http_parent"
29-
BUNDLE_URI_BUNDLE_URI="https://example.com/fake.bdl"
29+
BUNDLE_URI_BUNDLE_URI="$BUNDLE_URI_REPO_URL/fake.bdl"
3030
test_set_prereq BUNDLE_URI_HTTP
3131
;;
3232
*)

t/t5551-http-fetch-smart.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ test_expect_success 'clone empty SHA-256 repository with protocol v0' '
643643
test_expect_success 'passing hostname resolution information works' '
644644
BOGUS_HOST=gitbogusexamplehost.invalid &&
645645
BOGUS_HTTPD_URL=$HTTPD_PROTO://$BOGUS_HOST:$LIB_HTTPD_PORT &&
646-
test_must_fail git ls-remote "$BOGUS_HTTPD_URL/smart/repo.git" >/dev/null &&
647646
git -c "http.curloptResolve=$BOGUS_HOST:$LIB_HTTPD_PORT:127.0.0.1" ls-remote "$BOGUS_HTTPD_URL/smart/repo.git" >/dev/null
648647
'
649648

t/t5553-set-upstream.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ test_expect_success 'fetch --set-upstream main:other does not set the branch oth
7373
check_config_missing other2
7474
'
7575

76-
test_expect_success 'fetch --set-upstream http://nosuchdomain.example.com fails with invalid url' '
76+
test_expect_success 'fetch --set-upstream ./does-not-exist fails with invalid url' '
7777
# main explicitly not cleared, we check that it is not touched from previous value
7878
clear_config other other2 &&
79-
test_must_fail git fetch --set-upstream http://nosuchdomain.example.com &&
79+
test_must_fail git fetch --set-upstream ./does-not-exist &&
8080
check_config main upstream refs/heads/other &&
8181
check_config_missing other &&
8282
check_config_missing other2
@@ -143,10 +143,10 @@ test_expect_success 'pull --set-upstream upstream tag does not set the tag' '
143143
check_config_missing three
144144
'
145145

146-
test_expect_success 'pull --set-upstream http://nosuchdomain.example.com fails with invalid url' '
146+
test_expect_success 'pull --set-upstream ./does-not-exist fails with invalid url' '
147147
# main explicitly not cleared, we check that it is not touched from previous value
148148
clear_config other other2 three &&
149-
test_must_fail git pull --set-upstream http://nosuchdomain.example.com &&
149+
test_must_fail git pull --set-upstream ./does-not-exist &&
150150
check_config main upstream refs/heads/other &&
151151
check_config_missing other &&
152152
check_config_missing other2 &&

0 commit comments

Comments
 (0)