Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008319TestLinkAPI - XMLRPCpublic2018-06-29 03:552018-07-11 20:59
Reporterrusty 
Assigned Tofman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLAMPOSCentosOS Version7.4
Product Version1.9.17 (2018 Q1) 
Fixed in Version1.9.18 (2018 Q3) 
Summary0008319: calling getAllExecutionsResults through xmlrpc reuturns an error that the method doesn't exist
DescriptionMethod was recently added to get all executions for a specific result. However attempting to call the method returns an error that the method does not exist.
Steps To ReproduceAttempt to get all execution results for a test case on a build using the xmlrpc through the getAllExecutionsResults.


Attempting to get the method through curl:

curl -X POST http://testlink2/lib/api/xmlrpc/v1/xmlrpc.php [^] --data "<?xml version='1.0'?><methodCall><methodName>tl.getAllExecutionsResults</methodName><params>\n<param><value><struct><member><name>devKey</name><value><string>$key</string></value></member></struct></value></param></params></methodCall>"
<?xml version="1.0"?>
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
          <name>faultCode</name>
          <value><int>-32601</int></value>
        </member>
        <member>
          <name>faultString</name>
          <value><string>server error. requested method tl.getAllExecutionsResults does not exist.</string></value>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>



Attempting to get the method through the modified client.
Traceback (most recent call last):
  File "C:\Users\RWeber.OSS\.IntelliJIdea2018.1\config\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<input>", line 1, in <module>
  File "C:\Users\RWeber.OSS\AppData\Local\Programs\Python\Python36\lib\site-packages\testlink\testlinkdecorators.py", line 112, in wrapperAddDevKey
    return methodAPI(self, *argsPositional, **argsOptional)
  File "C:\Users\RWeber.OSS\AppData\Local\Programs\Python\Python36\lib\site-packages\testlink\testlinkdecorators.py", line 100, in wrapperWithArgs
    *argsPositional, **argsOptional)
  File "C:\Users\RWeber.OSS\AppData\Local\Programs\Python\Python36\lib\site-packages\testlink\testlinkapigeneric.py", line 1527, in callServerWithPosArgs
    response = self._callServer(methodNameAPI, argsOptional)
  File "C:\Users\RWeber.OSS\AppData\Local\Programs\Python\Python36\lib\site-packages\testlink\testlinkapigeneric.py", line 1791, in _callServer
    raise testlinkerrors.TLAPIError(new_msg)
testlink.testlinkerrors.TLAPIError: problems calling the API method getAllExecutionsResults
<Fault -32601: 'server error. requested method tl.getAllExecutionsResults does not exist.'>

Additional InformationAttempting to add the method to the pythonic api client.
https://github.com/orenault/TestLink-API-Python-client/issues/35 [^]

Current working change set is.
<code python>
+ @decoApiCallAddDevKey
+ @decoMakerApiCallWithArgs(['testplanid'],
+ ['testcaseid', 'testcaseexternalid',
+ 'platformid', 'platformname',
+ 'buildid', 'buildname', 'options'])
+ def getAllExecutionsResults(self):
+ """ Gets the result of ALL executions for a particular testcase on a test plan.
+If there are no filter criteria regarding platform and build,
+result will be get WITHOUT checking for a particular platform and build.
+
+Method can only be used with
+TL version >= 1.17
+"""
+
</code>
TagsNo tags attached.
Database (MySQL,Postgres,etc)mysql
BrowserALL
PHP Version5.6
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Files

- Relationships

-  Notes
(0027649)
rusty (reporter)
2018-06-29 04:09

