Skip to content

Commit

Permalink
tr to make sure manager is really stopped before next test
Browse files Browse the repository at this point in the history
Issue #252
  • Loading branch information
damies13 committed Nov 2, 2024
1 parent 3105371 commit 039697d
Show file tree
Hide file tree
Showing 3 changed files with 288 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Tests/Regression/Manager/GUI_Basic.robot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Library ImageHorizonLibrary reference_folder=${IMAGE_DIR}
*** Variables ***
${default_image_timeout} ${120}
${cmd_agent} rfswarm-agent
${cmd_manager} rfswarm
${cmd_manager} rfswarm-manager
${IMAGE_DIR} ${CURDIR}/Images/file_method
${pyfile} ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py
${process} None
Expand Down Expand Up @@ -71,7 +71,7 @@ Open GUI
Set Test Variable $process ${process}
# Sleep 10 # not needed now we wait for the agents tab to be visible
Set Screenshot Folder ${OUTPUT DIR}

Handle Donation Reminder

${img}= Set Variable manager_${platform}_tab_agents.png
Expand Down Expand Up @@ -111,6 +111,7 @@ Close GUI
${result} = Terminate Process ${process}
Fail
END
Kill Manager If Still Running

Close GUI
[Tags] macos-latest
Expand All @@ -128,6 +129,7 @@ Close GUI
${result} = Terminate Process ${process}
Fail
END
Kill Manager If Still Running

# Intentional Fail
# [Tags] ubuntu-latest windows-latest macos-latest
Expand Down
19 changes: 18 additions & 1 deletion Tests/Regression/Manager/GUI_Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ${global_name} None
@{mngr_options} None
@{agent_options} None
${cmd_agent} rfswarm-agent
${cmd_manager} rfswarm
${cmd_manager} rfswarm-manager
${IMAGE_DIR} ${CURDIR}/Images/file_method
${pyfile_manager} ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py
${pyfile_agent} ${EXECDIR}${/}rfswarm_agent${/}rfswarm_agent.py
Expand Down Expand Up @@ -182,6 +182,7 @@ Close Manager GUI
Fail
END
END
Kill Manager If Still Running
# stdout=${OUTPUT DIR}${/}stdout_manager.txt stderr=${OUTPUT DIR}${/}stderr_manager.txt
Show Log ${OUTPUT DIR}${/}stdout_manager.txt
Show Log ${OUTPUT DIR}${/}stderr_manager.txt
Expand Down Expand Up @@ -222,9 +223,13 @@ Close Manager GUI macos
Fail
END
END
Kill Manager If Still Running
Show Log ${OUTPUT DIR}${/}stdout_manager.txt
Show Log ${OUTPUT DIR}${/}stderr_manager.txt

Kill Manager If Still Running
Kill If Still Running ${cmd_manager}

Stop Agent
${running}= Is Process Running ${process_agent}
IF ${running}
Expand All @@ -240,10 +245,22 @@ Stop Agent
# Should Be Equal As Integers ${result.rc} 0
END

Kill Agent If Still Running
# stdout=${OUTPUT DIR}${/}stdout_agent.txt stderr=${OUTPUT DIR}${/}stderr_agent.txt
Show Log ${OUTPUT DIR}${/}stdout_agent.txt
Show Log ${OUTPUT DIR}${/}stderr_agent.txt

Kill Agent If Still Running
Kill If Still Running ${cmd_agent}

Kill If Still Running
[Arguments] ${cmdname}
${processes}= Evaluate psutil.process_iter() modules=psutil
FOR ${p} IN ${processes}
IF "${cmdname}" in ${p.name()}
Evaluate ${p.kill()}
END
END

Show Log
[Arguments] ${filename}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
[Report]
order = FBB202E151A,FBB202E1535,FBB202E153E,FBB202E1561,FBB202E1580,FBB202E15C6,FBB202E1675
title = Odoo-demo

[FBB202E151A]
name = Information
parent = TOP
type = note
changed = 1729637319.1986918
note = Define your template by adding sections and configuring the section settingsx12Each section can be:x12 - Note (like this) section, free textx12 - Heading, usefull for grouping sectionsx12 - Contents like a table of contents or figuresx12 - Data Table, with data from test resultsx12 - Data Graph, for graphical representation of test resultsx12 - Errors, gather error details and screenshots (if applicable) from robot logsx12x12Each section can also have sub sections.x12x12Use the arrows buttons to move sections up and down within the report.x12x12The cover page and overall report settings can be found on the settings pane of the Report item above.x12x12When you have your report how you like it, save it as a report template, so your future test results can use the same report format.x12x12

