diff --git a/Tests/Regression/Manager/CommandLine_Bugs.robot b/Tests/Regression/Manager/CommandLine_Bugs.robot index 461a71a8e..0f409799a 100644 --- a/Tests/Regression/Manager/CommandLine_Bugs.robot +++ b/Tests/Regression/Manager/CommandLine_Bugs.robot @@ -3,7 +3,9 @@ Test Tags Bugs CommandLine Resource CommandLine_Common.robot -Suite Setup Create Directory ${results_dir} +Suite Setup Run Keywords +... Create Directory ${results_dir} AND +... Set Platform *** Variables *** @{robot_data}= example.robot Example Test Case @@ -107,7 +109,7 @@ Circular Reference Resource Files Should Not Contain ${stdout_manager} Too many open files Should Not Contain ${stderr_manager} Too many open files - Should Not Contain ${stdout_agent} Manager Disconnected + # Should Not Contain ${stdout_agent} Manager Disconnected # @{testdata-dir}= List Directory ${testdata} # Log testdata-dir: ${testdata-dir} console=True @@ -167,7 +169,7 @@ Circular Reference Resource Files 2 Should Not Contain ${stdout_manager} Too many open files Should Not Contain ${stderr_manager} Too many open files - Should Not Contain ${stdout_agent} Manager Disconnected + # Should Not Contain ${stdout_agent} Manager Disconnected # @{testdata-dir}= List Directory ${testdata} # Log testdata-dir: ${testdata-dir} console=True @@ -223,7 +225,7 @@ Lots Of Resource Files Should Not Contain ${stdout_manager} Too many open files Should Not Contain ${stderr_manager} Too many open files - Should Not Contain ${stdout_agent} Manager Disconnected + # Should Not Contain ${stdout_agent} Manager Disconnected # @{testdata-dir}= List Directory ${testdata} # Log testdata-dir: ${testdata-dir} console=True @@ -243,6 +245,45 @@ Lots Of Resource Files ... Stop Agent AND ... Stop Manager +Check That the Manager Supports the Missing Scenario File Provided By the -s Argument + [Tags] ubuntu-latest macos-latest Issue #340 + + ${scenatio_file}= Normalize Path ${CURDIR}${/}testdata${/}Issue-#340${/}Issue-#340.rfs + ${inifile}= Normalize Path ${CURDIR}${/}testdata${/}Issue-#340${/}RFSwarmManager.ini + VAR @{mngr_options} -n -s ${CURDIR}${/}/path/to/file/that/doesnt/exist.rfs -i ${inifile} + + File Should Not Exist ${CURDIR}${/}/path/to/file/that/doesnt/exist.rfs + File Should Exist ${inifile} + File Should Exist ${scenatio_file} + File Should Not Be Empty ${inifile} + File Should Not Be Empty ${scenatio_file} + Change = new_dir With = ${scenatio_file} In ${inifile} + Change Manager INI File Settings scenariofile ${inifile} + + Run Manager CLI ${mngr_options} + Sleep 3 + ${running}= Is Process Running ${process_manager} + IF not ${running} + Fail msg=Manager is not running! + END + Sleep 6 + Stop Manager + ${running}= Is Process Running ${process_manager} + IF ${running} + ${result}= Terminate Process ${process_manager} + Fail msg=Manager did not close! + END + ${stdout_manager}= Show Log ${OUTPUT DIR}${/}stdout_manager.txt + ${stderr_manager}= Show Log ${OUTPUT DIR}${/}stderr_manager.txt + + Should Not Contain ${stdout_manager} RuntimeError + Should Not Contain ${stderr_manager} RuntimeError + Should Not Contain ${stdout_manager} Exception + Should Not Contain ${stderr_manager} Exception + + # windows does not work with reading logs. + Should Contain ${stdout_manager} *SPECIAL MESSAGE* # this will fail + Verify If Manager Runs With Existing INI File From Current Version NO GUI [Tags] windows-latest ubuntu-latest macos-latest Issue #49 [Setup] Set Global Filename And Default Save Path ${robot_data}[0] diff --git a/Tests/Regression/Manager/CommandLine_Common.robot b/Tests/Regression/Manager/CommandLine_Common.robot index 3ae1363a4..e37b0e893 100644 --- a/Tests/Regression/Manager/CommandLine_Common.robot +++ b/Tests/Regression/Manager/CommandLine_Common.robot @@ -6,12 +6,16 @@ Library String Library Collections *** Variables *** +${platform} ${None} +${global_name} ${None} +${global_path} ${None} + ${cmd_agent} rfswarm-agent ${cmd_manager} rfswarm ${pyfile_agent} ${EXECDIR}${/}rfswarm_agent${/}rfswarm_agent.py ${pyfile_manager} ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py -${process_agent} None -${process_manager} None +${process_agent} ${None} +${process_manager} ${None} # datapath: /home/runner/work/rfswarm/rfswarm/rfswarm_manager/results/PreRun # datapath: /opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/rfswarm_manager/results/PreRun -- let's control the output path rather than leaving it to chance @@ -118,31 +122,49 @@ Check Agent Is Running Should Be True ${result} Stop Manager - ${result}= Terminate Process ${process_manager} - # Should Be Equal As Integers ${result.rc} 0 + ${running}= Is Process Running ${process_manager} + IF ${running} + Sleep 3s + IF '${platform}' == 'windows' # Send Signal To Process keyword does not work on Windows + ${result}= Terminate Process ${process_manager} + ELSE + Send Signal To Process SIGINT ${process_manager} + ${result}= Wait For Process ${process_manager} timeout=30 on_timeout=kill + END Copy File ${result.stdout_path} ${OUTPUT DIR}${/}${TEST NAME}${/}stdout_manager.txt Copy File ${result.stderr_path} ${OUTPUT DIR}${/}${TEST NAME}${/}stderr_manager.txt - Log to console Terminate Manager Process returned: ${result.rc} console=True + Log to console Manager returned: ${result.rc} Log stdout_path: ${result.stdout_path} console=True Log stdout: ${result.stdout} console=True Log stderr_path: ${result.stderr_path} console=True Log stderr: ${result.stderr} console=True + END + Stop Agent - ${result}= Terminate Process ${process_agent} - # Should Be Equal As Integers ${result.rc} 0 + ${running}= Is Process Running ${process_agent} + IF ${running} + Sleep 3s + IF '${platform}' == 'windows' # Send Signal To Process keyword does not work on Windows + ${result} = Terminate Process ${process_agent} + ELSE + Send Signal To Process SIGINT ${process_agent} + ${result}= Wait For Process ${process_agent} timeout=30 on_timeout=kill + END - Copy File ${result.stdout_path} ${OUTPUT DIR}${/}${TEST NAME}${/}stdout_agent.txt - Copy File ${result.stderr_path} ${OUTPUT DIR}${/}${TEST NAME}${/}stderr_agent.txt + Copy File ${result.stdout_path} ${OUTPUT DIR}${/}${TEST NAME}${/}stdout_agent.txt + Copy File ${result.stderr_path} ${OUTPUT DIR}${/}${TEST NAME}${/}stderr_agent.txt - Log Terminate Agent Process returned: ${result.rc} console=True - Log stdout_path: ${result.stdout_path} console=True - Log stdout: ${result.stdout} console=True - Log stderr_path: ${result.stderr_path} console=True - Log stderr: ${result.stderr} console=True - Show Dir Contents ${agent_dir} + Log to console Agent returned: ${result.rc} + Log stdout_path: ${result.stdout_path} console=True + Log stdout: ${result.stdout} console=True + Log stderr_path: ${result.stderr_path} console=True + Log stderr: ${result.stderr} console=True + Show Dir Contents ${agent_dir} + + END Set Global Filename And Default Save Path [Documentation] Sets global default save path as Test Variable and file name for robot test. @@ -191,9 +213,10 @@ Get Manager INI Data EXCEPT # --- temp fix: @{mngr_options}= Create List -g 1 - Open Manager GUI ${mngr_options} + Run Manager CLI ${mngr_options} + Sleep 5 # --- - Run Keyword Close Manager GUI ${platform} + Run Keyword Stop Manager File Should Exist ${location} File Should Not Be Empty ${location} END @@ -240,6 +263,12 @@ Change Manager INI File Settings Log ${ini_content} Append To File ${location} ${ini_content} +Change ${str1} With ${str2} In ${file} + ${file_content} Get File ${file} + Remove File ${file} + ${file_content} Replace String ${file_content} ${str1} ${str2} + Create File ${file} ${file_content} + Get Manager PIP Data Run Process pip show rfswarm-manager alias=data ${pip_data} Get Process Result data diff --git a/Tests/Regression/Manager/Images/file_method/manager_windows_button_selected_runscriptrow.png b/Tests/Regression/Manager/Images/file_method/manager_windows_button_selected_runscriptrow.png index 0ad151eac..752ac8927 100644 Binary files a/Tests/Regression/Manager/Images/file_method/manager_windows_button_selected_runscriptrow.png and b/Tests/Regression/Manager/Images/file_method/manager_windows_button_selected_runscriptrow.png differ diff --git a/Tests/Regression/Manager/Images/file_method/manager_windows_button_selected_runsettingsrow.png b/Tests/Regression/Manager/Images/file_method/manager_windows_button_selected_runsettingsrow.png index 759fa3a1b..5d47c9341 100644 Binary files a/Tests/Regression/Manager/Images/file_method/manager_windows_button_selected_runsettingsrow.png and b/Tests/Regression/Manager/Images/file_method/manager_windows_button_selected_runsettingsrow.png differ diff --git a/Tests/Regression/Manager/Images/file_method/ubuntu_checkbox_unchecked_outputxml.png b/Tests/Regression/Manager/Images/file_method/ubuntu_checkbox_unchecked_outputxml.png index 89da2487a..36708d089 100644 Binary files a/Tests/Regression/Manager/Images/file_method/ubuntu_checkbox_unchecked_outputxml.png and b/Tests/Regression/Manager/Images/file_method/ubuntu_checkbox_unchecked_outputxml.png differ diff --git a/Tests/Regression/Manager/testdata/Issue-#340/Issue-#340.rfs b/Tests/Regression/Manager/testdata/Issue-#340/Issue-#340.rfs new file mode 100644 index 000000000..8cc1842a7 --- /dev/null +++ b/Tests/Regression/Manager/testdata/Issue-#340/Issue-#340.rfs @@ -0,0 +1,13 @@ +[Scenario] +uploadmode = err +scriptcount = 1 +graphlist = + +[1] +robots = 10 +delay = 0 +rampup = 15 +run = 30 +test = Example Test Case +script = example.robot + diff --git a/Tests/Regression/Manager/testdata/Issue-#340/RFSwarmManager.ini b/Tests/Regression/Manager/testdata/Issue-#340/RFSwarmManager.ini new file mode 100644 index 000000000..4c2e78d77 --- /dev/null +++ b/Tests/Regression/Manager/testdata/Issue-#340/RFSwarmManager.ini @@ -0,0 +1,20 @@ +[GUI] +win_width = 1280 +win_height = 720 +graph_list = + +[Plan] +scriptdir = +scenariodir = +scenariofile = new_dir + +[Run] +resultsdir = +display_index = False +display_iteration = False +display_sequence = False +display_percentile = 90 + +[Server] +bindip = +bindport = 8138 \ No newline at end of file