The function for sure exists on the server.
<code python>
cat ./xmlrpc.class.php |grep getAllExecutionsResults -A 150
        public function getAllExecutionsResults($args)
    {
      $operation=__FUNCTION__;
      $msg_prefix="({$operation}) - ";

      $this->_setArgs($args);
      $resultInfo = array();
      $status_ok=true;

      $options = new stdClass();
      $options->getBugs = 0;


      // Checks are done in order
      $checkFunctions = array('authenticate','checkTestPlanID','checkTestCaseIdentity');

      $status_ok=$this->_runChecks($checkFunctions,$msg_prefix) &&
                 $this->_checkTCIDAndTPIDValid(null,$msg_prefix) &&
                 $this->userHasRight("mgt_view_tc",self::CHECK_PUBLIC_PRIVATE_ATTR);

      $execContext = array('tplan_id' => $this->args[self::$testPlanIDParamName],
                           'platform_id' => null,'build_id' => null);

      if( $status_ok )
      {
        if( $this->_isParamPresent(self::$optionsParamName,$msg_prefix) )
        {
          $dummy = $this->args[self::$optionsParamName];
          if( is_array($dummy) )
          {
            foreach($dummy as $key => $value)
            {
              $options->$key = ($value > 0) ? 1 : 0;
            }
          }
        }

        // Now we can check for Optional parameters
        if($this->_isBuildIDPresent() || $this->_isBuildNamePresent())
        {
          if( ($status_ok = $this->checkBuildID($msg_prefix)) )
          {
            $execContext['build_id'] = $this->args[self::$buildIDParamName];
          }
        }

        if( $status_ok )
        {
          if( $this->_isParamPresent(self::$platformIDParamName,$msg_prefix) ||
              $this->_isParamPresent(self::$platformNameParamName,$msg_prefix) )
          {
            $status_ok = $this->checkPlatformIdentity($this->args[self::$testPlanIDParamName]);

            if( $status_ok)
            {
              $execContext['platform_id'] = $this->args[self::$platformIDParamName];
            }
          }
        }
      }


      if( $status_ok )
      {

        $sql = " SELECT (id) AS exec_id FROM {$this->tables['executions']} " .
               " WHERE testplan_id = {$this->args[self::$testPlanIDParamName]} " .
               " AND tcversion_id IN (" .
               " SELECT id FROM {$this->tables['nodes_hierarchy']} " .
               " WHERE parent_id = {$this->args[self::$testCaseIDParamName]})";

        if(!is_null($execContext['build_id']))
        {
          $sql .= " AND build_id = " . intval($execContext['build_id']);
        }

        if(!is_null($execContext['platform_id']))
        {
          $sql .= " AND platform_id = " . intval($execContext['platform_id']);
        }

        $rs = $this->dbObj->fetchRowsIntoMap($sql,'exec_id');
        if( is_null($rs) )
        {
          // has not been executed
          // execution id = -1 => test case has not been runned.
          $resultInfo[0]=array('id' => -1);
        }
        else
        {
                  foreach($rs as $tcExecId => $dummy){
                        $sql = "SELECT * FROM {$this->tables['executions']} WHERE id=" . $tcExecId;
                        $resultInfo[$tcExecId] = $this->dbObj->fetchFirstRow($sql);
                        if($options->getBugs)
                        {
                          $resultInfo[$tcExecId]['bugs'] = array();
                          $sql = " SELECT DISTINCT bug_id FROM {$this->tables['execution_bugs']} " .
                                   " WHERE execution_id = " . $tcExecId;
                          $resultInfo[$tcExecId]['bugs'] = (array)$this->dbObj->get_recordset($sql);
                        }
                  }
        }
      }

      return $status_ok ? $resultInfo : $this->errors;
    }
</code>
(0027650)
rusty (reporter)
2018-06-29 04:24

Other methods through the xmlrpc seem to be working just fine.
(0027651)
fman (administrator)
2018-06-29 15:26

1) this issue has been solved on latest code on GITHUB, not on latest stable release
2) other function code , is needed that function name is present on the mapping (as done for any other function)
(0027688)
fman (administrator)
2018-07-11 20:59

no more user feedback

- Issue History
Date Modified Username Field Change
2018-06-29 03:55 rusty New Issue
2018-06-29 04:09 rusty Note Added: 0027649
2018-06-29 04:24 rusty Note Added: 0027650
2018-06-29 15:26 fman Note Added: 0027651
2018-06-29 15:27 fman Assigned To => fman
2018-06-29 15:27 fman Status new => feedback
2018-07-11 20:59 fman QA Team - Task Workflow Status => READY FOR TESTING
2018-07-11 20:59 fman Note Added: 0027688
2018-07-11 20:59 fman Status feedback => closed
2018-07-11 20:59 fman Resolution open => fixed
2018-07-11 20:59 fman Fixed in Version => 1.9.18 (2018 Q3)



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker