forked from OPM/ResInsight
-
Notifications
You must be signed in to change notification settings - Fork 0
#925 Spix: Integrate Spix for GUI testing via XML-RPC #929
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
Open
magnesj
wants to merge
17
commits into
dev
Choose a base branch
from
feature/spix-integration-925
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+252
−0
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
bf30bb2
#925 Spix: Add vcpkg dependency with qtwidgets feature
magnesj 241ffac
#925 Spix: Add RESINSIGHT_ENABLE_SPIX CMake option
magnesj 321fb7d
#925 Spix: Register --spix-port command line option
magnesj e1540a6
#925 Spix: Start AnyRPC server on --spix-port in RiaGuiApplication
magnesj ba19110
#925 Spix: Add Python smoke test using xmlrpc.client
magnesj 292dc67
#925 Spix: Apply clang-format to header
magnesj b845b97
#925 Spix: Pin spix port to newer vcpkg baseline
magnesj 0cbf7a9
#925 Spix: Build via FetchContent instead of vcpkg
magnesj d657fe4
#925 Spix: Link Spix::QtWidgets directly into ApplicationLibCode
magnesj a676136
#925 Spix: Smoke test calls getErrors() instead of existsAndVisible
magnesj 203b2e0
#925 Spix: Add case-load no-errors test as smoke follow-up
magnesj 92bf643
#925 Spix: Set objectName on main windows and top-level menus
magnesj 6484bc3
Fixes by cmake-format
magnesj b587568
#925 Spix: Add first test using objectName (main window addressable)
magnesj d02e648
#925 Spix: Move tests to tests_spix to avoid rips conftest collision
magnesj 46f6385
#925 Spix: Apply ruff format
magnesj 357adee
#925 Spix: Add menus-reachable test using getStringProperty
magnesj 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
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
33 changes: 33 additions & 0 deletions
33
GrpcInterface/Python/rips/tests_spix/test_spix_case_load.py
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,33 @@ | ||
| import os | ||
| import time | ||
| import xmlrpc.client | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| def test_case_load_produces_no_errors(): | ||
| """First Spix test beyond the smoke check. | ||
|
|
||
| Assumes ResInsight was launched with: | ||
|
|
||
| --spix-port <n> --case <TestModels>/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID | ||
|
|
||
| Verifies the full GUI case-load path completes without errors. | ||
| The gRPC rips tests do not exercise this path — they use the | ||
| command server rather than the GUI's load codepath. | ||
| """ | ||
| port = os.environ.get("RESINSIGHT_SPIX_PORT") | ||
| if not port: | ||
| pytest.skip( | ||
| "RESINSIGHT_SPIX_PORT not set; ResInsight must be launched " | ||
| "with --spix-port <n> --case <path>/TEST10K_FLT_LGR_NNC.EGRID" | ||
| ) | ||
|
|
||
| proxy = xmlrpc.client.ServerProxy(f"http://localhost:{port}/") | ||
|
|
||
| # No widget signal to wait on yet (Qt objectNames not seeded); | ||
| # let the async case-load settle before reading errors. | ||
| time.sleep(2.0) | ||
|
|
||
| errors = proxy.getErrors() | ||
| assert errors == [], f"Spix reported errors after case load: {errors}" |
29 changes: 29 additions & 0 deletions
29
GrpcInterface/Python/rips/tests_spix/test_spix_main_window.py
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,29 @@ | ||
| import os | ||
| import time | ||
| import xmlrpc.client | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| def test_main_window_addressable(): | ||
| """Verifies Spix can locate RiuMainWindow by objectName. | ||
|
|
||
| Assumes ResInsight was launched with --spix-port <n>. | ||
|
|
||
| This is the first test that depends on widget naming. If it fails, | ||
| the regression is most likely in the objectName seeding rather | ||
| than in Spix itself. | ||
| """ | ||
| port = os.environ.get("RESINSIGHT_SPIX_PORT") | ||
| if not port: | ||
| pytest.skip("RESINSIGHT_SPIX_PORT not set") | ||
|
|
||
| proxy = xmlrpc.client.ServerProxy(f"http://localhost:{port}/") | ||
|
|
||
| # Let the main window finish showing before probing it. | ||
| time.sleep(1.0) | ||
|
|
||
| assert proxy.existsAndVisible("RiuMainWindow"), ( | ||
| "RiuMainWindow not found by Spix — check that " | ||
| 'RiuMainWindow::RiuMainWindow() calls setObjectName("RiuMainWindow")' | ||
| ) |
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,47 @@ | ||
| import os | ||
| import time | ||
| import xmlrpc.client | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| def test_main_window_menus_reachable(): | ||
| """Verifies window branding and that every seeded top-level menu is | ||
| reachable from RiuMainWindow via its objectName. | ||
|
|
||
| Exercises Spix's getStringProperty RPC against seven QMenu widgets | ||
| plus the QMainWindow itself. QMenus parented to a menubar report | ||
| isVisible()==False until popped up, so existsAndVisible would | ||
| return False; getStringProperty still works because the QObject | ||
| tree lookup ignores visibility. | ||
|
|
||
| Assumes ResInsight was launched with --spix-port <n>. | ||
| """ | ||
| port = os.environ.get("RESINSIGHT_SPIX_PORT") | ||
| if not port: | ||
| pytest.skip("RESINSIGHT_SPIX_PORT not set") | ||
|
|
||
| proxy = xmlrpc.client.ServerProxy(f"http://localhost:{port}/") | ||
|
|
||
| time.sleep(1.0) | ||
|
|
||
| title = proxy.getStringProperty("RiuMainWindow", "windowTitle") | ||
| assert "ResInsight" in title, f"Unexpected window title: {title!r}" | ||
|
|
||
| for menu in ( | ||
| "FileMenu", | ||
| "EditMenu", | ||
| "ViewMenu", | ||
| "WindowsMenu", | ||
| "HelpMenu", | ||
| "ExportMenu", | ||
| "TestingMenu", | ||
| ): | ||
| name = proxy.getStringProperty(f"RiuMainWindow//{menu}", "objectName") | ||
| assert name == menu, ( | ||
| f"Menu '{menu}' not reachable from RiuMainWindow " | ||
| f"(getString returned {name!r}). Check setObjectName in " | ||
| f"RiuMenuBarBuildTools or RiuMainWindow::createMenus()." | ||
| ) | ||
|
|
||
| assert proxy.getErrors() == [] |
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,18 @@ | ||
| import os | ||
| import xmlrpc.client | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| def test_spix_server_responds(): | ||
| port = os.environ.get("RESINSIGHT_SPIX_PORT") | ||
| if not port: | ||
| pytest.skip( | ||
| "RESINSIGHT_SPIX_PORT not set; ResInsight must be launched with --spix-port <n>" | ||
| ) | ||
|
|
||
| proxy = xmlrpc.client.ServerProxy(f"http://localhost:{port}/") | ||
| # getErrors() takes no widget path, so this verifies the RPC layer | ||
| # is alive without depending on any specific widget's objectName. | ||
| errors = proxy.getErrors() | ||
| assert isinstance(errors, list) |
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,6 @@ | ||
| { | ||
| "dependencies": [ | ||
| "anyrpc", | ||
| "arrow", | ||
| "boost-filesystem", | ||
| "boost-spirit", | ||
|
|
||
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.
1. Spix port unvalidated
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools