From 3feb60d289ed1987b8957a98e062699f4f004311 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Tue, 3 Mar 2020 12:49:53 +0100 Subject: [PATCH] ci/tests: Move CI test result creation above environment setup This avoids using our test servers as proxy to the AppVeyor API. Closes #5022 --- tests/runtests.pl | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/runtests.pl b/tests/runtests.pl index 131aef926..51a84f09b 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -3358,6 +3358,19 @@ sub singletest { delete $oldenv{$var}; } + # get the name of the test early + my @testname= getpart("client", "name"); + my $testname = $testname[0]; + $testname =~ s/\n//g; + + # create test result in CI services + if(azure_check_environment() && $AZURE_RUN_ID) { + $AZURE_RESULT_ID = azure_create_test_result($AZURE_RUN_ID, $testnum, $testname); + } + elsif(appveyor_check_environment()) { + appveyor_create_test_result($testnum, $testname); + } + # remove test server commands file before servers are started/verified unlink($FTPDCMD) if(-f $FTPDCMD); @@ -3517,9 +3530,6 @@ sub singletest { my $CURLOUT="$LOGDIR/curl$testnum.out"; # curl output if not stdout # name of the test - my @testname= getpart("client", "name"); - my $testname = $testname[0]; - $testname =~ s/\n//g; logmsg "[$testname]\n" if(!$short); if($listonly) { @@ -3743,13 +3753,6 @@ sub singletest { close(GDBCMD); } - if(azure_check_environment() && $AZURE_RUN_ID) { - $AZURE_RESULT_ID = azure_create_test_result($AZURE_RUN_ID, $testnum, $testname); - } - elsif(appveyor_check_environment()) { - appveyor_create_test_result($testnum, $testname); - } - # timestamp starting of test command $timetoolini{$testnum} = Time::HiRes::time(); @@ -5543,6 +5546,7 @@ foreach $testnum (@at) { my $error = singletest($run_event_based, $testnum, $count, scalar(@at)); + # update test result in CI services if(azure_check_environment() && $AZURE_RUN_ID && $AZURE_RESULT_ID) { $AZURE_RESULT_ID = azure_update_test_result($AZURE_RUN_ID, $AZURE_RESULT_ID, $testnum, $error, $timeprepini{$testnum}, $timevrfyend{$testnum});