From 27372ebc83a05129e0f91521b9ae60688facb05f Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Thu, 13 Nov 2025 10:06:02 +0100 Subject: [PATCH 01/10] Move test docker files into test folder --- server/{ => tests}/docker/config/cf2.conf | 0 server/{ => tests}/docker/test-bash-ioc.yml | 6 +++--- server/{ => tests}/docker/test-multi-recc.yml | 6 +++--- server/{ => tests}/docker/test-single-ioc.yml | 6 +++--- server/tests/test_bash_ioc.py | 2 +- server/tests/test_multiple_recceiver.py | 2 +- server/tests/test_single_ioc.py | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) rename server/{ => tests}/docker/config/cf2.conf (100%) rename server/{ => tests}/docker/test-bash-ioc.yml (83%) rename server/{ => tests}/docker/test-multi-recc.yml (92%) rename server/{ => tests}/docker/test-single-ioc.yml (82%) diff --git a/server/docker/config/cf2.conf b/server/tests/docker/config/cf2.conf similarity index 100% rename from server/docker/config/cf2.conf rename to server/tests/docker/config/cf2.conf diff --git a/server/docker/test-bash-ioc.yml b/server/tests/docker/test-bash-ioc.yml similarity index 83% rename from server/docker/test-bash-ioc.yml rename to server/tests/docker/test-bash-ioc.yml index 17b1d5a..caca7b8 100644 --- a/server/docker/test-bash-ioc.yml +++ b/server/tests/docker/test-bash-ioc.yml @@ -1,10 +1,10 @@ name: test-bash-ioc include: - - cf-compose.yml + - ../../docker/cf-compose.yml services: recc1: extends: - file: ../compose.yml + file: ../../compose.yml service: recc depends_on: cf: @@ -16,7 +16,7 @@ services: - net-2-cf ioc1-1: extends: - file: ../../client/ioc-compose.yml + file: ../../../client/ioc-compose.yml service: ioc1 environment: - IOCSH_NAME=IOC1-1 diff --git a/server/docker/test-multi-recc.yml b/server/tests/docker/test-multi-recc.yml similarity index 92% rename from server/docker/test-multi-recc.yml rename to server/tests/docker/test-multi-recc.yml index cbe2401..f2b08a9 100644 --- a/server/docker/test-multi-recc.yml +++ b/server/tests/docker/test-multi-recc.yml @@ -1,10 +1,10 @@ name: test-multi-recc include: - - cf-compose.yml + - ../../docker/cf-compose.yml services: recc1: extends: - file: ../compose.yml + file: ../../compose.yml service: recc depends_on: cf: @@ -16,7 +16,7 @@ services: - net-2-cf ioc1-1: extends: - file: ../../client/ioc-compose.yml + file: ../../../client/ioc-compose.yml service: ioc1 depends_on: recc1: diff --git a/server/docker/test-single-ioc.yml b/server/tests/docker/test-single-ioc.yml similarity index 82% rename from server/docker/test-single-ioc.yml rename to server/tests/docker/test-single-ioc.yml index 6e4908d..8392c1e 100644 --- a/server/docker/test-single-ioc.yml +++ b/server/tests/docker/test-single-ioc.yml @@ -1,10 +1,10 @@ name: test-single-ioc include: - - cf-compose.yml + - ../../docker/cf-compose.yml services: recc1: extends: - file: ../compose.yml + file: ../../compose.yml service: recc depends_on: cf: @@ -16,7 +16,7 @@ services: - net-2-cf ioc1-1: extends: - file: ../../client/ioc-compose.yml + file: ../../../client/ioc-compose.yml service: ioc1 depends_on: recc1: diff --git a/server/tests/test_bash_ioc.py b/server/tests/test_bash_ioc.py index 85a087b..2e51ab0 100644 --- a/server/tests/test_bash_ioc.py +++ b/server/tests/test_bash_ioc.py @@ -18,7 +18,7 @@ encoding="utf-8", ) -setup_compose = ComposeFixtureFactory(Path("docker") / Path("test-bash-ioc.yml")).return_fixture() +setup_compose = ComposeFixtureFactory(Path("tests") / Path("docker") / Path("test-bash-ioc.yml")).return_fixture() def docker_exec_new_command(container: Container, command: str): diff --git a/server/tests/test_multiple_recceiver.py b/server/tests/test_multiple_recceiver.py index 0fc864a..6c4fafb 100644 --- a/server/tests/test_multiple_recceiver.py +++ b/server/tests/test_multiple_recceiver.py @@ -15,7 +15,7 @@ # 4 iocs, 6 channels per ioc (2 reccaster.db, 2 somerecords.db, 2 aliases in somerecords.db) EXPECTED_DEFAULT_CHANNEL_COUNT = 32 -setup_compose = ComposeFixtureFactory(Path("docker") / Path("test-multi-recc.yml")).return_fixture() +setup_compose = ComposeFixtureFactory(Path("tests") / Path("docker") / Path("test-multi-recc.yml")).return_fixture() @pytest.fixture(scope="class") diff --git a/server/tests/test_single_ioc.py b/server/tests/test_single_ioc.py index c767639..daa838e 100644 --- a/server/tests/test_single_ioc.py +++ b/server/tests/test_single_ioc.py @@ -27,7 +27,7 @@ EXPECTED_DEFAULT_CHANNEL_COUNT = 8 -setup_compose = ComposeFixtureFactory(Path("docker") / Path("test-single-ioc.yml")).return_fixture() +setup_compose = ComposeFixtureFactory(Path("tests") / Path("docker") / Path("test-single-ioc.yml")).return_fixture() @pytest.fixture(scope="class") From d9cad6b233f09ab2741e01395644c46d75895ae1 Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Thu, 13 Nov 2025 10:10:34 +0100 Subject: [PATCH 02/10] Remove old manual test files --- client/iocBoot/iocdemo/st_test.cmd | 23 ------- server/recceiver/scripts/readme | 75 ---------------------- server/recceiver/scripts/test_mock_iocs.py | 53 --------------- 3 files changed, 151 deletions(-) delete mode 100755 client/iocBoot/iocdemo/st_test.cmd delete mode 100644 server/recceiver/scripts/readme delete mode 100644 server/recceiver/scripts/test_mock_iocs.py diff --git a/client/iocBoot/iocdemo/st_test.cmd b/client/iocBoot/iocdemo/st_test.cmd deleted file mode 100755 index 420f865..0000000 --- a/client/iocBoot/iocdemo/st_test.cmd +++ /dev/null @@ -1,23 +0,0 @@ -#!../../bin/linux-x86_64-debug/demo - -## You may have to change demo to something else -## everywhere it appears in this file - -< envPaths - -## Register all support components -dbLoadDatabase("../../dbd/demo.dbd",0,0) -demo_registerRecordDeviceDriver(pdbbase) - -var(reccastTimeout, 5.0) -var(reccastMaxHoldoff, 5.0) - -epicsEnvSet("IOCNAME", "myioc") -epicsEnvSet("ENGINEER", "myself") -epicsEnvSet("LOCATION", "myplace") - - -## Load record instances -dbLoadRecords("../../db/cfstore_test_records.db", "P=test:") - -iocInit() diff --git a/server/recceiver/scripts/readme b/server/recceiver/scripts/readme deleted file mode 100644 index db5b87c..0000000 --- a/server/recceiver/scripts/readme +++ /dev/null @@ -1,75 +0,0 @@ -MANUAL TEST LOG: - -PASSED - Clean and poll on recsync start -PASSED - Clean and poll on recsync close -PASSED - Clean and poll on IOC start -PASSED - Clean and poll on IOC close -PASSED - 100 IOCs overlapping 1 IOC - -Clean and poll on recsync start: -0.a CF on -0.b add_extra_properties - - should see the new props in CF -1. CF off -2. Start recsync - - will poll in clean -3. Enable CF - - polling completes -4. CF will clean -5. Check result - - all channels inactive - -Clean and poll on recsync close: -1. CF on -2. Start recsync -3. add_extra_properties - - should see new props in CF -4. CF off -5. Recsync off - - will poll in clean - - (NYI) will give up if waiting too long -6. CF on -7. Check result - - all channels inactive - -Commit poll on IOC start: -1. Enable CF -2. Start recsync - - will perform clean -3. Disable CF -4. Start IOC - - waits for recsync announcement - - connects and polls commit -5. Enable CF -6. Commit poll fails once, reconnects, and commits -7. Check result - - all channels active - -Commit poll on IOC close: -1. Enable CF -2. Start Recsync -3. Start IOC -4. Wait for IOC to connect and commit - - all IOC channels now active -5. Disable CF -6. Close IOC - - commits [] and polls -7. Enable CF - - reconnects after polling and completes commit -8. Check result - - all channels inactive - -100 IOCs overlapping 1 IOC: -0. * Disable logging in demo.conf * -1. Enable CF -2. Start recsync -3. Start st.cmd in a command prompt - - IOC will connect and commit channels - - 4 channels will be active -4. run test_mock_iocs.py - - wait forever - - all channels will be active - - 2 channels will still belong to st.cmd -5. kill test_mock_iocs.py or killall st_test.cmd - - wait forever again - - 4 channels will be active, all belonging to st.cmd diff --git a/server/recceiver/scripts/test_mock_iocs.py b/server/recceiver/scripts/test_mock_iocs.py deleted file mode 100644 index 301cc51..0000000 --- a/server/recceiver/scripts/test_mock_iocs.py +++ /dev/null @@ -1,53 +0,0 @@ -import os -import signal -import sys -import threading -import time - -iocexecutable = "st.cmd" - - -def startIOC(): - # conf needs to be set - pid, fd = os.forkpty() - if pid == 0: - os.chdir("../../../client/iocBoot/iocdemo") - print(os.curdir) - os.execv("st_test.cmd", [""]) - return pid, fd - - -def readfd(fd): - while 1: - _ = str(os.read(fd, 16384).strip("\n")) - - -def handler(signum, frame): - global pids - for pid in pids: - os.kill(pid, signal.SIGKILL) - sys.exit() - - -def main(): - global pids - pids = [] - signal.signal(signal.SIGTERM, handler) - os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # Uses a filename, not good, also only works on linux? - threads = [] - for i in range(1, 100): - iocpid, iocfd = startIOC() - pids.append(iocpid) - print("len pids: ", len(pids)) - iocthread = threading.Thread(group=None, target=readfd, args=(iocfd,), name="iocthread", kwargs={}) - threads.append(iocthread) - iocthread.start() - try: - while 1: - time.sleep(1) - except KeyboardInterrupt: - sys.exit() - - -if __name__ == "__main__": - main() From 66d7f3dde006c7e390bdf6f61e4cb9d523db86e3 Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Thu, 13 Nov 2025 11:04:46 +0100 Subject: [PATCH 03/10] Move test ioc files into test folder --- client/demoApp/Db/Makefile | 2 -- client/iocBoot/iocdemo/st.cmd | 1 - server/tests/docker/test-bash-ioc.yml | 10 ++++++++ server/tests/docker/test-multi-recc.yml | 11 +++++++++ server/tests/docker/test-single-ioc.yml | 11 +++++++++ .../Db => server/tests/ioc}/archive.db | 0 .../tests/ioc}/archive_bugtest.db | 0 .../st_bugtest.cmd => server/tests/ioc/st.cmd | 18 ++++++-------- server/tests/ioc/st_bugtest.cmd | 24 +++++++++++++++++++ server/tests/test_bash_ioc.py | 4 ++-- 10 files changed, 65 insertions(+), 16 deletions(-) rename {client/demoApp/Db => server/tests/ioc}/archive.db (100%) rename {client/demoApp/Db => server/tests/ioc}/archive_bugtest.db (100%) rename client/iocBoot/iocdemo/st_bugtest.cmd => server/tests/ioc/st.cmd (56%) create mode 100644 server/tests/ioc/st_bugtest.cmd diff --git a/client/demoApp/Db/Makefile b/client/demoApp/Db/Makefile index 60db276..858424c 100644 --- a/client/demoApp/Db/Makefile +++ b/client/demoApp/Db/Makefile @@ -11,8 +11,6 @@ include $(TOP)/configure/CONFIG # Create and install (or just install) into /db # databases, templates, substitutions like this DB += somerecords.db -DB += archive.db -DB += archive_bugtest.db #---------------------------------------------------- # If .db template is not named *.template add # _template = diff --git a/client/iocBoot/iocdemo/st.cmd b/client/iocBoot/iocdemo/st.cmd index 35c72fa..85594c3 100755 --- a/client/iocBoot/iocdemo/st.cmd +++ b/client/iocBoot/iocdemo/st.cmd @@ -29,6 +29,5 @@ addReccasterExcludePattern("*exclude_this") ## Load record instances dbLoadRecords("../../db/reccaster.db", "P=$(IOCSH_NAME):") dbLoadRecords("../../db/somerecords.db","P=$(IOCSH_NAME):") -dbLoadRecords("../../db/archive.db", "P=$(IOCSH_NAME):") iocInit() diff --git a/server/tests/docker/test-bash-ioc.yml b/server/tests/docker/test-bash-ioc.yml index caca7b8..ef1d525 100644 --- a/server/tests/docker/test-bash-ioc.yml +++ b/server/tests/docker/test-bash-ioc.yml @@ -28,7 +28,17 @@ services: command: bash networks: - net-1-recc-1 + volumes: + - ioc:/ioc networks: net-1-recc-1: driver: bridge + +volumes: + ioc: + driver: local + driver_opts: + type: none + device: ../ioc + o: bind diff --git a/server/tests/docker/test-multi-recc.yml b/server/tests/docker/test-multi-recc.yml index f2b08a9..5cc0dcb 100644 --- a/server/tests/docker/test-multi-recc.yml +++ b/server/tests/docker/test-multi-recc.yml @@ -27,6 +27,9 @@ services: hostname: ioc1-1 networks: - net-1-recc-1 + command: ./demo /ioc/st.cmd + volumes: + - ioc:/ioc ioc1-2: extends: ioc1-1 @@ -72,3 +75,11 @@ networks: driver: bridge net-1-recc-2: driver: bridge + +volumes: + ioc: + driver: local + driver_opts: + type: none + device: ../ioc + o: bind diff --git a/server/tests/docker/test-single-ioc.yml b/server/tests/docker/test-single-ioc.yml index 8392c1e..41cb442 100644 --- a/server/tests/docker/test-single-ioc.yml +++ b/server/tests/docker/test-single-ioc.yml @@ -27,7 +27,18 @@ services: hostname: ioc1-1 networks: - net-1-recc-1 + command: ./demo /ioc/st.cmd + volumes: + - ioc:/ioc networks: net-1-recc-1: driver: bridge + +volumes: + ioc: + driver: local + driver_opts: + type: none + device: ../ioc + o: bind diff --git a/client/demoApp/Db/archive.db b/server/tests/ioc/archive.db similarity index 100% rename from client/demoApp/Db/archive.db rename to server/tests/ioc/archive.db diff --git a/client/demoApp/Db/archive_bugtest.db b/server/tests/ioc/archive_bugtest.db similarity index 100% rename from client/demoApp/Db/archive_bugtest.db rename to server/tests/ioc/archive_bugtest.db diff --git a/client/iocBoot/iocdemo/st_bugtest.cmd b/server/tests/ioc/st.cmd similarity index 56% rename from client/iocBoot/iocdemo/st_bugtest.cmd rename to server/tests/ioc/st.cmd index c1e1615..8bf9dbb 100644 --- a/client/iocBoot/iocdemo/st_bugtest.cmd +++ b/server/tests/ioc/st.cmd @@ -1,12 +1,5 @@ -#!../../bin/linux-x86_64-debug/demo - -## You may have to change demo to something else -## everywhere it appears in this file - -< envPaths - ## Register all support components -dbLoadDatabase("../../dbd/demo.dbd",0,0) +dbLoadDatabase("/recsync/dbd/demo.dbd",0,0) demo_registerRecordDeviceDriver(pdbbase) var(reccastTimeout, 5.0) @@ -23,9 +16,12 @@ epicsEnvSet("SECTOR", "mysector") addReccasterEnvVars("CONTACT", "SECTOR") addReccasterEnvVars("BUILDING") +addReccasterExcludePattern("*_", "*__") +addReccasterExcludePattern("*exclude_this") + ## Load record instances -dbLoadRecords("../../db/reccaster.db", "P=$(IOCSH_NAME):") -dbLoadRecords("../../db/somerecords.db","P=$(IOCSH_NAME):") -dbLoadRecords("../../db/archive_bugtest.db", "P=$(IOCSH_NAME):") +dbLoadRecords("/recsync/castApp/Db/reccaster.db", "P=$(IOCSH_NAME):") +dbLoadRecords("/recsync/demoApp/Db/somerecords.db","P=$(IOCSH_NAME):") +dbLoadRecords("/ioc/archive.db","P=$(IOCSH_NAME):") iocInit() diff --git a/server/tests/ioc/st_bugtest.cmd b/server/tests/ioc/st_bugtest.cmd new file mode 100644 index 0000000..97eede3 --- /dev/null +++ b/server/tests/ioc/st_bugtest.cmd @@ -0,0 +1,24 @@ +## Register all support components +dbLoadDatabase("/recsync/dbd/demo.dbd",0,0) +demo_registerRecordDeviceDriver(pdbbase) + +var(reccastTimeout, 5.0) +var(reccastMaxHoldoff, 5.0) + +epicsEnvSet("IOCNAME", "$(IOCSH_NAME)") +epicsEnvSet("ENGINEER", "myself") +epicsEnvSet("LOCATION", "myplace") + +epicsEnvSet("CONTACT", "mycontact") +epicsEnvSet("BUILDING", "mybuilding") +epicsEnvSet("SECTOR", "mysector") + +addReccasterEnvVars("CONTACT", "SECTOR") +addReccasterEnvVars("BUILDING") + +## Load record instances +dbLoadRecords("/recsync/castApp/Db/reccaster.db", "P=$(IOCSH_NAME):") +dbLoadRecords("/recsync/demoApp/Db/somerecords.db","P=$(IOCSH_NAME):") +dbLoadRecords("/ioc/archive_bugtest.db", "P=$(IOCSH_NAME):") + +iocInit() diff --git a/server/tests/test_bash_ioc.py b/server/tests/test_bash_ioc.py index 2e51ab0..8fb3ef9 100644 --- a/server/tests/test_bash_ioc.py +++ b/server/tests/test_bash_ioc.py @@ -47,7 +47,7 @@ def test_remove_property(self, setup_compose: DockerCompose) -> None: # noqa: F ioc_container = setup_compose.get_container("ioc1-1") docker_client = DockerClient() docker_ioc = docker_client.containers.get(ioc_container.ID) - docker_exec_new_command(docker_ioc, "./demo /recsync/iocBoot/iocdemo/st.cmd") + docker_exec_new_command(docker_ioc, "./demo /ioc/st.cmd") LOG.info("Waiting for channels to sync") cf_client = create_client_and_wait(setup_compose, expected_channel_count=8) @@ -70,7 +70,7 @@ def get_len_archive_properties(archive_channel): ) docker_ioc.start() - docker_exec_new_command(docker_ioc, "./demo /recsync/iocBoot/iocdemo/st_bugtest.cmd") + docker_exec_new_command(docker_ioc, "./demo /ioc/st_bugtest.cmd") # Detach by not waiting for the thread to finish LOG.debug("ioc1-1 restart") From 2d3093c63a5fd072d9a6f65458c65222c0e72f20 Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Thu, 13 Nov 2025 14:54:02 +0100 Subject: [PATCH 04/10] single st.cmd file --- server/tests/ioc/st.cmd | 2 +- server/tests/ioc/st_bugtest.cmd | 24 ------------------------ server/tests/test_bash_ioc.py | 6 +++--- 3 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 server/tests/ioc/st_bugtest.cmd diff --git a/server/tests/ioc/st.cmd b/server/tests/ioc/st.cmd index 8bf9dbb..e891304 100644 --- a/server/tests/ioc/st.cmd +++ b/server/tests/ioc/st.cmd @@ -22,6 +22,6 @@ addReccasterExcludePattern("*exclude_this") ## Load record instances dbLoadRecords("/recsync/castApp/Db/reccaster.db", "P=$(IOCSH_NAME):") dbLoadRecords("/recsync/demoApp/Db/somerecords.db","P=$(IOCSH_NAME):") -dbLoadRecords("/ioc/archive.db","P=$(IOCSH_NAME):") +dbLoadRecords("/ioc/$(DB_FILE=archive.db)","P=$(IOCSH_NAME):") iocInit() diff --git a/server/tests/ioc/st_bugtest.cmd b/server/tests/ioc/st_bugtest.cmd deleted file mode 100644 index 97eede3..0000000 --- a/server/tests/ioc/st_bugtest.cmd +++ /dev/null @@ -1,24 +0,0 @@ -## Register all support components -dbLoadDatabase("/recsync/dbd/demo.dbd",0,0) -demo_registerRecordDeviceDriver(pdbbase) - -var(reccastTimeout, 5.0) -var(reccastMaxHoldoff, 5.0) - -epicsEnvSet("IOCNAME", "$(IOCSH_NAME)") -epicsEnvSet("ENGINEER", "myself") -epicsEnvSet("LOCATION", "myplace") - -epicsEnvSet("CONTACT", "mycontact") -epicsEnvSet("BUILDING", "mybuilding") -epicsEnvSet("SECTOR", "mysector") - -addReccasterEnvVars("CONTACT", "SECTOR") -addReccasterEnvVars("BUILDING") - -## Load record instances -dbLoadRecords("/recsync/castApp/Db/reccaster.db", "P=$(IOCSH_NAME):") -dbLoadRecords("/recsync/demoApp/Db/somerecords.db","P=$(IOCSH_NAME):") -dbLoadRecords("/ioc/archive_bugtest.db", "P=$(IOCSH_NAME):") - -iocInit() diff --git a/server/tests/test_bash_ioc.py b/server/tests/test_bash_ioc.py index 8fb3ef9..184ba54 100644 --- a/server/tests/test_bash_ioc.py +++ b/server/tests/test_bash_ioc.py @@ -21,14 +21,14 @@ setup_compose = ComposeFixtureFactory(Path("tests") / Path("docker") / Path("test-bash-ioc.yml")).return_fixture() -def docker_exec_new_command(container: Container, command: str): +def docker_exec_new_command(container: Container, command: str, env: dict | None = None) -> None: def stream_logs(exec_result, cmd: str): if LOG.level <= logging.DEBUG: LOG.debug("Logs from %s with command %s", container.name, cmd) for line in exec_result.output: LOG.debug(line.decode().strip()) - exec_result = container.exec_run(command, tty=True, stream=True) + exec_result = container.exec_run(command, tty=True, stream=True, environment=env) log_thread = threading.Thread( target=stream_logs, args=( @@ -70,7 +70,7 @@ def get_len_archive_properties(archive_channel): ) docker_ioc.start() - docker_exec_new_command(docker_ioc, "./demo /ioc/st_bugtest.cmd") + docker_exec_new_command(docker_ioc, "./demo /ioc/st.cmd", env={"DB_FILE": "archiver_bug_test.db"}) # Detach by not waiting for the thread to finish LOG.debug("ioc1-1 restart") From 3ed7aa4fc10d84d20bf13622f654dcf48257698f Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Thu, 13 Nov 2025 15:00:16 +0100 Subject: [PATCH 05/10] Single record for testing --- server/tests/client_checks.py | 4 ++-- server/tests/ioc/archive.db | 8 ++------ server/tests/ioc/archive_bugtest.db | 7 +------ server/tests/ioc/st.cmd | 2 -- server/tests/test_bash_ioc.py | 2 +- server/tests/test_multiple_recceiver.py | 16 ++++++++-------- server/tests/test_single_ioc.py | 14 +++++++------- 7 files changed, 21 insertions(+), 32 deletions(-) diff --git a/server/tests/client_checks.py b/server/tests/client_checks.py index 9af7ce0..2a1a8e5 100644 --- a/server/tests/client_checks.py +++ b/server/tests/client_checks.py @@ -28,7 +28,7 @@ def channels_match(channels_begin, channels_end, properties_to_match: list[str]) channel_match(channel, channels_end[channel_index], properties_to_match) -def check_channel_count(cf_client: ChannelFinderClient, name="*", expected_channel_count=24): +def check_channel_count(cf_client: ChannelFinderClient, expected_channel_count, name="*"): channels = cf_client.find(name=name) LOG.debug("Found %s channels", len(channels)) return len(channels) == expected_channel_count @@ -52,7 +52,7 @@ def wait_for_sync(cf_client: ChannelFinderClient, check: Callable[[ChannelFinder return False -def create_client_and_wait(compose: DockerCompose, expected_channel_count=24) -> ChannelFinderClient: +def create_client_and_wait(compose: DockerCompose, expected_channel_count) -> ChannelFinderClient: LOG.info("Waiting for channels to sync") cf_client = create_client_from_compose(compose) assert wait_for_sync( diff --git a/server/tests/ioc/archive.db b/server/tests/ioc/archive.db index 17b4eff..b94ef09 100644 --- a/server/tests/ioc/archive.db +++ b/server/tests/ioc/archive.db @@ -1,11 +1,7 @@ record(ai, "$(P)ai:archive") { + alias("$(P)ai:archive:alias") info("test", "testing") info("archive", "MONITOR@1") -} - -record(longout, "$(P)lo:archive") { - info("test", "testing") - info("hello", "world") - info("archive", "default") + field(DESC, "testdesc") } diff --git a/server/tests/ioc/archive_bugtest.db b/server/tests/ioc/archive_bugtest.db index 833e0bc..11a7113 100644 --- a/server/tests/ioc/archive_bugtest.db +++ b/server/tests/ioc/archive_bugtest.db @@ -1,10 +1,5 @@ record(ai, "$(P)ai:archive") { + alias("$(P)ai:archive:alias") info("test", "testing") } - -record(longout, "$(P)lo:archive") { - info("test", "testing") - info("hello", "world") - info("archive", "default") -} diff --git a/server/tests/ioc/st.cmd b/server/tests/ioc/st.cmd index e891304..1ae84c7 100644 --- a/server/tests/ioc/st.cmd +++ b/server/tests/ioc/st.cmd @@ -20,8 +20,6 @@ addReccasterExcludePattern("*_", "*__") addReccasterExcludePattern("*exclude_this") ## Load record instances -dbLoadRecords("/recsync/castApp/Db/reccaster.db", "P=$(IOCSH_NAME):") -dbLoadRecords("/recsync/demoApp/Db/somerecords.db","P=$(IOCSH_NAME):") dbLoadRecords("/ioc/$(DB_FILE=archive.db)","P=$(IOCSH_NAME):") iocInit() diff --git a/server/tests/test_bash_ioc.py b/server/tests/test_bash_ioc.py index 184ba54..fc73e78 100644 --- a/server/tests/test_bash_ioc.py +++ b/server/tests/test_bash_ioc.py @@ -50,7 +50,7 @@ def test_remove_property(self, setup_compose: DockerCompose) -> None: # noqa: F docker_exec_new_command(docker_ioc, "./demo /ioc/st.cmd") LOG.info("Waiting for channels to sync") - cf_client = create_client_and_wait(setup_compose, expected_channel_count=8) + cf_client = create_client_and_wait(setup_compose, expected_channel_count=2) # Check ioc1-1 has ai:archive with info tag "archive" LOG.debug('Checking ioc1-1 has ai:archive with info tag "archive"') diff --git a/server/tests/test_multiple_recceiver.py b/server/tests/test_multiple_recceiver.py index 6c4fafb..bcbca60 100644 --- a/server/tests/test_multiple_recceiver.py +++ b/server/tests/test_multiple_recceiver.py @@ -12,8 +12,8 @@ RECSYNC_RESTART_DELAY = 30 # Number of channels expected in the default setup -# 4 iocs, 6 channels per ioc (2 reccaster.db, 2 somerecords.db, 2 aliases in somerecords.db) -EXPECTED_DEFAULT_CHANNEL_COUNT = 32 +# 4 iocs, 1 channel 1 alias in archive.db +EXPECTED_DEFAULT_CHANNEL_COUNT = 4 * 2 setup_compose = ComposeFixtureFactory(Path("tests") / Path("docker") / Path("test-multi-recc.yml")).return_fixture() @@ -27,23 +27,23 @@ class TestMultipleRecceiver: def test_number_of_channels_and_channel_name(self, cf_client: ChannelFinderClient) -> None: channels = cf_client.find(name="*") assert len(channels) == EXPECTED_DEFAULT_CHANNEL_COUNT - assert channels[0]["name"] == "IOC1-1:Msg-I" + assert channels[0]["name"] == "IOC1-1:ai:archive" # Smoke Test Default Properties def test_number_of_aliases_and_alais_property(self, cf_client: ChannelFinderClient) -> None: channels = cf_client.find(property=[("alias", "*")]) - assert len(channels) == 8 - assert channels[0]["name"] == "IOC1-1:lix1" + assert len(channels) == 4 + assert channels[0]["name"] == "IOC1-1:ai:archive:alias" assert { "name": "alias", - "value": "IOC1-1:li", + "value": "IOC1-1:ai:archive", "owner": "admin", "channels": [], } in channels[0]["properties"] def test_number_of_recordDesc_and_property(self, cf_client: ChannelFinderClient) -> None: channels = cf_client.find(property=[("recordDesc", "*")]) - assert len(channels) == 4 + assert len(channels) == 8 assert { "name": "recordDesc", "value": "testdesc", @@ -56,7 +56,7 @@ def test_number_of_recordType_and_property(self, cf_client: ChannelFinderClient) assert len(channels) == EXPECTED_DEFAULT_CHANNEL_COUNT assert { "name": "recordType", - "value": "stringin", + "value": "ai", "owner": "admin", "channels": [], } in channels[0]["properties"] diff --git a/server/tests/test_single_ioc.py b/server/tests/test_single_ioc.py index daa838e..bc724ef 100644 --- a/server/tests/test_single_ioc.py +++ b/server/tests/test_single_ioc.py @@ -25,7 +25,7 @@ LOG: logging.Logger = logging.getLogger(__name__) -EXPECTED_DEFAULT_CHANNEL_COUNT = 8 +EXPECTED_DEFAULT_CHANNEL_COUNT = 2 setup_compose = ComposeFixtureFactory(Path("tests") / Path("docker") / Path("test-single-ioc.yml")).return_fixture() @@ -39,7 +39,7 @@ class TestRestartIOC: def test_channels_same_after_restart(self, setup_compose: DockerCompose, cf_client: ChannelFinderClient) -> None: # noqa: F811 channels_begin = cf_client.find(name="*") restart_container(setup_compose, "ioc1-1") - assert wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:Msg-I")) + assert wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:ai:archive")) channels_end = cf_client.find(name="*") assert len(channels_begin) == len(channels_end) channels_match(channels_begin, channels_end, PROPERTIES_TO_MATCH) @@ -52,12 +52,12 @@ def test_manual_channels_same_after_restart( test_property = {"name": "test_property", "owner": "testowner"} cf_client.set(properties=[test_property]) test_property_value = test_property | {"value": "test_value"} - channels = cf_client.find(name="IOC1-1:Msg-I") + channels = cf_client.find(name="IOC1-1:ai:archive") channels[0]["properties"] = [test_property_value] cf_client.set(property=test_property) channels_begin = cf_client.find(name="*") restart_container(setup_compose, "ioc1-1") - assert wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:Msg-I")) + assert wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:ai:archive")) channels_end = cf_client.find(name="*") assert len(channels_begin) == len(channels_end) channels_match(channels_begin, channels_end, PROPERTIES_TO_MATCH + ["test_property"]) @@ -85,7 +85,7 @@ def test_status_property_works_after_cf_restart( # Assert shutdown_container(setup_compose, "ioc1-1") assert wait_for_sync( - cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:Msg-I", INACTIVE_PROPERTY) + cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:ai:archive", INACTIVE_PROPERTY) ) channels_inactive = cf_client.find(property=[("iocName", "IOC1-1")]) assert all(INACTIVE_PROPERTY in ch["properties"] for ch in channels_inactive) @@ -109,7 +109,7 @@ def test_status_property_works_between_cf_down( # Assert assert wait_for_sync( - cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:Msg-I", INACTIVE_PROPERTY) + cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:ai:archive", INACTIVE_PROPERTY) ) channels_inactive = cf_client.find(property=[("iocName", "IOC1-1")]) assert all(INACTIVE_PROPERTY in ch["properties"] for ch in channels_inactive) @@ -123,6 +123,6 @@ def test_move_ioc_host( ) -> None: channels_begin = cf_client.find(name="*") clone_container(setup_compose, "ioc1-1-new", host_name="ioc1-1") - wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:Msg-I")) + wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:ai:archive")) channels_end = cf_client.find(name="*") assert len(channels_begin) == len(channels_end) From 5be46e073f851b27950fe7de5915a356925f9c2f Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Thu, 13 Nov 2025 15:21:33 +0100 Subject: [PATCH 06/10] Use a default name constant --- server/tests/client_checks.py | 1 + server/tests/test_bash_ioc.py | 27 +++++++++++++++---------- server/tests/test_multiple_recceiver.py | 8 ++++---- server/tests/test_single_ioc.py | 13 ++++++------ 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/server/tests/client_checks.py b/server/tests/client_checks.py index 2a1a8e5..74fc561 100644 --- a/server/tests/client_checks.py +++ b/server/tests/client_checks.py @@ -11,6 +11,7 @@ INACTIVE_PROPERTY = {"name": "pvStatus", "owner": "admin", "value": "Inactive", "channels": []} MAX_WAIT_SECONDS = 180 TIME_PERIOD_INCREMENT = 2 +DEFAULT_CHANNEL_NAME = "IOC1-1:ai:archive" def channel_match(channel0, channel1, properties_to_match: list[str]): diff --git a/server/tests/test_bash_ioc.py b/server/tests/test_bash_ioc.py index fc73e78..cd28483 100644 --- a/server/tests/test_bash_ioc.py +++ b/server/tests/test_bash_ioc.py @@ -7,7 +7,13 @@ from docker import DockerClient from docker.models.containers import Container -from .client_checks import INACTIVE_PROPERTY, check_channel_property, create_client_and_wait, wait_for_sync +from .client_checks import ( + DEFAULT_CHANNEL_NAME, + INACTIVE_PROPERTY, + check_channel_property, + create_client_and_wait, + wait_for_sync, +) from .docker import ComposeFixtureFactory LOG: logging.Logger = logging.getLogger(__name__) @@ -54,19 +60,18 @@ def test_remove_property(self, setup_compose: DockerCompose) -> None: # noqa: F # Check ioc1-1 has ai:archive with info tag "archive" LOG.debug('Checking ioc1-1 has ai:archive with info tag "archive"') - archive_channel_name = "IOC1-1:ai:archive" - archive_channel = cf_client.find(name=archive_channel_name) + channel = cf_client.find(name=DEFAULT_CHANNEL_NAME) - def get_len_archive_properties(archive_channel): - return len([prop for prop in archive_channel[0]["properties"] if prop["name"] == "archive"]) + def get_len_archive_properties(channel): + return len([prop for prop in channel[0]["properties"] if prop["name"] == "archive"]) - assert get_len_archive_properties(archive_channel) == 1 + assert get_len_archive_properties(channel) == 1 docker_ioc.stop() LOG.info("Waiting for channels to go inactive") assert wait_for_sync( cf_client, - lambda cf_client: check_channel_property(cf_client, name=archive_channel_name, prop=INACTIVE_PROPERTY), + lambda cf_client: check_channel_property(cf_client, name=DEFAULT_CHANNEL_NAME, prop=INACTIVE_PROPERTY), ) docker_ioc.start() @@ -74,9 +79,9 @@ def get_len_archive_properties(archive_channel): # Detach by not waiting for the thread to finish LOG.debug("ioc1-1 restart") - assert wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, name=archive_channel_name)) + assert wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, name=DEFAULT_CHANNEL_NAME)) LOG.debug("ioc1-1 has restarted and synced") - archive_channel = cf_client.find(name=archive_channel_name) - LOG.debug("archive channel: %s", archive_channel) - assert get_len_archive_properties(archive_channel) == 0 + channel = cf_client.find(name=DEFAULT_CHANNEL_NAME) + LOG.debug("archive channel: %s", channel) + assert get_len_archive_properties(channel) == 0 diff --git a/server/tests/test_multiple_recceiver.py b/server/tests/test_multiple_recceiver.py index bcbca60..d611f4e 100644 --- a/server/tests/test_multiple_recceiver.py +++ b/server/tests/test_multiple_recceiver.py @@ -5,7 +5,7 @@ from channelfinder import ChannelFinderClient from testcontainers.compose import DockerCompose -from .client_checks import create_client_and_wait +from .client_checks import DEFAULT_CHANNEL_NAME, create_client_and_wait from .docker import ComposeFixtureFactory LOG: logging.Logger = logging.getLogger(__name__) @@ -27,16 +27,16 @@ class TestMultipleRecceiver: def test_number_of_channels_and_channel_name(self, cf_client: ChannelFinderClient) -> None: channels = cf_client.find(name="*") assert len(channels) == EXPECTED_DEFAULT_CHANNEL_COUNT - assert channels[0]["name"] == "IOC1-1:ai:archive" + assert channels[0]["name"] == DEFAULT_CHANNEL_NAME # Smoke Test Default Properties def test_number_of_aliases_and_alais_property(self, cf_client: ChannelFinderClient) -> None: channels = cf_client.find(property=[("alias", "*")]) assert len(channels) == 4 - assert channels[0]["name"] == "IOC1-1:ai:archive:alias" + assert channels[0]["name"] == DEFAULT_CHANNEL_NAME + ":alias" assert { "name": "alias", - "value": "IOC1-1:ai:archive", + "value": DEFAULT_CHANNEL_NAME, "owner": "admin", "channels": [], } in channels[0]["properties"] diff --git a/server/tests/test_single_ioc.py b/server/tests/test_single_ioc.py index bc724ef..02ff292 100644 --- a/server/tests/test_single_ioc.py +++ b/server/tests/test_single_ioc.py @@ -7,6 +7,7 @@ from testcontainers.compose import DockerCompose from .client_checks import ( + DEFAULT_CHANNEL_NAME, INACTIVE_PROPERTY, channels_match, check_channel_property, @@ -39,7 +40,7 @@ class TestRestartIOC: def test_channels_same_after_restart(self, setup_compose: DockerCompose, cf_client: ChannelFinderClient) -> None: # noqa: F811 channels_begin = cf_client.find(name="*") restart_container(setup_compose, "ioc1-1") - assert wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:ai:archive")) + assert wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, DEFAULT_CHANNEL_NAME)) channels_end = cf_client.find(name="*") assert len(channels_begin) == len(channels_end) channels_match(channels_begin, channels_end, PROPERTIES_TO_MATCH) @@ -52,12 +53,12 @@ def test_manual_channels_same_after_restart( test_property = {"name": "test_property", "owner": "testowner"} cf_client.set(properties=[test_property]) test_property_value = test_property | {"value": "test_value"} - channels = cf_client.find(name="IOC1-1:ai:archive") + channels = cf_client.find(name=DEFAULT_CHANNEL_NAME) channels[0]["properties"] = [test_property_value] cf_client.set(property=test_property) channels_begin = cf_client.find(name="*") restart_container(setup_compose, "ioc1-1") - assert wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:ai:archive")) + assert wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, DEFAULT_CHANNEL_NAME)) channels_end = cf_client.find(name="*") assert len(channels_begin) == len(channels_end) channels_match(channels_begin, channels_end, PROPERTIES_TO_MATCH + ["test_property"]) @@ -85,7 +86,7 @@ def test_status_property_works_after_cf_restart( # Assert shutdown_container(setup_compose, "ioc1-1") assert wait_for_sync( - cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:ai:archive", INACTIVE_PROPERTY) + cf_client, lambda cf_client: check_channel_property(cf_client, DEFAULT_CHANNEL_NAME, INACTIVE_PROPERTY) ) channels_inactive = cf_client.find(property=[("iocName", "IOC1-1")]) assert all(INACTIVE_PROPERTY in ch["properties"] for ch in channels_inactive) @@ -109,7 +110,7 @@ def test_status_property_works_between_cf_down( # Assert assert wait_for_sync( - cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:ai:archive", INACTIVE_PROPERTY) + cf_client, lambda cf_client: check_channel_property(cf_client, DEFAULT_CHANNEL_NAME, INACTIVE_PROPERTY) ) channels_inactive = cf_client.find(property=[("iocName", "IOC1-1")]) assert all(INACTIVE_PROPERTY in ch["properties"] for ch in channels_inactive) @@ -123,6 +124,6 @@ def test_move_ioc_host( ) -> None: channels_begin = cf_client.find(name="*") clone_container(setup_compose, "ioc1-1-new", host_name="ioc1-1") - wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, "IOC1-1:ai:archive")) + wait_for_sync(cf_client, lambda cf_client: check_channel_property(cf_client, DEFAULT_CHANNEL_NAME)) channels_end = cf_client.find(name="*") assert len(channels_begin) == len(channels_end) From 9f1ae52ab7203bd789672eb7765bd772bb56c87a Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Thu, 13 Nov 2025 15:22:53 +0100 Subject: [PATCH 07/10] rename test case archive -> test --- server/tests/client_checks.py | 2 +- server/tests/ioc/archive_bugtest.db | 5 ----- server/tests/ioc/st.cmd | 2 +- server/tests/ioc/{archive.db => test.db} | 4 ++-- server/tests/ioc/test_remove_infotag.db | 6 ++++++ server/tests/test_bash_ioc.py | 6 +++--- 6 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 server/tests/ioc/archive_bugtest.db rename server/tests/ioc/{archive.db => test.db} (57%) create mode 100644 server/tests/ioc/test_remove_infotag.db diff --git a/server/tests/client_checks.py b/server/tests/client_checks.py index 74fc561..a5bda1e 100644 --- a/server/tests/client_checks.py +++ b/server/tests/client_checks.py @@ -11,7 +11,7 @@ INACTIVE_PROPERTY = {"name": "pvStatus", "owner": "admin", "value": "Inactive", "channels": []} MAX_WAIT_SECONDS = 180 TIME_PERIOD_INCREMENT = 2 -DEFAULT_CHANNEL_NAME = "IOC1-1:ai:archive" +DEFAULT_CHANNEL_NAME = "IOC1-1:ai:test" def channel_match(channel0, channel1, properties_to_match: list[str]): diff --git a/server/tests/ioc/archive_bugtest.db b/server/tests/ioc/archive_bugtest.db deleted file mode 100644 index 11a7113..0000000 --- a/server/tests/ioc/archive_bugtest.db +++ /dev/null @@ -1,5 +0,0 @@ - -record(ai, "$(P)ai:archive") { - alias("$(P)ai:archive:alias") - info("test", "testing") -} diff --git a/server/tests/ioc/st.cmd b/server/tests/ioc/st.cmd index 1ae84c7..cff7bd4 100644 --- a/server/tests/ioc/st.cmd +++ b/server/tests/ioc/st.cmd @@ -20,6 +20,6 @@ addReccasterExcludePattern("*_", "*__") addReccasterExcludePattern("*exclude_this") ## Load record instances -dbLoadRecords("/ioc/$(DB_FILE=archive.db)","P=$(IOCSH_NAME):") +dbLoadRecords("/ioc/$(DB_FILE=test.db)","P=$(IOCSH_NAME):") iocInit() diff --git a/server/tests/ioc/archive.db b/server/tests/ioc/test.db similarity index 57% rename from server/tests/ioc/archive.db rename to server/tests/ioc/test.db index b94ef09..7fbe7c2 100644 --- a/server/tests/ioc/archive.db +++ b/server/tests/ioc/test.db @@ -1,6 +1,6 @@ -record(ai, "$(P)ai:archive") { - alias("$(P)ai:archive:alias") +record(ai, "$(P)ai:test") { + alias("$(P)ai:test:alias") info("test", "testing") info("archive", "MONITOR@1") field(DESC, "testdesc") diff --git a/server/tests/ioc/test_remove_infotag.db b/server/tests/ioc/test_remove_infotag.db new file mode 100644 index 0000000..5ee53d2 --- /dev/null +++ b/server/tests/ioc/test_remove_infotag.db @@ -0,0 +1,6 @@ + +record(ai, "$(P)ai:test") { + alias("$(P)ai:test:alias") + info("test", "testing") + field(DESC, "testdesc") +} diff --git a/server/tests/test_bash_ioc.py b/server/tests/test_bash_ioc.py index cd28483..52dbd5e 100644 --- a/server/tests/test_bash_ioc.py +++ b/server/tests/test_bash_ioc.py @@ -58,8 +58,8 @@ def test_remove_property(self, setup_compose: DockerCompose) -> None: # noqa: F LOG.info("Waiting for channels to sync") cf_client = create_client_and_wait(setup_compose, expected_channel_count=2) - # Check ioc1-1 has ai:archive with info tag "archive" - LOG.debug('Checking ioc1-1 has ai:archive with info tag "archive"') + # Check ioc1-1 has ai:test with info tag "archive" + LOG.debug('Checking ioc1-1 has ai:test with info tag "archive"') channel = cf_client.find(name=DEFAULT_CHANNEL_NAME) def get_len_archive_properties(channel): @@ -75,7 +75,7 @@ def get_len_archive_properties(channel): ) docker_ioc.start() - docker_exec_new_command(docker_ioc, "./demo /ioc/st.cmd", env={"DB_FILE": "archiver_bug_test.db"}) + docker_exec_new_command(docker_ioc, "./demo /ioc/st.cmd", env={"DB_FILE": "test_remove_infotag.db"}) # Detach by not waiting for the thread to finish LOG.debug("ioc1-1 restart") From c089a2e93702d15f83698294ff1248de12c54765 Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Thu, 13 Nov 2025 15:24:44 +0100 Subject: [PATCH 08/10] Remove untested part of st.cmd --- server/tests/ioc/st.cmd | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/server/tests/ioc/st.cmd b/server/tests/ioc/st.cmd index cff7bd4..c2bac68 100644 --- a/server/tests/ioc/st.cmd +++ b/server/tests/ioc/st.cmd @@ -6,18 +6,6 @@ var(reccastTimeout, 5.0) var(reccastMaxHoldoff, 5.0) epicsEnvSet("IOCNAME", "$(IOCSH_NAME)") -epicsEnvSet("ENGINEER", "myself") -epicsEnvSet("LOCATION", "myplace") - -epicsEnvSet("CONTACT", "mycontact") -epicsEnvSet("BUILDING", "mybuilding") -epicsEnvSet("SECTOR", "mysector") - -addReccasterEnvVars("CONTACT", "SECTOR") -addReccasterEnvVars("BUILDING") - -addReccasterExcludePattern("*_", "*__") -addReccasterExcludePattern("*exclude_this") ## Load record instances dbLoadRecords("/ioc/$(DB_FILE=test.db)","P=$(IOCSH_NAME):") From eaa58fd28b8d7a14e2da8776edcf7f5cf205c904 Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Thu, 13 Nov 2025 17:24:02 +0100 Subject: [PATCH 09/10] Use pathlib join with string --- server/tests/test_bash_ioc.py | 2 +- server/tests/test_multiple_recceiver.py | 2 +- server/tests/test_single_ioc.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/tests/test_bash_ioc.py b/server/tests/test_bash_ioc.py index 52dbd5e..15602cd 100644 --- a/server/tests/test_bash_ioc.py +++ b/server/tests/test_bash_ioc.py @@ -24,7 +24,7 @@ encoding="utf-8", ) -setup_compose = ComposeFixtureFactory(Path("tests") / Path("docker") / Path("test-bash-ioc.yml")).return_fixture() +setup_compose = ComposeFixtureFactory(Path("tests") / "docker" / "test-bash-ioc.yml").return_fixture() def docker_exec_new_command(container: Container, command: str, env: dict | None = None) -> None: diff --git a/server/tests/test_multiple_recceiver.py b/server/tests/test_multiple_recceiver.py index d611f4e..c6cbeb5 100644 --- a/server/tests/test_multiple_recceiver.py +++ b/server/tests/test_multiple_recceiver.py @@ -15,7 +15,7 @@ # 4 iocs, 1 channel 1 alias in archive.db EXPECTED_DEFAULT_CHANNEL_COUNT = 4 * 2 -setup_compose = ComposeFixtureFactory(Path("tests") / Path("docker") / Path("test-multi-recc.yml")).return_fixture() +setup_compose = ComposeFixtureFactory(Path("tests") / "docker" / "test-multi-recc.yml").return_fixture() @pytest.fixture(scope="class") diff --git a/server/tests/test_single_ioc.py b/server/tests/test_single_ioc.py index 02ff292..50a700c 100644 --- a/server/tests/test_single_ioc.py +++ b/server/tests/test_single_ioc.py @@ -28,7 +28,7 @@ EXPECTED_DEFAULT_CHANNEL_COUNT = 2 -setup_compose = ComposeFixtureFactory(Path("tests") / Path("docker") / Path("test-single-ioc.yml")).return_fixture() +setup_compose = ComposeFixtureFactory(Path("tests") / "docker" / "test-single-ioc.yml").return_fixture() @pytest.fixture(scope="class") From ef9b12be21a28c3138bed720167145309185e14b Mon Sep 17 00:00:00 2001 From: Sky Brewer Date: Fri, 14 Nov 2025 11:37:37 +0100 Subject: [PATCH 10/10] fixup! single st.cmd file --- server/tests/test_bash_ioc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/tests/test_bash_ioc.py b/server/tests/test_bash_ioc.py index 15602cd..238e3d4 100644 --- a/server/tests/test_bash_ioc.py +++ b/server/tests/test_bash_ioc.py @@ -1,6 +1,7 @@ import logging import threading from pathlib import Path +from typing import Optional from testcontainers.compose import DockerCompose @@ -27,7 +28,7 @@ setup_compose = ComposeFixtureFactory(Path("tests") / "docker" / "test-bash-ioc.yml").return_fixture() -def docker_exec_new_command(container: Container, command: str, env: dict | None = None) -> None: +def docker_exec_new_command(container: Container, command: str, env: Optional[dict] = None) -> None: def stream_logs(exec_result, cmd: str): if LOG.level <= logging.DEBUG: LOG.debug("Logs from %s with command %s", container.name, cmd)