Skip to content

Commit

Permalink
try running everything from pip installed executable
Browse files Browse the repository at this point in the history
Issue #178
  • Loading branch information
damies13 committed Feb 25, 2024
1 parent 8f93c8e commit 08583e2
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 37 deletions.
64 changes: 61 additions & 3 deletions .github/workflows/Regression_Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
with:
name: dist
path: dist

- name: Show Dist UM
if: ${{ matrix.platform != 'windows-latest' }}
run: |
Expand All @@ -32,7 +31,6 @@ jobs:
if: ${{ matrix.platform == 'windows-latest' }}
run: |
dir dist
- name: Install Agent from dist UM
if: ${{ matrix.platform != 'windows-latest' }}
run: pip install rfswarm_agent-*.whl
Expand All @@ -53,7 +51,6 @@ jobs:
working-directory: ./dist
- run: pip install -r Tests/Regression/Agent/pip_requirements.txt


- name: Robot Framework
run: robot --include ${{ matrix.platform }} Tests/Regression/Agent
Manager:
Expand Down Expand Up @@ -129,7 +126,39 @@ jobs:
# - name: "Verify tesseract"
# run: tesseract -v

- name: Download packages to dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Show Dist UM
if: ${{ matrix.platform != 'windows-latest' }}
run: |
ls -la dist
- name: Show Dist W
if: ${{ matrix.platform == 'windows-latest' }}
run: |
dir dist
- name: Install Manager from dist UM
if: ${{ matrix.platform != 'windows-latest' }}
run: pip install rfswarm_manager-*.whl
working-directory: ./dist
- name: Install Manager from dist W
if: ${{ matrix.platform == 'windows-latest' }}
shell: cmd
run: for %%f in (rfswarm_manager-*.whl) do pip install %%f
working-directory: ./dist
- name: Install Agent from dist (for testing Issues) UM
if: ${{ matrix.platform != 'windows-latest' }}
run: pip install rfswarm_agent-*.whl
working-directory: ./dist
- name: Install Agent from dist (for testing Issues) W
if: ${{ matrix.platform == 'windows-latest' }}
shell: cmd
run: for %%f in (rfswarm_agent-*.whl) do pip install %%f
working-directory: ./dist
- run: pip install -r Tests/Regression/Manager/pip_requirements.txt

- name: setup git config
run: |
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
Expand All @@ -146,6 +175,8 @@ jobs:
Tests/Regression/Manager
env:
DISPLAY: :13.0

# This below is to save results back to git, actions/upload-artifact@v4 might be a better solution, see Issue #169
- name: git commit
# if: ${{ steps.robottest.conclusion == 'failure' }}
# https://docs.github.com/en/actions/learn-github-actions/expressions
Expand Down Expand Up @@ -269,7 +300,31 @@ jobs:
# "%programfiles%\Tesseract-OCR\tesseract.exe" -v
# shell: cmd
#

- name: Download packages to dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Show Dist UM
if: ${{ matrix.platform != 'windows-latest' }}
run: |
ls -la dist
- name: Show Dist W
if: ${{ matrix.platform == 'windows-latest' }}
run: |
dir dist
- name: Install Reporter from dist UM
if: ${{ matrix.platform != 'windows-latest' }}
run: pip install rfswarm_reporter-*.whl
working-directory: ./dist
- name: Install Reporter from dist W
if: ${{ matrix.platform == 'windows-latest' }}
shell: cmd
run: for %%f in (rfswarm_reporter-*.whl) do pip install %%f
working-directory: ./dist
- run: pip install -r Tests/Regression/Reporter/pip_requirements.txt

- name: setup git config
run: |
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
Expand All @@ -278,6 +333,7 @@ jobs:
git config advice.addIgnoredFile false
- name: create branch for test results
run: git checkout -B Test-Result-Reporter-${{ matrix.platform }}-${{ matrix.python }}

- name: Robot Framework
id: robottest
run: >
Expand All @@ -286,6 +342,8 @@ jobs:
Tests/Regression/Reporter
env:
DISPLAY: :13.0

# This below is to save results back to git, actions/upload-artifact@v4 might be a better solution, see Issue #169
- name: git commit
# if: ${{ steps.robottest.conclusion == 'failure' }}
if: ${{ failure() }}
Expand Down
9 changes: 6 additions & 3 deletions Tests/Regression/Agent/ºCommon.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Library DatabaseLibrary
Library String

*** Variables ***

