mirror of
https://github.com/curl/curl.git
synced 2026-08-26 10:23:31 +03:00
runtests: fix quoting in Appveyor and Azure test integration
Test 1442's name was not quoted correctly so wasn't registered in Appveyor and it had the wrong name in Azure. The JSON string quotes were also invalid, even though both servers happened to accept it regardless. Closes #11010
This commit is contained in:
parent
6b1e4dc6cd
commit
4a41745e21
2 changed files with 57 additions and 57 deletions
|
|
@ -75,26 +75,26 @@ sub azure_create_test_run {
|
|||
sub azure_create_test_result {
|
||||
my ($curl, $azure_run_id, $testnum, $testname)=@_;
|
||||
$testname =~ s/\\/\\\\/g;
|
||||
$testname =~ s/\'/\\\'/g;
|
||||
$testname =~ s/\"/\\\"/g;
|
||||
$testname =~ s/\'/'"'"'/g;
|
||||
my $title_testnum=sprintf("%04d", $testnum);
|
||||
my $azure_baseurl="$ENV{'SYSTEM_TEAMFOUNDATIONCOLLECTIONURI'}$ENV{'SYSTEM_TEAMPROJECTID'}";
|
||||
my $azure_result=`$curl --silent --noproxy "*" \\
|
||||
my $azure_result=`$curl --silent --noproxy '*' \\
|
||||
--header "Authorization: Bearer $ENV{'AZURE_ACCESS_TOKEN'}" \\
|
||||
--header "Content-Type: application/json" \\
|
||||
--data "
|
||||
--header 'Content-Type: application/json' \\
|
||||
--data '
|
||||
[
|
||||
{
|
||||
'build': {'id': '$ENV{'BUILD_BUILDID'}'},
|
||||
'testCase': {'id': $testnum},
|
||||
'testCaseTitle': '$title_testnum: $testname',
|
||||
'testCaseRevision': 2,
|
||||
'automatedTestName': 'curl.tests.$testnum',
|
||||
'outcome': 'InProgress'
|
||||
"build": {"id": "$ENV{'BUILD_BUILDID'}"},
|
||||
"testCase": {"id": $testnum},
|
||||
"testCaseTitle": "$title_testnum: $testname",
|
||||
"testCaseRevision": 2,
|
||||
"automatedTestName": "curl.tests.$testnum",
|
||||
"outcome": "InProgress"
|
||||
}
|
||||
]
|
||||
" \\
|
||||
"$azure_baseurl/_apis/test/runs/$azure_run_id/results?api-version=5.1"`;
|
||||
' \\
|
||||
'$azure_baseurl/_apis/test/runs/$azure_run_id/results?api-version=5.1'`;
|
||||
if($azure_result =~ /\[\{"id":(\d+)/) {
|
||||
return $1;
|
||||
}
|
||||
|
|
@ -123,21 +123,21 @@ sub azure_update_test_result {
|
|||
$azure_outcome = 'Failed';
|
||||
}
|
||||
my $azure_baseurl="$ENV{'SYSTEM_TEAMFOUNDATIONCOLLECTIONURI'}$ENV{'SYSTEM_TEAMPROJECTID'}";
|
||||
my $azure_result=`$curl --silent --noproxy "*" --request PATCH \\
|
||||
my $azure_result=`$curl --silent --noproxy '*' --request PATCH \\
|
||||
--header "Authorization: Bearer $ENV{'AZURE_ACCESS_TOKEN'}" \\
|
||||
--header "Content-Type: application/json" \\
|
||||
--data "
|
||||
--data '
|
||||
[
|
||||
{
|
||||
'id': $azure_result_id,
|
||||
'outcome': '$azure_outcome',
|
||||
'startedDate': '$azure_start',
|
||||
'completedDate': '$azure_complete',
|
||||
'durationInMs': $azure_duration
|
||||
"id": $azure_result_id,
|
||||
"outcome": "$azure_outcome",
|
||||
"startedDate": "$azure_start",
|
||||
"completedDate": "$azure_complete",
|
||||
"durationInMs": $azure_duration
|
||||
}
|
||||
]
|
||||
" \\
|
||||
"$azure_baseurl/_apis/test/runs/$azure_run_id/results?api-version=5.1"`;
|
||||
' \\
|
||||
'$azure_baseurl/_apis/test/runs/$azure_run_id/results?api-version=5.1'`;
|
||||
if($azure_result =~ /\[\{"id":(\d+)/) {
|
||||
return $1;
|
||||
}
|
||||
|
|
@ -147,15 +147,15 @@ sub azure_update_test_result {
|
|||
sub azure_update_test_run {
|
||||
my ($curl, $azure_run_id)=@_;
|
||||
my $azure_baseurl="$ENV{'SYSTEM_TEAMFOUNDATIONCOLLECTIONURI'}$ENV{'SYSTEM_TEAMPROJECTID'}";
|
||||
my $azure_run=`$curl --silent --noproxy "*" --request PATCH \\
|
||||
my $azure_run=`$curl --silent --noproxy '*' --request PATCH \\
|
||||
--header "Authorization: Bearer $ENV{'AZURE_ACCESS_TOKEN'}" \\
|
||||
--header "Content-Type: application/json" \\
|
||||
--data "
|
||||
--header 'Content-Type: application/json' \\
|
||||
--data '
|
||||
{
|
||||
'state': 'Completed'
|
||||
"state": "Completed"
|
||||
}
|
||||
" \\
|
||||
"$azure_baseurl/_apis/test/runs/$azure_run_id?api-version=5.1"`;
|
||||
' \\
|
||||
'$azure_baseurl/_apis/test/runs/$azure_run_id?api-version=5.1'`;
|
||||
if($azure_run =~ /"id":(\d+)/) {
|
||||
return $1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue