Webservice Testopia.testopia_version does not return version

RESOLVED INVALID

Status

Testopia
API
RESOLVED INVALID
6 years ago
6 years ago

People

(Reporter: Peter Florijn, Assigned: Greg Hendricks)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0
Build ID: 20120312181643

Steps to reproduce:

I developed a perl driver script with an objective to update a Test case run status as part of a test automation approach.

For debugging purposes I show the Bugzilla, Testopia and Testopia API versions.

if ($debug) {
$soapresult = $proxy->call('Bugzilla.version');
print "Bugzilla version : " . $soapresult->result->{version} . ".\n";
#$soapresult = $proxy->call('Bugzilla.extensions');
$soapresult = $proxy->call('Testopia.testopia_version');
print "Testopia version : " . $soapresult->result->{testopia_version} . ".\n";
$soapresult = $proxy->call('Testopia.api_version');
print "Testopia API version: " . $soapresult->result->{api_version} . ".\n";
}

In the Testopia services I got some errors.


Actual results:

In the Testopia services I got some errors.

Can't use string ("2.1") as a HASH ref while "strict refs" in use




Expected results:

Showing the Testopia and API versions.  I took the same coding approach as the Bugzilla service and now it works.

I changed the code in:

#sub api_version {
#    my $self = shift;
#    return "2.1";
#}

sub api_version {
    my $self = shift;
    return { api_version => $self->type('string', "2.1") };
}

#sub testopia_version {
#    my $self = shift;
#    return TESTOPIA_VERSION;
#}

sub testopia_version {
    my $self = shift;
    return { testopia_version => $self->type('string', TESTOPIA_VERSION) };
}
(Reporter)

Comment 1

6 years ago
Created attachment 608974 [details] [diff] [review]
Patch file on the revision 648 trunk version
Attachment #608974 - Flags: review?
(Reporter)

Updated

6 years ago
Attachment #608974 - Flags: review? → review?(gregaryh)
(Reporter)

Updated

6 years ago
Attachment #608974 - Flags: review?(gregaryh) → review?(LpSolit)
(Reporter)

Comment 2

6 years ago
Comment on attachment 608974 [details] [diff] [review]
Patch file on the revision 648 trunk version

Installed latest version from trunk.

This little patch did not make it yet.

Can it be reviewed and checked in ?

Thx

Comment 3

6 years ago
Isn't this going to break the API? Or has it always been broken? Is there some documentation somewhere about how data is supposed to be returned by the API?
(Reporter)

Comment 4

6 years ago
The recent bunch of 2.5 patches did not break it. It was already broken before. Can't say how long. Risk of breaking other API usage seems small.

Comment 5

6 years ago
(In reply to Peter Florijn from comment #4)
> It was already broken before. Can't say how long.

You mean it was already broken in Testopia 2.4 when running on Bugzilla 3.6?
(Reporter)

Comment 6

6 years ago
(In reply to Frédéric Buclin from comment #5)
> (In reply to Peter Florijn from comment #4)
> > It was already broken before. Can't say how long.
> 
> You mean it was already broken in Testopia 2.4 when running on Bugzilla 3.6?

I started using Testopia as of version 4.x of Bugzilla. It was broken since.

Comment 7

6 years ago
Comment on attachment 608974 [details] [diff] [review]
Patch file on the revision 648 trunk version

The API is working correctly. Your script is incorrect: it must use $soapresult->result instead of $soapresult->result->{...}.
Attachment #608974 - Flags: review?(LpSolit) → review-

Updated

6 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.