From: Marc Hoersken Date: Wed, 24 Aug 2022 19:46:25 +0000 (+0200) Subject: CI/runtests.pl: add param for dedicated curl to talk to APIs X-Git-Tag: curl-7_85_0~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5c6e86783d6e2caea50eee66a29c7157c92f54f;p=thirdparty%2Fcurl.git CI/runtests.pl: add param for dedicated curl to talk to APIs This should make it possible to also report test failures if our freshly build curl binary is not fully functional. Reviewed-by: Daniel Stenberg Closes #9360 --- diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 8d1e5d7bcb..c21d49f724 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -95,7 +95,7 @@ stages: displayName: 'test' env: AZURE_ACCESS_TOKEN: "$(System.AccessToken)" - TFLAGS: "-r $(tests)" + TFLAGS: "-ac /usr/bin/curl -r $(tests)" - stage: distcheck dependsOn: [] @@ -294,4 +294,4 @@ stages: displayName: 'test' env: AZURE_ACCESS_TOKEN: "$(System.AccessToken)" - TFLAGS: "!IDN !SCP ~612 ~1056 $(tests)" + TFLAGS: "-ac /usr/bin/curl.exe !IDN !SCP ~612 ~1056 $(tests)" diff --git a/appveyor.yml b/appveyor.yml index 522dcaf50d..e04ca0fffe 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -306,15 +306,19 @@ build_script: )) test_script: + - if exist C:/msys64/usr/bin/curl.exe ( + set ACURL=-ac %POSIX_PATH_PREFIX%/c/msys64/usr/bin/curl.exe ) + - if exist C:/Windows/System32/curl.exe ( + set ACURL=-ac %POSIX_PATH_PREFIX%/c/Windows/System32/curl.exe ) - if %TESTING%==ON ( if %BUILD_SYSTEM%==CMake ( - set TFLAGS=%DISABLED_TESTS% && + set TFLAGS=%ACURL% %DISABLED_TESTS% && cmake --build . --config %PRJ_CFG% --target test-ci ) else ( if %BUILD_SYSTEM%==autotools ( - bash.exe -e -l -c "cd %POSIX_PATH_PREFIX%/c/projects/curl && make V=1 TFLAGS='%DISABLED_TESTS%' test-ci" + bash.exe -e -l -c "cd %POSIX_PATH_PREFIX%/c/projects/curl && make V=1 TFLAGS='%ACURL% %DISABLED_TESTS%' test-ci" ) else ( - bash.exe -e -l -c "cd %POSIX_PATH_PREFIX%/c/projects/curl/tests && ./runtests.pl -a -p !flaky -r -rm %DISABLED_TESTS%" + bash.exe -e -l -c "cd %POSIX_PATH_PREFIX%/c/projects/curl/tests && ./runtests.pl -a -p !flaky -r -rm %ACURL% %DISABLED_TESTS%" )) ) diff --git a/tests/runtests.pl b/tests/runtests.pl index 80370ba1ab..7eeabfc380 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -175,10 +175,12 @@ my $SSHSRVSHA256 = "[uninitialized]"; # SHA256 of ssh server public key my $VERSION=""; # curl's reported version number my $srcdir = $ENV{'srcdir'} || '.'; -my $CURL="../src/curl".exe_ext('TOOL'); # what curl executable to run on the tests +my $CURL="../src/curl".exe_ext('TOOL'); # what curl binary to run on the tests my $VCURL=$CURL; # what curl binary to use to verify the servers with # VCURL is handy to set to the system one when the one you # just built hangs or crashes and thus prevent verification +my $ACURL=$VCURL; # what curl binary to use to talk to APIs (relevant for CI) + # ACURL is handy to set to the system one for reliability my $DBGCURL=$CURL; #"../src/.libs/curl"; # alternative for debugging my $LOGDIR="log"; my $TESTDIR="$srcdir/data"; @@ -3789,10 +3791,10 @@ sub singletest { # create test result in CI services if(azure_check_environment() && $AZURE_RUN_ID) { - $AZURE_RESULT_ID = azure_create_test_result($VCURL, $AZURE_RUN_ID, $testnum, $testname); + $AZURE_RESULT_ID = azure_create_test_result($ACURL, $AZURE_RUN_ID, $testnum, $testname); } elsif(appveyor_check_environment()) { - appveyor_create_test_result($VCURL, $testnum, $testname); + appveyor_create_test_result($ACURL, $testnum, $testname); } # remove test server commands file before servers are started/verified @@ -5598,6 +5600,11 @@ while(@ARGV) { $VCURL="\"$ARGV[1]\""; shift @ARGV; } + elsif ($ARGV[0] eq "-ac") { + # use this curl only to talk to APIs (currently only CI test APIs) + $ACURL="\"$ARGV[1]\""; + shift @ARGV; + } elsif ($ARGV[0] eq "-d") { # have the servers display protocol output $debugprotocol=1; @@ -5756,6 +5763,7 @@ while(@ARGV) { print <