-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests may fail on machines having a .curlrc #6595
Comments
.curlrc
I believe we've tried to address this by changing https://github.com/curl/curl/blob/master/tests/runtests.pl#L390 ... the question is then, why doesn't this work? |
Thanks for the pointer! So some tracing revealed that This patch settles it: diff --git a/tests/runtests.pl b/tests/runtests.pl
index ddee02ad3..47b44acb6 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -388,6 +388,8 @@ $ENV{'CURL_ENTROPY'}="12345678";
$ENV{'CURL_FORCETIME'}=1; # for debug NTLM magic
$ENV{'CURL_GLOBAL_INIT'}=1; # debug curl_global_init/cleanup use
$ENV{'HOME'}=$pwd;
+$ENV{'CURL_HOME'}=$ENV{'HOME'};
+$ENV{'XDG_CONFIG_HOME'}=$ENV{'HOME'};
$ENV{'COLUMNS'}=79; # screen width!
sub catch_zap { |
Ah, right. Seems like a straight-forward change that can't be debated much! |
by also setting CURL_HOME and XDG_CONFIG_HOME envvar to the local directory. Fixes curl#6595
I did this
Run
./tests/runtests.pl 1067
(can be most/any tests).The test fails.
I expected the following
Test passing.
curl/libcurl version
(any) / git HEAD (acd90af)
curl 7.75.1-DEV (x86_64-apple-darwin19.6.0) libcurl/7.75.1-DEV OpenSSL/1.1.1i zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.0 libpsl/0.21.1 (+libicu/67.1) nghttp2/1.43.0 librtmp/2.3
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli Debug HTTP2 HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB PSL SSL TLS-SRP TrackMemory UnixSockets zstd
operating system
(any)
The reason for test to fail is having a
.curlrc
on the machine which contains options that alter curl's behaviour, and making output different than expected by tests. The solution is to disable loading.curlrc
in test contexts.This may not cover all cases (and may have unintended side-effects, and/or this may have a more elegant solution), anyway this patch resolves the above basic (and possibly some more) cases:
The text was updated successfully, but these errors were encountered: