-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from ISISComputingGroup/15_bluesky_system_tests
Add system tests
- Loading branch information
Showing
5 changed files
with
93 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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,37 @@ | ||
# Manual system testing | ||
|
||
Manual system tests are stored in the `manual_system_tests` directory. | ||
|
||
Each manual system test should be run both in the PyDEV console in the GUI, and in a standalone | ||
python window, unless the test itself says otherwise. | ||
|
||
The tests will detail any prerequisites in it's docstrings, and will print out any checks | ||
or expected results which you should manually verify. | ||
|
||
## Running the tests from PyDEV in the GUI | ||
|
||
In the PyDEV console in the GUI, type: | ||
|
||
``` | ||
# Should print that it has loaded a named plan | ||
g.load_script(r"c:\instrument\dev\ibex_bluesky_core\manual_system_tests\the_test.py") | ||
# The RE object should already be defined in the PyDEV console | ||
RE(dae_scan()) | ||
``` | ||
|
||
If the plan uses plotting, it should plot using matplotlib embedded in the IBEX GUI. | ||
|
||
## Running from a standalone python session | ||
|
||
- Set the following environment variables in your `cmd` session | ||
``` | ||
set MYPVPREFIX=TE:NDWXXXX: | ||
set "EPICS_CA_ADDR_LIST=127.255.255.255 130.246.51.255" | ||
set "EPICS_CA_AUTO_ADDR_LIST=NO" | ||
``` | ||
- Run the test using: | ||
``` | ||
python c:\instrument\dev\ibex_bluesky_core\manual_system_tests\the_test.py | ||
``` | ||
|
||
If the plan uses plotting, it should spawn a Qt matplotlib window. |
This file contains 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 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 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,28 @@ | ||
"""Demonstration plan showing basic bluesky functionality.""" | ||
|
||
import os | ||
from typing import Generator | ||
|
||
import bluesky.plan_stubs as bps | ||
from bluesky.utils import Msg | ||
|
||
|
||
def interruption_manual_test_plan() -> Generator[Msg, None, None]: | ||
"""Manual system test that checks ctrl-c interruption of a plan. | ||
This test can only be usefully run from an interactive session. | ||
Expected result: | ||
- After ctrl-c twice: | ||
* A bluesky.utils.RunEngineInterrupted error should be raised | ||
* Useful text describing options (RE.halt(), RE.abort(), RE.resume()) should be printed | ||
- After RE.abort(): | ||
* A RunEngineResult should be returned, with exit_status="abort" | ||
* A bluesky.utils.RequestAbort error should be raised | ||
""" | ||
print("About to sleep - press ctrl-C twice to interrupt, then use RE.abort() to abort.") | ||
yield from bps.sleep(999999999) | ||
|
||
|
||
if __name__ == "__main__" and not os.environ.get("FROM_IBEX") == "True": | ||
print("This system test should only be run from an interactive session.") |
This file contains 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