[FBB202E1535]
name = Table of Contents
parent = TOP
type = contents
changed = 1729637319.1996338
mode = Table Of Contents
level = 2

[FBB202E153E]
name = Scenario Plan
parent = TOP
type = graph
changed = 1729637319.200035
order = FBB202E1549

[FBB202E153EL]
datatype = Plan
changed = 1729637567.0012894
showtotal = 1
sql = SELECT md1.* , md0.SecondaryMetric as x91Filex93 , fp0.SecondaryMetric as x91FilePathx93 FROM MetricData as md0 LEFT JOIN MetricData as fp0 ON fp0.MetricValue = md0.MetricValue AND fp0.MetricType = 'Scenario' AND fp0.PrimaryMetric like 'Local_Path_x37' LEFT JOIN MetricData as md1 ON md1.SecondaryMetric = md0.MetricValue AND md1.MetricType = 'Scenario' WHERE md0.MetricType = 'Scenario' AND md0.PrimaryMetric like 'Test_x37'

[FBB202E153ER]
datatype = None
changed = 1729637319.2008398

[FBB202E1549]
name = Scenario Detail
parent = FBB202E153E
type = table
changed = 1729637567.7744186
colours = 1
datatype = Plan
col_index_show = 1
col_robots_show = 1
col_delay_show = 1
col_ramp_up_show = 1
col_run_show = 1
col_script_show = 1
col_script_opt = File
col_test_show = 1
sql = SELECT md1.* , md0.SecondaryMetric as x91Filex93 , fp0.SecondaryMetric as x91FilePathx93 FROM MetricData as md0 LEFT JOIN MetricData as fp0 ON fp0.MetricValue = md0.MetricValue AND fp0.MetricType = 'Scenario' AND fp0.PrimaryMetric like 'Local_Path_x37' LEFT JOIN MetricData as md1 ON md1.SecondaryMetric = md0.MetricValue AND md1.MetricType = 'Scenario' WHERE md0.MetricType = 'Scenario' AND md0.PrimaryMetric like 'Test_x37'

[FBB202E1561]
name = Test Result Summary
parent = TOP
type = table
changed = 1729637568.4009151
colours = 0
datatype = ResultSummary
col_result_name_show = 1
col_minimum_show = 0
col_average_show = 1
col_90x37ile_show = 1
col_maximum_show = 1
col_std_dev_show = 1
col_pass_show = 1
col_fail_show = 1
col_other_show = 0
sql = SELECT r.result_name as x91Result Namex93 , round(min(rp.elapsed_time),3) 'Minimum', round(avg(rp.elapsed_time),3) 'Average', round(percentile(rp.elapsed_time, 90),3) '90x37ile', round(max(rp.elapsed_time),3) 'Maximum', round(stdev(rp.elapsed_time),3) 'Std. Dev.', count(rp.result) as 'Pass', count(rf.result) as 'Fail', count(ro.result) as 'Other' FROM Results as r LEFT JOIN Results as rp ON r.rowid == rp.rowid AND rp.result == 'PASS' LEFT JOIN Results as rf ON r.rowid == rf.rowid AND rf.result == 'FAIL' LEFT JOIN Results as ro ON r.rowid == ro.rowid AND ro.result <> 'PASS' AND ro.result <> 'FAIL' WHERE r.end_time >= 1690513420 AND r.end_time <= 1690513632 GROUP BY r.result_name ORDER BY x91Result Namex93

[FBB202E1580]
name = Robots vs Response Time
parent = TOP
type = graph
changed = 1729637319.2068226
order = FBB202E159B,FBB202E15A7

[FBB202E1580L]
resulttype = Response Time
changed = 1729637572.9930325
datatype = Result
sql = SELECT end_time as 'Time' , elapsed_time as 'Value' , result_name as x91Namex93 FROM Results WHERE x91Namex93 NOT LIKE 'Exception in threadx37' AND end_time >= 1690513420 AND end_time <= 1690513632

[FBB202E1580R]
datatype = Metric
changed = 1729637572.995431
axisen = 1
metrictype = Scenario
secondarymetric = total_robots
sql = SELECT MetricTime as 'Time' , MetricValue as 'Value' , PrimaryMetric as x91Namex93 FROM MetricData WHERE MetricType == 'Scenario' AND SecondaryMetric == 'total_robots' AND MetricTime >= 1690513420 AND MetricTime <= 1690513632 ORDER BY MetricTime

