Skip to content

Commit 5f22aa2

Browse files
2 parents ea9de0a + 4d2097b commit 5f22aa2

File tree

5 files changed

+47
-21
lines changed

5 files changed

+47
-21
lines changed

Jenkinsfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ pipeline {
105105
call ibex_utils/installation_and_upgrade/instrument_install_latest_build_only.bat CLEAN EPICS x86
106106
) else if \"%MYJOB%\" == \"System_Tests_Win11\" (
107107
call ibex_utils/installation_and_upgrade/instrument_install_latest_build_only.bat CLEAN EPICS
108+
) else if \"%MYJOB%\" == \"System_Tests_Win11_Win11\" (
109+
call ibex_utils/installation_and_upgrade/instrument_install_latest_build_only.bat CLEAN EPICS x64 win11
108110
) else (
109111
call ibex_utils/installation_and_upgrade/instrument_install_latest_build_only.bat
110112
)
@@ -196,16 +198,11 @@ pipeline {
196198
bat """
197199
set \"MYJOB=${env.JOB_NAME}\"
198200
@echo Saving test output on node ${env.NODE_NAME}
199-
robocopy "C:\\Instrument\\Var\\logs\\ioc" "%WORKSPACE%\\ioc-logs" /E /R:2 /MT /NFL /NDL /NP /NC /NS /LOG:NUL
200-
robocopy "C:\\Instrument\\Var\\logs\\IOCTestFramework" "%WORKSPACE%\\ioctest-logs" /E /R:2 /MT /NFL /NDL /NP /NC /NS /LOG:NUL
201-
robocopy "C:\\Instrument\\Var\\logs\\gateway" "%WORKSPACE%\\gateway-logs" /E /R:2 /MT /NFL /NDL /NP /NC /NS /LOG:NUL
202-
robocopy "C:\\Instrument\\Var\\logs\\genie_python" "%WORKSPACE%\\genie_python-logs" /E /R:2 /MT /NFL /NDL /NP /NC /NS /LOG:NUL
203-
robocopy "C:\\Instrument\\Var\\logs\\deploy" "%WORKSPACE%\\deploy-logs" /E /R:2 /MT /NFL /NDL /NP /NC /NS /LOG:NUL
204-
robocopy "C:\\Instrument\\Var\\logs\\ibex_server" "%WORKSPACE%\\ibex_server-logs" /E /R:2 /MT /NFL /NDL /NP /NC /NS /LOG:NUL
201+
robocopy "C:\\Instrument\\Var\\logs" "%WORKSPACE%\\var-logs" /S /R:2 /MT /NFL /NDL /NP /NC /NS /LOG:NUL
205202
robocopy "C:\\Instrument\\Apps\\EPICS-%MYJOB%" "%WORKSPACE%\\ioctest-output" "*.xml" /S /PURGE /R:2 /MT /NFL /NDL /NP /NC /NS /LOG:NUL
206203
exit /b 0
207204
"""
208-
archiveArtifacts artifacts: '*-logs/*.log', caseSensitive: false
205+
archiveArtifacts artifacts: 'var-logs/**/*.*', caseSensitive: false
209206
junit "test-reports/**/*.xml,**/test-reports/**/*.xml"
210207
logParser ([
211208
projectRulePath: 'log_parse_rules.txt',

clear_logs.bat

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
setlocal
2-
pushd c:\
3-
del /q C:\Instrument\Var\logs\ioc\*.*
4-
del /q C:\Instrument\Var\logs\conserver\*.*
5-
del /q C:\Instrument\Var\logs\gateway\blockserver\*.*
6-
del /q C:\Instrument\Var\logs\gateway\external\*.*
7-
del /q C:\Instrument\Var\logs\genie_python\*.*
8-
del /q C:\Instrument\Var\logs\deploy\*.*
9-
del /q C:\Instrument\Var\logs\ibex_server\*.*
10-
del /q C:\Instrument\Var\logs\IOCTestFramework\*.*
2+
pushd C:\Instrument\Var\logs
3+
del /q /s *.*
114
popd
125
exit /b 0

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ six
99
unittest-xml-reporting
1010
ibex_bluesky_core
1111
genie_python
12-
configobj
12+
matplotlib
13+
pyqt6

test_bluesky.py

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
import os
33
import unittest
44
import uuid
5+
from pathlib import Path
56

67
import bluesky.plan_stubs as bps
78
import bluesky.plans as bp
9+
import matplotlib
810
from bluesky.callbacks import LiveTable
911
from bluesky.preprocessors import subs_decorator
1012
from bluesky.run_engine import RunEngine, RunEngineResult
1113
from genie_python import genie as g # type: ignore
14+
from ibex_bluesky_core.callbacks import ISISCallbacks
15+
from ibex_bluesky_core.callbacks.fitting.fitting_utils import Linear
1216
from ibex_bluesky_core.devices import get_pv_prefix
1317
from ibex_bluesky_core.devices.block import block_r, block_rw_rbv
1418
from ibex_bluesky_core.devices.simpledae import SimpleDae
@@ -20,7 +24,10 @@
2024
GoodFramesNormalizer,
2125
PeriodGoodFramesNormalizer,
2226
)
23-
from ibex_bluesky_core.devices.simpledae.waiters import GoodFramesWaiter, PeriodGoodFramesWaiter
27+
from ibex_bluesky_core.devices.simpledae.waiters import (
28+
GoodFramesWaiter,
29+
PeriodGoodFramesWaiter,
30+
)
2431
from ibex_bluesky_core.log import set_bluesky_log_levels
2532
from ibex_bluesky_core.run_engine import get_run_engine
2633
from ophyd_async.plan_stubs import ensure_connected
@@ -30,6 +37,7 @@
3037
set_genie_python_raises_exceptions,
3138
)
3239

40+
matplotlib.use("qtagg")
3341
RE: RunEngine = get_run_engine()
3442

3543
P3_INIT_VALUE: float = 123.456
@@ -147,6 +155,29 @@ def _plan():
147155
self.assertTrue(any("| 123.456 | -10.00000 |" in line for line in livetable_lines))
148156
self.assertTrue(any("| 123.456 | 10.00000 |" in line for line in livetable_lines))
149157

158+
def test_scan_with_standard_callbacks(self) -> None:
159+
icc = ISISCallbacks(
160+
x="p5",
161+
y="p3",
162+
fit=Linear().fit(),
163+
human_readable_file_output_dir=Path(LOG_FOLDER) / "output_files",
164+
live_fit_logger_output_dir=Path(LOG_FOLDER) / "fitting",
165+
)
166+
167+
@icc
168+
def _plan():
169+
p3 = block_r(float, "p3")
170+
p5 = block_rw_rbv(float, "p5")
171+
yield from ensure_connected(p3, p5)
172+
yield from bp.scan([p3], p5, -10, 10, num=10)
173+
174+
RE(_plan())
175+
176+
self.assertAlmostEqual(icc.peak_stats["com"], 0)
177+
print(icc.live_fit.result.params["c0"])
178+
print(icc.live_fit.result.fit_report())
179+
self.assertAlmostEqual(icc.live_fit.result.params["c0"], P3_INIT_VALUE)
180+
150181
def test_count_simple_dae(self) -> None:
151182
start_run_number = int(g.get_runnumber())
152183

@@ -211,7 +242,9 @@ def test_GIVEN_logging_is_requested_THEN_the_log_file_exists(self) -> None:
211242
)
212243
self.assertTrue(os.path.exists(self.qualified_log_filename))
213244

214-
def test_GIVEN_logging_is_requested_THEN_the_log_file_contains_the_message(self) -> None:
245+
def test_GIVEN_logging_is_requested_THEN_the_log_file_contains_the_message(
246+
self,
247+
) -> None:
215248
# Log invocation.
216249
bluesky_message = LOG_MESSAGE + str(uuid.uuid4())
217250
other_message = LOG_MESSAGE + str(uuid.uuid4())
@@ -240,7 +273,9 @@ def test_GIVEN_logging_is_configured_at_info_level_THEN_debug_messages_do_not_go
240273
self.assertNotIn(debug_msg, content)
241274
self.assertIn(info_msg, content)
242275

243-
def test_GIVEN_logging_is_configured_at_debug_level_THEN_debug_messages_do_go_to_log_file(self):
276+
def test_GIVEN_logging_is_configured_at_debug_level_THEN_debug_messages_do_go_to_log_file(
277+
self,
278+
):
244279
debug_msg = LOG_MESSAGE + str(uuid.uuid4())
245280
info_msg = LOG_MESSAGE + str(uuid.uuid4())
246281

test_genie_python_using_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def test_GIVE_config_with_bi_pv_WHEN_set_pv_value_with_None_THEN_value_is_not_se
121121
bi_pv_name = "SIMPLE:BI"
122122
value_at_start = g.get_pv(bi_pv_name, is_local=True)
123123
g.set_pv(bi_pv_name, None, is_local=True, wait=True)
124-
assert_that(g.get_pv(bi_pv_name), is_(value_at_start))
124+
assert_that(g.get_pv(bi_pv_name, is_local=True), is_(value_at_start))
125125

126126

127127
class TestWaitforPV(unittest.TestCase):

0 commit comments

Comments
 (0)