-
Notifications
You must be signed in to change notification settings - Fork 3
first steps at testing as-installed opencv #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
fff8601
first steps at testing as-installed opencv
bollwyvl 592c872
fix example test doc
bollwyvl 781086d
try forcing qt version
bollwyvl 598a227
more screenshots during example test
bollwyvl 752d11c
add py-opencv to robotlab recipe, more work on opencv example test
bollwyvl 6e33ac4
go conda-forge forward, more work on example tests
bollwyvl 66249dd
copy opencv file, clean up other examples
bollwyvl 93fdda4
more tinkering on cv/qt
bollwyvl 9c45e50
test opencv during conda-build test of robotlab
bollwyvl 0def51c
skip the opencv test during conda build on osx: PATH?
bollwyvl 9f7a5f5
wuks splash for windows
bollwyvl fcec90d
back to anaconda for build stack
bollwyvl 6675acc
hack osx ff/gd paths, restore osx opencv test during conda build
bollwyvl f65d956
fix opencv browser line detection
bollwyvl c9aee9a
check browser line with regex
bollwyvl 274bdbb
create webdriver doesn't take headless
bollwyvl fcbdfdb
executable is geckodriver, firefox is firefox
bollwyvl 29324b2
skip opencv test during conda build, see if we get better output
bollwyvl 4de7e39
add ludicrous timeout for example
bollwyvl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: robotlab-combine | ||
|
||
channels: | ||
- https://conda.anaconda.org/anaconda | ||
- https://conda.anaconda.org/conda-forge | ||
- https://conda.anaconda.org/anaconda | ||
|
||
dependencies: | ||
- robotframework |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from pathlib import Path | ||
import os, sys, shutil, json | ||
import os, sys, shutil, json, platform, re | ||
|
||
PLATFORM = platform.system().lower() | ||
|
||
SRC_DIR = Path(os.environ["SRC_DIR"]) | ||
PREFIX = Path(os.environ["PREFIX"]) | ||
|
@@ -19,6 +21,13 @@ | |
} | ||
SVG = SRC_DIR / "robotlab" / "src" / "robotlab" / "icons" / "starter.svg" | ||
|
||
OPENCV_OSX = """ | ||
${prefix} = Evaluate __import__("sys").prefix | ||
Create WebDriver Firefox executable_path=${prefix}${/}bin${/}geckodriver firefox_binary=${prefix}${/}bin${/}firefox | ||
Go To https://www.google.com/?hl=en | ||
""" | ||
|
||
|
||
print("making directories...") | ||
[d.mkdir(exist_ok=True, parents=True) for d in [SHARE, ETC, WWW]] | ||
|
||
|
@@ -33,6 +42,22 @@ | |
for dest, src in NOTEBOOKS.items() | ||
] | ||
|
||
print("hacking OpenCV Notebook on OSX") | ||
|
||
if PLATFORM == "darwin": | ||
opencv = EXAMPLES / "OpenCV.ipynb" | ||
nb = json.loads(opencv.read_text()) | ||
for cell in nb["cells"]: | ||
if cell["cell_type"] == "code": | ||
lines = cell["source"] | ||
for i, line in enumerate(lines): | ||
if re.findall(r"\s+Open browser", line, flags=re.I): | ||
lines[i] = OPENCV_OSX | ||
print(lines) | ||
cell["source"] = lines | ||
|
||
opencv.write_text(json.dumps(nb, indent=2)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeesh |
||
|
||
|
||
print("making starters...") | ||
(ETC / "robotlab-starters.json").write_text(json.dumps({ | ||
|
@@ -45,6 +70,13 @@ | |
"py_src": "robotkernel", | ||
"src": "resources/starter/quickstart-starter.ipynb" | ||
}, | ||
"robotkernel-examples": { | ||
"type": "copy", | ||
"label": "More Robot Kernel Examples", | ||
"description": "Examples of using robotkernel", | ||
"icon": SVG.read_text().replace("jp-icon2", "jp-icon-contrast1"), | ||
"src": str(EXAMPLES) | ||
}, | ||
"robotkernel-tutorial": { | ||
"label": "Tutorial", | ||
"description": "Tutorial for Robot Framework on Jupyter", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
*** Settings *** | ||
Documentation Try the Examples | ||
Force Tags starter:example | ||
Library JupyterLibrary | ||
Resource ../../../resources/Browser.robot | ||
Resource ../../../resources/Lab.robot | ||
Resource ../../../resources/Selectors.robot | ||
|
||
*** Variables *** | ||
${KERNEL LANGUAGE} Robot Framework | ||
|
||
*** Test Cases *** | ||
Will the Example Starter Launch? | ||
[Documentation] Start the Example | ||
[Tags] example:opencv | ||
Open RobotLab | ||
${prefix} = Set Variable example_ | ||
Execute JupyterLab Command Close All | ||
Wait Until Page Contains Element ${XP LAUNCH SECTION} | ||
Capture Page Screenshot ${prefix}_0_before_starter.png | ||
Click Element ${CSS LAUNCH CARD EXAMPLES} | ||
Wait Until Page Contains Element ${XP FILE TREE EXAMPLE OPENCV} timeout=10s | ||
Capture Page Screenshot ${prefix}_1_after_starter.png | ||
|
||
Will the OpenCV Notebook Run? | ||
[Documentation] Run the OpenCV Tutorial Notebook | ||
[Tags] example:opencv | ||
Open RobotLab | ||
${prefix} = Set Variable example_opencv_ | ||
Open the Example Folder ${prefix} | ||
Open the Example Notebook ${prefix} ${XP FILE TREE EXAMPLE OPENCV} | ||
Run the Example Notebook ${prefix} | ||
Capture Page Screenshot ${prefix}_6_after_run_all.png | ||
The Robot Popup Should Contain ${prefix} Log passed, 0 failed | ||
The Robot Popup Should Contain ${prefix} Report All tests passed | ||
Capture Page Screenshot ${prefix}_7_reported.png | ||
Screenshot Each Output of Active JupyterLab Document ${prefix}_8_all_ | ||
|
||
*** Keywords *** | ||
Open the Example Folder | ||
[Arguments] ${prefix} | ||
[Documentation] Open the example folder | ||
Execute JupyterLab Command Close All | ||
Maybe Open JupyterLab Sidebar File Browser | ||
Click Element ${CRUMBS HOME} | ||
Double Click Element ${XP FILE TREE EXAMPLE} | ||
Capture Page Screenshot ${prefix}_1_in_folder.png | ||
|
||
Open the Example Notebook | ||
[Arguments] ${prefix} ${example} | ||
[Documentation] Open and prepare the example notebook | ||
Wait Until Page Contains Element ${example} timeout=10s | ||
Double Click Element ${example} | ||
Wait Until Page Contains ${KERNEL LANGUAGE} | Idle timeout=10s | ||
Capture Page Screenshot ${prefix}_2_after_launch.png | ||
Execute JupyterLab Command Clear All Outputs | ||
Sleep 1s | ||
Capture Page Screenshot ${prefix}_3_after_clean.png | ||
|
||
Run the Example Notebook | ||
[Arguments] ${prefix} | ||
[Documentation] Actually run the example notebook | ||
Execute JupyterLab Command Run All Cells | ||
Wait Until Page Does Not Contain [*] timeout=120s | ||
Wait Until Page Contains ${KERNEL LANGUAGE} | Idle timeout=120s | ||
Capture Page Screenshot ${prefix}_4_after_run.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not prod of this: any thoughts of ways to make it cleaner? Can we add something at the RFSL layer?