Closed Bug 736833 Opened 12 years ago Closed 12 years ago

Webservice Testopia.testopia_version does not return version

Categories

(Testopia :: API, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: florijn.peter, Assigned: gregaryh)

Details

Attachments

(1 file)

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) };
}
Attachment #608974 - Flags: review? → review?(gregaryh)
Attachment #608974 - Flags: review?(gregaryh) → review?(LpSolit)
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
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?
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.
(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?
(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 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-
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: