Luxoft / Twister

Twister Test Automation Framework
http://www.twistertesting.com/
Apache License 2.0
38 stars 21 forks source link

Database error due to empty run_number field #156

Closed mmajdoubi closed 9 years ago

mmajdoubi commented 9 years ago

This error only appears after defining a sub testsuite underneath a main test suite, the sub testsuite should inherit the run number of the main test suite.

The database error is generated when test results are saved, the error complains about an empty run_number field in the INSERT SQL statement. The screenshot of the project that I am using is listed below, the generated error is also included. Is this a normal behavior or a known issue?

Thanks in advance

With kind regards M. Majdoubi

screen shot 2014-12-17 at 10 50 32 am

14-12-17 09:43:42 ERROR CeDatabase.py: 460: save_to_database Error in query INSERT INTO results ( run_nb,username,ce_hostname,ce_ip,ep_ip,ep_hostname,ep_name,suite_name,tc_name,tc_path,tc_status,tc_time_elapsed,tc_date_started,tc_date_finished,tc_log ) VALUES (, 'user', 'mohamedm-virtual-machine', '127.0.1.1', '127.0.1.1', 'mohamedm-virtual-machine', 'mohamedm-virtual-machine_EP-1001', 'Suite1-1', 'ChangeAccessSpeed.py', '/home/user/twister/demo/FCN/mysql/ChangeAccessSpeed.py', 'PASS', '0', '2014-12-17T09:43:32.718179', '2014-12-17T09:43:32.819789', '<<< START filename:1001:/home/user/twister/demo/FCN/mysql/ChangeAccessSpeed.py>>><br>\n<br>\nHello, user user !<br>\nSystem under test: /SUT-1.user<br>\nExec process: mohamedm-virtual-machine_EP-1001<br>\nSuite: Suite1-1<br>\nConfig files: []<br>\nProperties: {\'RemoteID\': \'GIP9040000001\', \'AccessSpeed\': \'200000\', \'Running\': \'true\'}<br>\nQuery: UPDATE gia_radius.ipverbindingen SET speed=200000 WHERE ipdienstnummer=\'GIP9040000001\' <br>\nProperties: GIP9040000001 200000<br>\n<br>\n>>> File/home/user/twister/demo/FCN/mysql/ChangeAccessSpeed.pyreturnedPASS. <<<<br>\n<br>\nTest statistics: Start time 2014-12-17 09:43:32 -- End time 2014-12-17 09:43:32 -- 0.10 sec.<br>\n<br>\n<<< END filename:1001:/home/user/twister/demo/FCN/mysql/ChangeAccessSpeed.py>>>') for user user! MySQL Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 'user', 'mohamedm-virtual-machine', '127.0.1.1', '127.0.1.1', 'mohamedm-virtual' at line 3!

bogdanpopescu commented 9 years ago

@mmajdoubi Please upgrade to latest and verify the fix.

mmajdoubi commented 9 years ago

First of all, a very healthy and successful 2015.

The provided fix does the job! Thanks a lot for providing the solution.