[FBB202E159B]
name = Response Times
parent = FBB202E1580
type = table
changed = 1729637573.944291
colours = 1
datatype = Result
resulttype = Response Time
sql = SELECT result_name as x91Result Namex93 , round(min(elapsed_time),3) 'Minimum' , round(avg(elapsed_time),3) 'Average' , round(percentile(elapsed_time, 90),3) '90x37ile' , round(max(elapsed_time),3) 'Maximum' , round(stdev(elapsed_time),3) 'Std. Dev.' , count(result) as 'Count' FROM Results WHERE x91Result Namex93 NOT LIKE 'Exception in threadx37' AND end_time >= 1690513420 AND end_time <= 1690513632 GROUP by x91Result Namex93

[FBB202E15A7]
name = Robots
parent = FBB202E1580
type = table
changed = 1729638144.8322651
colours = 1
datatype = Metric
metrictype = Scenario
secondarymetric = total_robots
isnumeric = 1
showcount = 1
col_primarymetric_show = 1
col_minimum_show = 0
col_average_show = 0
col_90x37ile_show = 0
col_maximum_show = 1
col_std_dev_show = 0
col_maximum = Robots
sql = SELECT PrimaryMetric , PrimaryMetric as x91Colourx93 , min(CAST(MetricValue AS NUMERIC)) AS 'Minimum' , round(avg(CAST(MetricValue AS NUMERIC)),3) AS 'Average' , round(percentile(CAST(MetricValue AS NUMERIC), 90),3) AS '90x37ile' , max(CAST(MetricValue AS NUMERIC)) AS 'Maximum' , round(stdev(CAST(MetricValue AS NUMERIC)),3) AS 'Std. Dev.' FROM MetricData WHERE MetricType == 'Scenario' AND SecondaryMetric == 'total_robots' AND MetricTime >= 1690513420 AND MetricTime <= 1690513632 GROUP by PrimaryMetric

[FBB202E15C6]
name = Agents
parent = TOP
type = head
changed = 1729637319.2137787
order = FBB202E15CB,FBB202E15EE,FBB202E161A,FBB202E163B

[FBB202E15CB]
name = Agent CPU Usage
parent = FBB202E15C6
type = graph
changed = 1729637319.2142203

[FBB202E15CBL]
metrictype = Agent
changed = 1729638145.9943745
axisen = 1
datatype = Metric
secondarymetric = CPU
enablefilteragent = 1
sql = SELECT MetricTime as 'Time' , MetricValue as 'Value' , PrimaryMetric || ' - ' || DataSource as x91Namex93 FROM MetricData WHERE MetricType == 'Agent' AND SecondaryMetric == 'CPU' AND MetricTime >= 1690513420 AND MetricTime <= 1690513632 ORDER BY MetricTime

[FBB202E15CBR]
datatype = Metric
changed = 1729638145.995011
axisen = 1
metrictype = Scenario
secondarymetric = total_robots
sql = SELECT MetricTime as 'Time' , MetricValue as 'Value' , PrimaryMetric as x91Namex93 FROM MetricData WHERE MetricType == 'Scenario' AND SecondaryMetric == 'total_robots' AND MetricTime >= 1690513420 AND MetricTime <= 1690513632 ORDER BY MetricTime

[FBB202E15EE]
name = Agent Memory (RAM) Usage
parent = FBB202E15C6
type = graph
changed = 1729637319.217737

[FBB202E15EEL]
metrictype = Agent
changed = 1729638146.922814
axisen = 1
datatype = Metric
secondarymetric = MEM
enablefilteragent = 1
sql = SELECT MetricTime as 'Time' , MetricValue as 'Value' , PrimaryMetric || ' - ' || DataSource as x91Namex93 FROM MetricData WHERE MetricType == 'Agent' AND SecondaryMetric == 'MEM' AND MetricTime >= 1690513420 AND MetricTime <= 1690513632 ORDER BY MetricTime

[FBB202E15EER]
datatype = Metric
changed = 1729638146.923772
axisen = 1
metrictype = Scenario
secondarymetric = total_robots
sql = SELECT MetricTime as 'Time' , MetricValue as 'Value' , PrimaryMetric as x91Namex93 FROM MetricData WHERE MetricType == 'Scenario' AND SecondaryMetric == 'total_robots' AND MetricTime >= 1690513420 AND MetricTime <= 1690513632 ORDER BY MetricTime

