Module: TDriverReportCreator
- Includes:
- TDriverCustomErrorRecovery, TDriverErrorRecovery
- Defined in:
- lib/tdriver/report/report_creator.rb,
lib/tdriver/report/report_test_run.rb,
lib/tdriver/report/report_test_case_run.rb
Overview
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Contact: Nokia Corporation ([email protected])
This file is part of TDriver.
If you have questions regarding the use of this file, please contact Nokia at [email protected] .
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation and appearing in the file LICENSE.LGPL included in the packaging of this file.
Defined Under Namespace
Classes: TestCaseRun, TestRun
Instance Method Summary collapse
- #add_report_group(value) ⇒ Object
- #add_test_case_group(value) ⇒ Object
- #calculate_execution_footprint_data_for_test_case ⇒ Object
-
#capture_screen_test_case ⇒ Object
This method takes a screenshot of current test case execution.
-
#clean_video_files ⇒ Object
Cleans any temporary files created by recording video.
-
#create_test_case_folder(status) ⇒ Object
This method creates or renames the test case folder.
- #each_video_device ⇒ Object
-
#end_test_case(test_case, status) ⇒ Object
This method ends the current test case execution.
-
#error_in_connection_detected ⇒ Object
This method registers a connection error.
-
#extract_group_from_test_case_name(test_case_name) ⇒ Object
This method returns the group where the test case belongs.
-
#start_run ⇒ Object
This method initializes new test run.
-
#start_test_case(test_case) ⇒ Object
This method starts a new test case run.
-
#update_run(test_case_name, status, reboots, crashes, execution_log) ⇒ Object
This method updates the current test run status.
-
#update_test_case(details) ⇒ Object
This method updates the current test case execution log.
-
#update_test_case_behaviour_log ⇒ Object
This updates the test case behaviour log.
-
#update_test_case_memory_usage ⇒ Object
This updates the test case behaviour log.
-
#update_test_case_user_data ⇒ Object
This method updates the current test case user data.
Methods included from TDriverCustomErrorRecovery
#ending_test_case, #ending_test_set_run, #error_in_connection, #error_in_test_case, #starting_test_case, #starting_test_set_run, #updating_test_case_details
Methods included from TDriverErrorRecovery
#attempt_reconnect, #initialize_error_recovery, #ping_device, #ping_devices_and_reconnect, #reconnect_devices, #start_error_recovery
Instance Method Details
#add_report_group(value) ⇒ Object
621 622 623 |
# File 'lib/tdriver/report/report_creator.rb', line 621 def add_report_group(value) $tdriver_reporter.set_generic_reporting_groups(value) end |
#add_test_case_group(value) ⇒ Object
624 625 626 |
# File 'lib/tdriver/report/report_creator.rb', line 624 def add_test_case_group(value) $new_test_case.set_test_case_group(value) end |
#calculate_execution_footprint_data_for_test_case ⇒ Object
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 |
# File 'lib/tdriver/report/report_creator.rb', line 474 def calculate_execution_footprint_data_for_test_case TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes| if sut_attributes[:is_connected] $tdriver_reporter.get_sut_total_dump_count(sut_id,sut_attributes) $tdriver_reporter.get_sut_total_sent_data(sut_id,sut_attributes) $tdriver_reporter.get_sut_total_received_data(sut_id,sut_attributes) end end $new_test_case.test_case_dump_count_at_end=$tdriver_reporter.total_dump_count $new_test_case.test_case_dump_count_at_end.each do |item| at_start=$new_test_case.test_case_dump_count_at_start[item[0]].to_i at_start=0 if at_start==nil at_end=item[1].to_i total=at_end-at_start $new_test_case.test_case_total_dump_count[item[0]]=total end $new_test_case.test_case_data_sent_at_end=$tdriver_reporter.total_sent_data $new_test_case.test_case_data_sent_at_end.each do |item| at_start=$new_test_case.test_case_data_sent_at_start[item[0]].to_i at_start=0 if at_start==nil at_end=item[1].to_i total=at_end-at_start $new_test_case.test_case_total_data_sent[item[0]]=total end $new_test_case.test_case_data_received_at_end=$tdriver_reporter.total_received_data $new_test_case.test_case_data_received_at_end.each do |item| at_start=$new_test_case.test_case_data_received_at_start[item[0]].to_i at_start=0 if at_start==nil at_end=item[1].to_i total=at_end-at_start $new_test_case.test_case_total_data_received[item[0]]=total end end |
#capture_screen_test_case ⇒ Object
This method takes a screenshot of current test case execution
params
returns
nil
raises
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 |
# File 'lib/tdriver/report/report_creator.rb', line 416 def capture_screen_test_case() begin create_test_case_folder($tdriver_reporter.fail_statuses.first) $new_test_case.capture_dump() if $new_test_case.video_recording? $new_test_case.copy_video_capture() end error_in_test_case(TDriver::SUTFactory.connected_suts) if $parameters[ :custom_error_recovery_module, nil ]!=nil rescue => ex puts ex. puts ex.backtrace end end |
#clean_video_files ⇒ Object
Cleans any temporary files created by recording video
629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 |
# File 'lib/tdriver/report/report_creator.rb', line 629 def clean_video_files [ @_video_file_name, @_previous_video_file_name ].each do | file_name | each_video_device do | video_device, device_index | begin delete_file = tdriver_report_folder() + "/cam_" + device_index + "_" + file_name if File.exists?( delete_file ) File.delete( delete_file ) end rescue # delete failed, do nothing end end end end |
#create_test_case_folder(status) ⇒ Object
This method creates or renames the test case folder
params
test_case: the test case name status: status of the test case
returns
nil
raises
400 401 402 403 404 405 406 407 408 |
# File 'lib/tdriver/report/report_creator.rb', line 400 def create_test_case_folder(status) if $new_test_case!=nil if $new_test_case.test_case_folder==nil $new_test_case.create_test_case_folder(status) else $new_test_case.rename_test_case_folder(status) end end end |
#each_video_device ⇒ Object
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 |
# File 'lib/tdriver/report/report_creator.rb', line 645 def each_video_device if $parameters[:report_video, nil] != nil device_index = 0 $parameters[:report_video].split("|").each do | video_device | if !video_device.strip.empty? yield video_device.strip, device_index.to_s device_index += 1 end end end end |
#end_test_case(test_case, status) ⇒ Object
This method ends the current test case execution
params
test_case: the test case name status: status of the test case
returns
nil
raises
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 |
# File 'lib/tdriver/report/report_creator.rb', line 520 def end_test_case(test_case,status) $new_test_case.set_test_case_ended(true) if $new_test_case update_test_case_user_data() if $new_test_case != nil calculate_execution_footprint_data_for_test_case if $parameters[:report_crash_file_monitor] == 'true' found_crash_files = $new_test_case.check_if_crash_files_exist() if found_crash_files.to_i > 0 $tdriver_reporter.set_total_crash_files(found_crash_files.to_i) $new_test_case.set_test_case_crash_files(found_crash_files.to_i) status='failed' end end if $parameters[:report_file_monitor] == 'true' found_files = $new_test_case.check_if_files_exist() if found_files.to_i > 0 $tdriver_reporter.set_total_crash_files(found_files.to_i) $new_test_case.set_test_case_crash_files(found_files.to_i) status='failed' if $parameters[:report_fail_test_if_files_found]=='true' end end temp_rec = $new_test_case.video_recording? if temp_rec $new_test_case.stop_video_recording end if $tdriver_reporter.test_case_user_defined_status!=nil status=$tdriver_reporter.test_case_user_defined_status $tdriver_reporter.set_test_case_user_defined_status(nil) end if(status=='failed') $new_test_case.set_test_case_status($tdriver_reporter.fail_statuses.first) create_test_case_folder($tdriver_reporter.fail_statuses.first) if found_crash_files.to_i > 0 $new_test_case.capture_crash_files() end if $new_test_case.video_recording? $new_test_case.copy_video_capture() end end if(status=='passed') no_activity_videos = "" if $parameters[:report_check_device_active, 'false']=='true' if temp_rec no_activity_videos = $new_test_case.target_video_alive end end if no_activity_videos == "" $new_test_case.set_test_case_status($tdriver_reporter.pass_statuses.first) create_test_case_folder($tdriver_reporter.pass_statuses.first) else # switch case to failed status status='failed' $new_test_case.copy_video_capture $new_test_case.update_test_case "The case failed due to video analysis (#{no_activity_videos}) indicating that the target is no longer responding." $new_test_case.set_test_case_status($tdriver_reporter.fail_statuses.first) create_test_case_folder($tdriver_reporter.fail_statuses.first) if found_crash_files.to_i > 0 $new_test_case.capture_crash_files() end end end if(status!='passed' && status!='failed') $new_test_case.set_test_case_status($tdriver_reporter.not_run_statuses.first) create_test_case_folder($tdriver_reporter.not_run_statuses.first) end $new_test_case.set_test_case_end_time(Time.now) update_test_case_behaviour_log() update_test_case_memory_usage() if $parameters[ :report_monitor_memory, 'false']=='true' execution_log=$new_test_case.test_case_execution_log if $parameters[:report_trace_capture_only_in_failed_case, 'true']!='true' $new_test_case.capture_trace_files() else if status=='failed' $new_test_case.capture_trace_files() end end if found_files.to_i > 0 $new_test_case.capture_files() end $new_test_case.update_test_case_page() $new_test_case.clean_files_from_sut() update_run($new_test_case.test_case_name.to_s,status,$new_test_case.test_case_reboots,$new_test_case.test_case_crash_files,execution_log) $new_junit_xml_results.add_test_result(status, $new_test_case.test_case_start_time, $new_test_case.test_case_end_time) tdriver_update_sequential_fails( status ) if $parameters[ :runner_sequence_skip, "false" ] == "true" $new_test_case=nil execution_log=nil end ending_test_case(status, TDriver::SUTFactory.connected_suts) if $parameters[ :custom_error_recovery_module, nil ]!=nil end |
#error_in_connection_detected ⇒ Object
This method registers a connection error
params
status: last test case result
returns
nil
raises
129 130 131 132 133 134 |
# File 'lib/tdriver/report/report_creator.rb', line 129 def error_in_connection_detected error_in_connection if $parameters[ :custom_error_recovery_module, nil ]!=nil $tdriver_reporter.connection_errors+=1 if $tdriver_reporter $new_test_case.connection_errors+=1 if $new_test_case $new_test_case.set_test_case_execution_log('<b style="color: #FF0000">WARNING: Connection error detected!</b>') if $new_test_case end |
#extract_group_from_test_case_name(test_case_name) ⇒ Object
This method returns the group where the test case belongs
params
status: last test case result
returns
nil
raises
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/tdriver/report/report_creator.rb', line 142 def extract_group_from_test_case_name(test_case_name) found_in_group='not_in_any_user_defined_group' groups=$parameters[ :report_groups, nil ] unless groups == nil groups_ar=groups.split('|') groups_ar.each do |group| group_ar=group.split(':') group_ar.each do |group_name| found_in_group=group_name if test_case_name.include? group_name end end else found_in_group=$new_test_case.test_case_group end found_in_group end |
#start_run ⇒ Object
This method initializes new test run
params
nil
returns
nil
raises
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/tdriver/report/report_creator.rb', line 31 def start_run() @_video_file_name = "failed_test.avi" @_previous_video_file_name = "previous_test.avi" @_stored_details=[] clean_video_files if $tdriver_reporter == nil initialize_error_recovery $run_status_thread_active=false $test_case_run_index=0 $tdriver_reporter=TestRun.new $tdriver_reporter.initialize_tdriver_report_folder() $tdriver_report_created=false $current_tdriver_report_folder=$tdriver_reporter.report_folder $new_junit_xml_results=ReportJUnitXml.new($current_tdriver_report_folder) $tdriver_reporter.set_end_time(Time.now) $tdriver_reporter.set_total_failed(0) $tdriver_reporter.set_total_passed(0) $tdriver_reporter.set_total_not_run(0) $tdriver_reporter.set_total_run(0) $tdriver_reporter.update_summary_page('inprogress') $tdriver_reporter.update_environment_page() at_exit { while $run_status_thread_active == true sleep 1 end if $new_test_case!=nil if $new_test_case.test_case_ended==false end_test_case($new_test_case.test_case_name,'not_run') end end puts 'Generating report summary...' exit_status='' exit_status << "Stderr:#{$stderr}<hr/>" exit_status << "Stdout:#{$stdout}<hr/>" exit_status << "Exit command:#{$!}<br/>" exit_status << "Backtrace:#{$@}" $tdriver_reporter.update_summary_page('finished',exit_status) puts 'Summary generated...' puts 'Generating total run table...' $tdriver_reporter.update_test_case_summary_pages('all') puts 'Total run table generated...' if $tdriver_reporter.report_exclude_passed_cases=='false' puts 'Generating passed cases table...' $tdriver_reporter.update_test_case_summary_pages('passed') puts 'Passed table generated...' end puts 'Generating failed cases table...' $tdriver_reporter.update_test_case_summary_pages('failed') puts 'Failed table generated...' puts 'Generating not run cases table...' $tdriver_reporter.update_test_case_summary_pages('not run') puts 'Not run table generated...' puts 'Generating statistics table...' $tdriver_reporter.update_test_case_summary_pages('statistics') puts 'Statistics generated...' puts 'Grouping results by result and name...' $tdriver_reporter.group_results_by_test_case() puts 'Tests grouped by result and name...' if $parameters[ :create_run_table_csv, false ]=='true' puts 'Generating CSV...' $tdriver_reporter.create_csv puts 'CSV generated...' end puts 'Generating Junit xml...' $new_junit_xml_results.create_junit_xml() puts 'Junit generated...' #$tdriver_reporter.delete_result_storage() $tdriver_reporter.disconnect_connected_devices() $tdriver_reporter.update_tdriver_log_page() puts 'Report generated to:' puts $tdriver_reporter.report_folder() clean_video_files ending_test_set_run if $parameters[ :custom_error_recovery_module, nil ]!=nil if $tdriver_reporter.total_failed.to_i > 0 Kernel.exit(1) elsif $tdriver_reporter.total_run.to_i == 0 Kernel.exit(1) elsif $tdriver_reporter.total_not_run.to_i > 0 Kernel.exit(1) end } else initialize_error_recovery end starting_test_set_run if $parameters[ :custom_error_recovery_module, nil ]!=nil end |
#start_test_case(test_case) ⇒ Object
This method starts a new test case run
params
test_case: the new test case name
returns
nil
raises
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
# File 'lib/tdriver/report/report_creator.rb', line 261 def start_test_case(test_case) if $new_test_case!=nil if $new_test_case.test_case_ended==false end_test_case($new_test_case.test_case_name,@tc_status) end end $test_case_run_index=$test_case_run_index.to_i+1 $new_test_case=TestCaseRun.new $new_test_case.set_test_cases_folder($current_tdriver_report_folder.to_s+'/cases') $new_test_case.set_test_case_name(test_case.to_s) $new_test_case.set_test_case_start_time(Time.now) $new_test_case.set_test_case_index($test_case_run_index.to_i) $new_test_case.test_case_dump_count_at_start=$tdriver_reporter.total_dump_count.clone $new_test_case.test_case_data_sent_at_start=$tdriver_reporter.total_sent_data.clone $new_test_case.test_case_data_received_at_start=$tdriver_reporter.total_received_data.clone create_test_case_folder('result') begin if start_error_recovery()==true $tdriver_reporter.set_total_device_resets(1) $new_test_case.set_test_case_reboots(1) end rescue Exception => e update_test_case("Error recovery failed Exception: #{e.} Backtrace: #{e.backtrace}") end_test_case($new_test_case.test_case_name,'failed') exit(1) end $new_test_case.read_crash_monitor_settings() $new_test_case.read_file_monitor_settings() $new_test_case.clean_crash_files_from_sut() if $test_case_run_index==1 && $parameters[ :report_crash_file_monitor_crash_file_cleanup, false ]=='true' amount_of_crash_files=$new_test_case.check_if_crash_files_exist() if amount_of_crash_files.to_i > 0 $new_test_case.capture_crash_files() $new_test_case.clean_crash_files_from_sut() $tdriver_reporter.set_total_crash_files(amount_of_crash_files.to_i) $new_test_case.set_test_case_crash_files(amount_of_crash_files.to_i) else if $parameters[ :report_crash_file_monitor_confirm_any_crash_note, false ]=='true' $new_test_case.confirm_crash_notes end end amount_of_files=$new_test_case.check_if_files_exist() if amount_of_files.to_i > 0 $new_test_case.capture_files() $new_test_case.clean_files_from_sut() $tdriver_reporter.set_total_crash_files(amount_of_files.to_i) $new_test_case.set_test_case_crash_files(amount_of_files.to_i) end if $parameters[ :report_monitor_memory, 'false']=='true' begin TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes| $new_test_case.set_tc_memory_amount_total($tdriver_reporter.get_sut_total_memory(sut_id,sut_attributes)) $new_test_case.set_tc_memory_amount_start($tdriver_reporter.get_sut_used_memory(sut_id,sut_attributes)) end rescue $new_test_case.set_tc_memory_amount_total(0) $new_test_case.set_tc_memory_amount_start(0) end end logging_enabled = MobyUtil::Logger.instance.enabled begin if $parameters[:report_video, "false"] != "false" # copy previous recording MobyUtil::Logger.instance.enabled=false each_video_device do | video_device, device_index | begin FileUtils.mv(tdriver_report_folder() + "/cam_" + device_index + "_" + @_video_file_name, tdriver_report_folder() + "/cam_" + device_index + "_" + @_previous_video_file_name ) rescue # do nothing.. end end $new_test_case.start_video_recording( @_video_file_name, @_previous_video_file_name ) MobyUtil::Logger.instance.enabled=logging_enabled end rescue Exception => e ensure MobyUtil::Logger.instance.enabled=logging_enabled end update_test_case_user_data() starting_test_case(test_case, TDriver::SUTFactory.connected_suts) if $parameters[ :custom_error_recovery_module, nil ]!=nil end |
#update_run(test_case_name, status, reboots, crashes, execution_log) ⇒ Object
This method updates the current test run status
params
status: last test case result
returns
nil
raises
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/tdriver/report/report_creator.rb', line 165 def update_run(test_case_name,status,reboots,crashes,execution_log) group=extract_group_from_test_case_name($new_test_case.test_case_name_full) current_status='' if(status=='failed') current_status=$tdriver_reporter.fail_statuses.first $tdriver_reporter.set_total_failed(1) end if(status=='passed') current_status=$tdriver_reporter.pass_statuses.first $tdriver_reporter.set_total_passed(1) end if(status!='passed' && status!='failed') current_status=$tdriver_reporter.not_run_statuses.first $tdriver_reporter.set_total_not_run(1) end $tdriver_reporter.write_to_result_storage( current_status, test_case_name, group, reboots, crashes, $new_test_case.test_case_start_time, $new_test_case.test_case_chronological_view_data, $new_test_case.test_case_run_time, $new_test_case.tc_memory_amount_end, $new_test_case.test_case_index, execution_log, '', '', $new_test_case.test_case_total_dump_count, $new_test_case.test_case_total_data_sent, $new_test_case.test_case_total_data_received, $new_test_case.test_case_user_data, $new_test_case.test_case_user_data_columns, $new_test_case.connection_errors ) $tdriver_reporter.test_case_user_xml_data=Hash.new $tdriver_reporter.set_end_time(Time.now) $tdriver_reporter.set_total_run(1) $tdriver_reporter.update_summary_page('inprogress') $tdriver_reporter.update_environment_page() if $parameters[ :realtime_status_page_update, false ]=='true' if $run_status_thread_active == false $run_status_thread_active=true Thread.new do begin #Update test case summary pages $tdriver_reporter.update_test_case_summary_pages('all') $tdriver_reporter.update_test_case_summary_pages('passed') if $tdriver_reporter.report_exclude_passed_cases=='false' $tdriver_reporter.update_test_case_summary_pages('failed') $tdriver_reporter.update_test_case_summary_pages('not run') $tdriver_reporter.update_test_case_summary_pages('statistics') $tdriver_reporter.group_results_by_test_case() $new_junit_xml_results.create_junit_xml() $tdriver_reporter.update_tdriver_log_page() #ML: Update summary every 10 seconds improves performance during execution sleep 10 $run_status_thread_active=false GC.start rescue Exception => e $run_status_thread_active=false end end end end end |
#update_test_case(details) ⇒ Object
This method updates the current test case execution log
params
details: details to be added in to the execution log
returns
nil
raises
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
# File 'lib/tdriver/report/report_creator.rb', line 361 def update_test_case(details) if $new_test_case==nil @_stored_details << details else if @_stored_details!=[] && @_stored_details!=nil @_stored_details.each do |detail| $new_test_case.set_test_case_execution_log(detail) end $new_test_case.set_test_case_execution_log(details,true) @_stored_details=[] else $new_test_case.set_test_case_execution_log(details,true) end updating_test_case_details(details) if $parameters[ :custom_error_recovery_module, nil ]!=nil if $parameters[ :report_monitor_memory, 'false']=='true' begin start_memory=$new_test_case.tc_memory_amount_start() if start_memory=='-' TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes| memory=$tdriver_reporter.get_sut_used_memory(sut_id,sut_attributes) $new_test_case.set_tc_memory_amount_start(memory) end end rescue $new_test_case.set_tc_memory_amount_start(0) end end end end |
#update_test_case_behaviour_log ⇒ Object
This updates the test case behaviour log
params
returns
nil
raises
459 460 461 462 463 464 465 466 467 468 469 470 471 472 |
# File 'lib/tdriver/report/report_creator.rb', line 459 def update_test_case_behaviour_log() begin if $parameters[:behaviour_logging] == 'true' if $new_test_case.test_case_logging_level.to_i > 0 $tdriver_report_log_output.string.each do |line| $new_test_case.set_test_case_behaviour_log(line,nil) $tdriver_reporter.set_test_run_behaviour_log(line,$new_test_case.test_case_name_full) if $new_test_case.report_short_folders=='false' $tdriver_reporter.set_test_run_behaviour_log(line,"#{$new_test_case.test_case_status}_#{$new_test_case.test_case_index}") if $new_test_case.report_short_folders=='true' end end end rescue end end |
#update_test_case_memory_usage ⇒ Object
This updates the test case behaviour log
params
returns
nil
raises
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 |
# File 'lib/tdriver/report/report_creator.rb', line 437 def update_test_case_memory_usage() begin TDriver::SUTFactory.connected_suts.each do |sut_id, sut_attributes| if sut_attributes[:is_connected] memory=$tdriver_reporter.get_sut_used_memory(sut_id,sut_attributes) $tdriver_reporter.get_sut_total_dump_count(sut_id,sut_attributes) $tdriver_reporter.get_sut_total_sent_data(sut_id,sut_attributes) $tdriver_reporter.get_sut_total_received_data(sut_id,sut_attributes) $new_test_case.set_tc_memory_amount_end(memory) $tdriver_reporter.set_memory_amount_end(memory) end end rescue $new_test_case.set_tc_memory_amount_end(0) end end |
#update_test_case_user_data ⇒ Object
This method updates the current test case user data
params
returns
nil
raises
243 244 245 246 247 248 249 250 251 252 |
# File 'lib/tdriver/report/report_creator.rb', line 243 def update_test_case_user_data() if $new_test_case != nil user_data_rows, user_data_cols=$tdriver_reporter.get_user_data $new_test_case.set_test_case_user_data(user_data_rows, user_data_cols) chronological_data_rows=$tdriver_reporter.test_case_user_chronological_table_data $new_test_case.set_test_case_chronological_view_data(chronological_data_rows) $tdriver_reporter.set_user_data(nil) $tdriver_reporter.set_user_chronological_table_data(nil) end end |