Skip to content

Commit de60d9b

Browse files
committed
tests: PROXY_URL is more accurately PROXY_HOST
Change the `GITTEST_REMOTE_PROXY_URL` environment variable to be `GITTEST_REMOTE_PROXY_HOST`, since it is a host:port combination, not an actual URL. (We cannot use a URL here since we may want to include the username:password combination in the constructed URL.)
1 parent c07ff4c commit de60d9b

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

ci/test.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if (-not $Env:SKIP_PROXY_TESTS) {
6565
Write-Host "Running proxy tests"
6666
Write-Host ""
6767

68-
$Env:GITTEST_REMOTE_PROXY_URL="localhost:8080"
68+
$Env:GITTEST_REMOTE_PROXY_HOST="localhost:8080"
6969
$Env:GITTEST_REMOTE_PROXY_USER="foo"
7070
$Env:GITTEST_REMOTE_PROXY_PASS="bar"
7171

ci/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ if [ -z "$SKIP_PROXY_TESTS" ]; then
164164
echo "Running proxy tests"
165165
echo ""
166166

167-
export GITTEST_REMOTE_PROXY_URL="localhost:8080"
167+
export GITTEST_REMOTE_PROXY_HOST="localhost:8080"
168168
export GITTEST_REMOTE_PROXY_USER="foo"
169169
export GITTEST_REMOTE_PROXY_PASS="bar"
170170
run_test proxy
171-
unset GITTEST_REMOTE_PROXY_URL
171+
unset GITTEST_REMOTE_PROXY_HOST
172172
unset GITTEST_REMOTE_PROXY_USER
173173
unset GITTEST_REMOTE_PROXY_PASS
174174
fi

tests/online/clone.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static char *_remote_ssh_pubkey = NULL;
2424
static char *_remote_ssh_privkey = NULL;
2525
static char *_remote_ssh_passphrase = NULL;
2626
static char *_remote_ssh_fingerprint = NULL;
27-
static char *_remote_proxy_url = NULL;
27+
static char *_remote_proxy_host = NULL;
2828
static char *_remote_proxy_user = NULL;
2929
static char *_remote_proxy_pass = NULL;
3030

@@ -52,7 +52,7 @@ void test_online_clone__initialize(void)
5252
_remote_ssh_privkey = cl_getenv("GITTEST_REMOTE_SSH_KEY");
5353
_remote_ssh_passphrase = cl_getenv("GITTEST_REMOTE_SSH_PASSPHRASE");
5454
_remote_ssh_fingerprint = cl_getenv("GITTEST_REMOTE_SSH_FINGERPRINT");
55-
_remote_proxy_url = cl_getenv("GITTEST_REMOTE_PROXY_URL");
55+
_remote_proxy_host = cl_getenv("GITTEST_REMOTE_PROXY_HOST");
5656
_remote_proxy_user = cl_getenv("GITTEST_REMOTE_PROXY_USER");
5757
_remote_proxy_pass = cl_getenv("GITTEST_REMOTE_PROXY_PASS");
5858

@@ -74,7 +74,7 @@ void test_online_clone__cleanup(void)
7474
git__free(_remote_ssh_privkey);
7575
git__free(_remote_ssh_passphrase);
7676
git__free(_remote_ssh_fingerprint);
77-
git__free(_remote_proxy_url);
77+
git__free(_remote_proxy_host);
7878
git__free(_remote_proxy_user);
7979
git__free(_remote_proxy_pass);
8080

@@ -728,10 +728,10 @@ void test_online_clone__proxy_credentials_request(void)
728728
{
729729
git_buf url = GIT_BUF_INIT;
730730

731-
if (!_remote_proxy_url || !_remote_proxy_user || !_remote_proxy_pass)
731+
if (!_remote_proxy_host || !_remote_proxy_user || !_remote_proxy_pass)
732732
cl_skip();
733733

734-
cl_git_pass(git_buf_printf(&url, "http://%s/", _remote_proxy_url));
734+
cl_git_pass(git_buf_printf(&url, "http://%s/", _remote_proxy_host));
735735

736736
g_options.fetch_opts.proxy_opts.type = GIT_PROXY_SPECIFIED;
737737
g_options.fetch_opts.proxy_opts.url = url.ptr;
@@ -747,10 +747,10 @@ void test_online_clone__proxy_credentials_in_url(void)
747747
{
748748
git_buf url = GIT_BUF_INIT;
749749

750-
if (!_remote_proxy_url || !_remote_proxy_user || !_remote_proxy_pass)
750+
if (!_remote_proxy_host || !_remote_proxy_user || !_remote_proxy_pass)
751751
cl_skip();
752752

753-
cl_git_pass(git_buf_printf(&url, "http://%s:%s@%s/", _remote_proxy_user, _remote_proxy_pass, _remote_proxy_url));
753+
cl_git_pass(git_buf_printf(&url, "http://%s:%s@%s/", _remote_proxy_user, _remote_proxy_pass, _remote_proxy_host));
754754

755755
g_options.fetch_opts.proxy_opts.type = GIT_PROXY_SPECIFIED;
756756
g_options.fetch_opts.proxy_opts.url = url.ptr;
@@ -765,7 +765,7 @@ void test_online_clone__proxy_credentials_in_environment(void)
765765
{
766766
git_buf url = GIT_BUF_INIT;
767767

768-
if (!_remote_proxy_url || !_remote_proxy_user || !_remote_proxy_pass)
768+
if (!_remote_proxy_host || !_remote_proxy_user || !_remote_proxy_pass)
769769
cl_skip();
770770

771771
_orig_http_proxy = cl_getenv("HTTP_PROXY");
@@ -774,7 +774,7 @@ void test_online_clone__proxy_credentials_in_environment(void)
774774

775775
g_options.fetch_opts.proxy_opts.type = GIT_PROXY_AUTO;
776776

777-
cl_git_pass(git_buf_printf(&url, "http://%s:%s@%s/", _remote_proxy_user, _remote_proxy_pass, _remote_proxy_url));
777+
cl_git_pass(git_buf_printf(&url, "http://%s:%s@%s/", _remote_proxy_user, _remote_proxy_pass, _remote_proxy_host));
778778

779779
cl_setenv("HTTP_PROXY", url.ptr);
780780
cl_setenv("HTTPS_PROXY", url.ptr);

0 commit comments

Comments
 (0)