${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
Expand All @@ -29,7 +30,8 @@ Run Agent
${options}= Create List
END
Log to console \${options}: ${options}
${process}= Start Process python3 ${pyfile_agent} @{options} alias=Agent stdout=${OUTPUT DIR}${/}stdout_agent.txt stderr=${OUTPUT DIR}${/}stderr_agent.txt
# ${process}= Start Process python3 ${pyfile_agent} @{options} alias=Agent stdout=${OUTPUT DIR}${/}stdout_agent.txt stderr=${OUTPUT DIR}${/}stderr_agent.txt
${process}= Start Process ${cmd_agent} @{options} alias=Agent stdout=${OUTPUT DIR}${/}stdout_agent.txt stderr=${OUTPUT DIR}${/}stderr_agent.txt
Set Test Variable $process_agent ${process}

Run Manager CLI
Expand All @@ -38,7 +40,8 @@ Run Manager CLI
${options}= Create List
END
Log to console \${options}: ${options}
${process}= Start Process python3 ${pyfile_manager} @{options} alias=Agent stdout=${OUTPUT DIR}${/}stdout_manager.txt stderr=${OUTPUT DIR}${/}stderr_manager.txt
# ${process}= Start Process python3 ${pyfile_manager} @{options} alias=Manager stdout=${OUTPUT DIR}${/}stdout_manager.txt stderr=${OUTPUT DIR}${/}stderr_manager.txt
${process}= Start Process ${cmd_manager} @{options} alias=Manager stdout=${OUTPUT DIR}${/}stdout_manager.txt stderr=${OUTPUT DIR}${/}stderr_manager.txt
Set Test Variable $process_manager ${process}

Wait For Manager
Expand Down
10 changes: 8 additions & 2 deletions Tests/Regression/Manager/CommandLine.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Library OperatingSystem

Suite Setup Clean Up Old Files

*** Variables ***
${cmd_agent} rfswarm-agent
${cmd_manager} rfswarm

*** Test Cases ***
Random Offset
[Documentation] This just prevents all the test runners doing git push at the same time
Expand All @@ -12,14 +16,16 @@ Random Offset

Manager Version
[Tags] ubuntu-latest macos-latest windows-latest
${result}= Run python3 ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py -v
# ${result}= Run python3 ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py -v
${result}= Run ${cmd_agent} -v
Log to console ${\n}${result}
Should Contain ${result} Version
Should Contain ${result} Manager

Manager Help
[Tags] ubuntu-latest macos-latest windows-latest
${result}= Run python3 ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py -h
# ${result}= Run python3 ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py -h
${result}= Run ${cmd_agent} -h
Log to console ${\n}${result}
Should Contain ${result} IPADDRESS

Expand Down
11 changes: 8 additions & 3 deletions Tests/Regression/Manager/GUI_Basic.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Library String
Library ImageHorizonLibrary reference_folder=${IMAGE_DIR}

*** Variables ***
${cmd_agent} rfswarm-agent
${cmd_manager} rfswarm
${IMAGE_DIR} ${CURDIR}/Images/file_method
${pyfile} ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py
${process} None
Expand All @@ -15,7 +17,8 @@ Open GUI
[Tags] macos-latest
Set Suite Variable ${platform} macos
Set Confidence 0.9
${process}= Start Process python3 ${pyfile} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
# ${process}= Start Process python3 ${pyfile} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
${process}= Start Process ${cmd_manager} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
Set Test Variable $process ${process}
Sleep 10
Set Screenshot Folder ${OUTPUT DIR}
Expand All @@ -25,7 +28,8 @@ Open GUI
[Tags] windows-latest
Set Suite Variable ${platform} windows
Set Confidence 0.9
${process}= Start Process python3 ${pyfile} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
# ${process}= Start Process python3 ${pyfile} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
${process}= Start Process ${cmd_manager} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
Set Test Variable $process ${process}
Sleep 10
Set Screenshot Folder ${OUTPUT DIR}
Expand All @@ -35,7 +39,8 @@ Open GUI
[Tags] ubuntu-latest
Set Suite Variable ${platform} ubuntu
Set Confidence 0.9
${process}= Start Process python3 ${pyfile} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
# ${process}= Start Process python3 ${pyfile} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
${process}= Start Process ${cmd_manager} alias=Manager stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
Set Test Variable $process ${process}
Sleep 10
Set Screenshot Folder ${OUTPUT DIR}
Expand Down
8 changes: 6 additions & 2 deletions Tests/Regression/Manager/GUI_Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Library ImageHorizonLibrary reference_folder=${IMAGE_DIR}


*** Variables ***
${cmd_agent} rfswarm-agent
${cmd_manager} rfswarm
${IMAGE_DIR} ${CURDIR}/Images/file_method
${pyfile_manager} ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py
${pyfile_agent} ${EXECDIR}${/}rfswarm_agent${/}rfswarm_agent.py
Expand All @@ -33,13 +35,15 @@ Set Platform

Open Agent
# [Arguments] ${options}
${process}= Start Process python3 ${pyfile_agent} alias=Agent stdout=${OUTPUT DIR}${/}stdout_agent.txt stderr=${OUTPUT DIR}${/}stderr_agent.txt
# ${process}= Start Process python3 ${pyfile_agent} alias=Agent stdout=${OUTPUT DIR}${/}stdout_agent.txt stderr=${OUTPUT DIR}${/}stderr_agent.txt
${process}= Start Process ${cmd_agent} alias=Agent stdout=${OUTPUT DIR}${/}stdout_agent.txt stderr=${OUTPUT DIR}${/}stderr_agent.txt
Set Test Variable $process_agent ${process}

Open Manager GUI
# [Arguments] ${options}
Set Confidence 0.9
${process}= Start Process python3 ${pyfile_manager} alias=Manager stdout=${OUTPUT DIR}${/}stdout_manager.txt stderr=${OUTPUT DIR}${/}stderr_manager.txt
# ${process}= Start Process python3 ${pyfile_manager} alias=Manager stdout=${OUTPUT DIR}${/}stdout_manager.txt stderr=${OUTPUT DIR}${/}stderr_manager.txt
${process}= Start Process ${cmd_manager} alias=Manager stdout=${OUTPUT DIR}${/}stdout_manager.txt stderr=${OUTPUT DIR}${/}stderr_manager.txt
Set Test Variable $process_manager ${process}
Sleep 10
Set Screenshot Folder ${OUTPUT DIR}
Expand Down
8 changes: 0 additions & 8 deletions Tests/Regression/Manager/pip_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
robotframework
robotframework-SikuliLibrary
# pyscreeze 0.1.29 doesn't seem to work with pyautogui 0.9.53
pyscreeze==0.1.28
# pyautogui 0.9.54 has issues on MacOS https://github.com/asweigart/pyautogui/issues/783
# pyautogui is a prerequisite of imagehorizonlibrary
pyautogui!=0.9.54
robotframework-imagehorizonlibrary
opencv-python
configparser
requests
HTTPServer
pillow
psutil
pip>=21
matplotlib>=3.5.1
16 changes: 11 additions & 5 deletions Tests/Regression/Reporter/CommandLine.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Library Process
Suite Setup Clean Up Old Files

*** Variables ***
${cmd_reporter} rfswarm-reporter
${pyfile} ${EXECDIR}${/}rfswarm_reporter${/}rfswarm_reporter.py

*** Test Cases ***
Expand All @@ -15,14 +16,16 @@ Random Offset

Reporter Version
[Tags] ubuntu-latest macos-latest windows-latest
${result}= Run python3 ${EXECDIR}${/}rfswarm_reporter${/}rfswarm_reporter.py -v
# ${result}= Run python3 ${EXECDIR}${/}rfswarm_reporter${/}rfswarm_reporter.py -v
${result}= Run ${cmd_reporter} -v
Log to console ${\n}${result}
Should Contain ${result} Version
Should Contain ${result} Reporter

Reporter Help
[Tags] ubuntu-latest macos-latest windows-latest
${result}= Run python3 ${EXECDIR}${/}rfswarm_reporter${/}rfswarm_reporter.py -h
# ${result}= Run python3 ${EXECDIR}${/}rfswarm_reporter${/}rfswarm_reporter.py -h
${result}= Run ${cmd_reporter} -h
Log to console ${\n}${result}
Should Contain ${result} Excel

Expand All @@ -39,7 +42,8 @@ Command Line Generate HTML
${template}= Set Variable ${basefolder}${/}90%ileTemplate.template
Should Exist ${template}
Log template: ${template} console=True
${result}= Run python3 ${pyfile} -n -g 1 -d ${resultfolder} -t ${template} --html
# ${result}= Run python3 ${pyfile} -n -g 1 -d ${resultfolder} -t ${template} --html
${result}= Run ${cmd_reporter} -n -g 1 -d ${resultfolder} -t ${template} --html
Log result: ${\n}${result} console=True
Should Not Contain ${result} Traceback
Should Exist ${resultfolder}${/}${resultdata}.html
Expand All @@ -57,7 +61,8 @@ Command Line Generate Docx
${template}= Set Variable ${basefolder}${/}90%ileTemplate.template
Should Exist ${template}
Log template: ${template} console=True
${result}= Run python3 ${pyfile} -n -g 1 -d ${resultfolder} -t ${template} --docx
# ${result}= Run python3 ${pyfile} -n -g 1 -d ${resultfolder} -t ${template} --docx
${result}= Run ${cmd_reporter} -n -g 1 -d ${resultfolder} -t ${template} --docx
Log ${\n}${result} console=True
Should Not Contain ${result} Traceback
Should Exist ${resultfolder}${/}${resultdata}.docx
Expand All @@ -75,7 +80,8 @@ Command Line Generate Xlsx
${template}= Set Variable ${basefolder}${/}90%ileTemplate.template
Should Exist ${template}
Log template: ${template} console=True
${result}= Run python3 ${pyfile} -n -g 1 -d ${resultfolder} -t ${template} --xlsx
# ${result}= Run python3 ${pyfile} -n -g 1 -d ${resultfolder} -t ${template} --xlsx
${result}= Run ${cmd_reporter} -n -g 1 -d ${resultfolder} -t ${template} --xlsx
Log ${\n}${result} console=True
Should Not Contain ${result} Traceback
Should Exist ${resultfolder}${/}${resultdata}.xlsx
Expand Down
11 changes: 8 additions & 3 deletions Tests/Regression/Reporter/GUI_Basic.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Library OCRLibrary
Test Teardown Close GUI

*** Variables ***
${cmd_reporter} rfswarm-reporter
${IMAGE_DIR} ${CURDIR}${/}Images${/}file_method
${pyfile} ${EXECDIR}${/}rfswarm_reporter${/}rfswarm_reporter.py
${process} None
Expand Down Expand Up @@ -244,7 +245,9 @@ Open GUI windows
${args}= Evaluate " \t".join(@{appargs})
Set Confidence 0.9
# ${process}= Start Process python3 ${pyfile} alias=Reporter stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
${process}= Start Process python ${pyfile} -g 6 @{appargs} alias=Reporter stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
# ${process}= Start Process python ${pyfile} -g 6 @{appargs} alias=Reporter stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
${process}= Start Process ${cmd_reporter} -g 6 @{appargs} alias=Reporter stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt

Set Suite Variable $process ${process}
# reporter_windows_status_previewloaded
# Wait For Status PreviewLoaded
Expand All @@ -257,7 +260,8 @@ Open GUI ubuntu
[Arguments] @{appargs}
Set Suite Variable ${platform} ubuntu
Set Confidence 0.9
${process}= Start Process python3 ${pyfile} -g 6 @{appargs} alias=Reporter stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
# ${process}= Start Process python3 ${pyfile} -g 6 @{appargs} alias=Reporter stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
${process}= Start Process ${cmd_reporter} -g 6 @{appargs} alias=Reporter stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
Set Suite Variable $process ${process}
# Sleep 60
# Capture Screen
Expand All @@ -268,7 +272,8 @@ Open GUI macos
[Arguments] @{appargs}
Set Suite Variable ${platform} macos
Set Confidence 0.9
${process}= Start Process python3 ${pyfile} -g 5 @{appargs} alias=Reporter stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
# ${process}= Start Process python3 ${pyfile} -g 5 @{appargs} alias=Reporter stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
${process}= Start Process ${cmd_reporter} -g 6 @{appargs} alias=Reporter stdout=${OUTPUT DIR}${/}stdout.txt stderr=${OUTPUT DIR}${/}stderr.txt
Set Suite Variable $process ${process}
# Sleep 60
Set Screenshot Folder ${OUTPUT DIR}
Expand Down
8 changes: 0 additions & 8 deletions Tests/Regression/Reporter/pip_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
robotframework
robotframework-SikuliLibrary
# pyscreeze 0.1.29 doesn't seem to work with pyautogui 0.9.53
pyscreeze==0.1.28
# pyautogui 0.9.54 has issues on MacOS https://github.com/asweigart/pyautogui/issues/783
# pyautogui is a prerequisite of imagehorizonlibrary
pyautogui!=0.9.54
robotframework-imagehorizonlibrary
opencv-python
configparser
pillow
pip>=21
matplotlib
python-docx
openpyxl
tzlocal>=4.1
robotframework-ocrlibrary

0 comments on commit 08583e2

Please sign in to comment.