[FBB202E161A]
name = Agent Names
parent = FBB202E15C6
type = table
changed = 1729638147.930704
colours = 1
datatype = Metric
metrictype = Agent
col_primarymetric_show = 0
col_metrictype_show = 1
col_secondarymetric_show = 1
col_metricvalue_show = 0
enablefilteragent = 1
secondarymetric = CPU
col_agent_show = 1
sql = SELECT PrimaryMetric , DataSource 'Agent' , PrimaryMetric || ' - ' || DataSource as x91Colourx93 , MetricValue FROM MetricData WHERE MetricType == 'Agent' AND SecondaryMetric == 'CPU' AND MetricTime >= 1690513420 AND MetricTime <= 1690513632 GROUP by PrimaryMetric , DataSource

[FBB202E163B]
name = Agent Details
parent = FBB202E15C6
type = table
changed = 1729638148.507979
colours = 0
datatype = Metric
metrictype = Metric
col_primarymetric_show = 1
col_metrictype_show = 1
col_secondarymetric_show = 1
col_metricvalue_show = 1
enablefilteragent = 1
col_agent_show = 0
col_primarymetric = Agent Name
col_secondarymetric = Metric Name
col_metricvalue = Metric Value
sql = SELECT PrimaryMetric , SecondaryMetric , DataSource 'Agent' , MetricValue FROM MetricData WHERE MetricType == 'Metric' AND MetricTime >= 1690513420 AND MetricTime <= 1690513632 GROUP by PrimaryMetric , SecondaryMetric , DataSource

[FBB202E1675]
name = Errors
parent = TOP
type = head
changed = 1729637319.2312448
order = FBB202E167A,FBB202E16A4,FBB202E16C3

[FBB202E167A]
name = Failed Keywords Graph
parent = FBB202E1675
type = graph
changed = 1729637319.232055

[FBB202E167AL]
axisen = 1
changed = 1729638149.4453115
resulttype = TPS
filterresult = Fail
datatype = Result
enablefilterresult = 1
sql = SELECT floor(end_time) as 'Time' , count(result) as 'Value' , result_name as x91Namex93 FROM Results WHERE result == 'FAIL' AND x91Namex93 NOT LIKE 'Exception in threadx37' AND end_time >= 1690513420 AND end_time <= 1690513632 GROUP by floor(end_time) , result_name , result ORDER by floor(end_time), result DESC, count(result) DESC

[FBB202E167AR]
datatype = Metric
changed = 1729638149.4464364
axisen = 1
metrictype = Scenario
secondarymetric = total_robots
sql = SELECT MetricTime as 'Time' , MetricValue as 'Value' , PrimaryMetric as x91Namex93 FROM MetricData WHERE MetricType == 'Scenario' AND SecondaryMetric == 'total_robots' AND MetricTime >= 1690513420 AND MetricTime <= 1690513632 ORDER BY MetricTime

[FBB202E16A4]
name = Failed Keywords Names
parent = FBB202E1675
type = table
changed = 1729638150.3266408
colours = 1
datatype = Result
resulttype = TPS
filterresult = Fail
enablefilterresult = 1
col_result_name_show = 1
col_result_show = 1
col_count_show = 1
sql = SELECT result_name as x91Result Namex93 , result 'Result' , count(result) as 'Count' FROM Results WHERE result == 'FAIL' AND x91Result Namex93 NOT LIKE 'Exception in threadx37' AND end_time >= 1690513420 AND end_time <= 1690513632 GROUP by x91Result Namex93 , result ORDER BY result DESC, count(result) DESC

[FBB202E16C3]
name = Error Details
parent = FBB202E1675
type = errors
changed = 1729638151.0472698
images = 1
grouprn = 1
groupet = 1
sql = SELECT r.script_index || '_' || r.robot || '_' || r.iteration || '_' || r.sequence 'id' , r.result_name , r.script_index , r.robot , r.iteration , r.sequence , mt.SecondaryMetric 'script' , mt.MetricValue 'test_name' FROM Results r LEFT JOIN MetricData mt on mt.PrimaryMetric = r.script_index AND mt.MetricType = 'Scenario_Test' WHERE r.result = 'FAIL' AND r.end_time >= 1690513420 AND r.end_time <= 1690513632 ORDER BY x91idx93 ASC

0 comments on commit 039697d

Please sign in to comment.