Skip to content
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

Move emulator and IOC tests into support module #6556

Open
DominicOram opened this issue Jun 3, 2021 · 32 comments
Open

Move emulator and IOC tests into support module #6556

DominicOram opened this issue Jun 3, 2021 · 32 comments
Assignees

Comments

@DominicOram
Copy link
Contributor

As a support person I would like to reduce the number of repositories I need to modify when I change an IOC as discussed in #6131. To do this I want to move the emulator and IOC test for each IOC into the IOC support directory.

Acceptance Criteria

@DominicOram
Copy link
Contributor Author

DominicOram commented Jun 9, 2021

To move tests/emulator while keeping history:

  1. Make sure Python 3 is in your path
  2. Copy this python file into the directory listed when you run git --exec-path
  3. Clone the IOC test framework into a new area: cd C:\Instrument\Dev and git clone https://github.com/ISISComputingGroup/EPICS-IOC_Test_Framework.git
  4. Remove the remote so that you can't accidentally push any changes cd EPICS-IOC_Test_Framework and git remote rm origin
  5. Filter out all the files from the repo, other than the one you want e.g. for the ccd100: git filter-repo -f --path tests/ccd100.py
  6. Clean the repository:
git reset --hard
git gc --aggressive 
git prune
git clean -fd
  1. Check that the EPICS-IOC_Test_Framework directory should now only have the one test you are interested in
  2. In the IOC support directory (i.e., support/CCD100/master) make a new branch with the ticket number as you usually would then run git remote add tests C:/Instrument/Dev/EPICS-IOC_Test_Framework to add the IOC test framework as a remote
  3. Run git pull tests master --allow-unrelated-histories to get the commits for the system test
  4. Push the new file upstream git push --set-upstream origin ...
  5. Repeat steps 3 - 10 for https://github.com/ISISComputingGroup/EPICS-DeviceEmulator. You will want to keep the additional Lewis files too by doing git filter-repo -f --path lewis_emulators/__init__.py --path lewis_emulators/lewis_versions.py --path lewis_emulators/CCD100/ as your filter command. You will also need to add the lewis_emulators rather than tests folder as the remote repository.
  6. Rename the test to something more sensible now:
git mv tests/ccd100.py system_tests/tests/ccd100.py
rm tests/
git mv lewis_emulators/ system_tests/lewis_emulators
rm lewis_emulators/
  1. Create an __init__.py in /system_tests/ and in /system_tests/tests/
  2. Confirm that the tests work by running %PYTHON3% %EPICS_ROOT%\support\IocTestFramework\master\run_tests.py --test_and_emulator .\system_tests
  3. Create run_tests.bat in system_tests with these contents:
@echo off
setlocal
REM Run this directory's tests using the IOC Testing Framework

call "%~dp0..\..\..\..\config_env.bat"

REM Command line arguments always passed to the test script
SET ARGS=--test_and_emulator %~dp0
call %PYTHON3% -u "%EPICS_KIT_ROOT%\support\IocTestFramework\master\run_tests.py" %ARGS% %*
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
  1. In the Makefile at the top of the support directory (i.e., support/[device]/master) add:

(Note: this must have the tab character spacing matching)


ioctests:
	.\system_tests\run_tests.bat

  1. Confirm you can run the tests by running make ioctests
  2. Add the following to the .gitignore:
__pycache__/
*.py[cod]
*$py.class
test-reports/
  1. Remove the remotes by running git remote rm tests (or lewis_emulators).
  2. Make a new branch in the actual (not the dev branch you created) IoCTestFramework repository and remove the old tests (i.e., tests/ccd100.py).
  3. Make a new branch in the actual (not the dev branch you created) DeviceEmulator repository and remove the old emulator (i.e., lewis_emulators/ccd100/).

Note: In some cases IOC's do not have an associated Support module. In this case you need to make a new support module for the IOC instructions here.

@DominicOram
Copy link
Contributor Author

DominicOram commented Oct 25, 2021

These are how easy/hard I think some IOCs are to convert. This was only at a bit of a glance though so take it with a a pinch of salt and I didn't get round to categorizing them all.

Easy to do:

  • AG3631A (PR Created)
  • AG33220A (PR Created)
  • AG53220A
  • ALDN1000 (PR Created)
  • AMINT2L (PR Created)
  • ASTRIUM (PR Created)
  • CCD100 (PR Created)
  • CHTOBISR (PR Created)
  • CP2800 (PR Created)
  • CRYVALVE (PR Created)
  • CYBAMAN (PR Created)
  • ILM200 (PR Created)
  • KNRK6 (PR Created)
  • DH2000 (PR Created)
  • DMA4500M (PR Created)
  • EDTIC (PR Created)
  • EGXCOLIM
  • EUROTHRM
  • FLIPPRPS (PR Created)
  • FMR (PR Created)
  • FZJDDFCH
  • GAMRY
  • WBVALVE (PR Created)

Harder:

  • TPG26x
  • TPG300
  • TPG36x
  • CAENV895
  • CRYOSMS
  • DFKPS
  • DAQMX
  • FERMCHOP
  • GALIL
  • GALILMUL

Uncategorized or untested IOCs:

  • ATTOCUBE
  • BGRSCRPT
  • BKHOFF - also will be retired soon
  • CAENMCA
  • CONEXAGP
  • CONTROLSVCS
  • COUETTE
  • DELFTARDUSTEP
  • DELFTBPMAG
  • DELFTDCMAG
  • DELFTSHEAR
  • DETADC
  • ECLAB
  • EDNEXT
  • FINS
  • GEMORC (PR)
  • HAMEG8123
  • HELIOX
  • HIFIMAG
  • HIFIMAGS
  • HLG
  • HLX503
  • HVCAEN
  • HVCAENA
  • ICEFRDGE
  • IEG (PR)
  • INDFURN (PR)
  • INHIBITR
  • INSTETC
  • INSTRON
  • IPS
  • ISISDAE
  • ITC503
  • JSCO4180
  • JULABO
  • KEPCO
  • KEYLKG (PR)
  • KHLY2001
  • KHLY2400
  • KHLY2700 (PR)
  • KHLY6517
  • KNR1050 (PR)
  • KYNCTM3K
  • LINKAM95
  • LINMOT
  • LKSH218
  • LKSH336
  • LKSH340
  • LKSH372
  • LKSH460
  • LSICORR
  • MCLEN
  • MECFRF
  • MERCURY_ITC
  • MEZFLIPR
  • MK2CHOPR (PR)
  • MK3CHOPR (PR)
  • MKSPR4KB
  • MOXA12XX
  • MUONJAWS
  • MUONTPAR
  • NANODAC
  • NEOCERA
  • NGEM
  • NGPSPSU
  • NIMATRO
  • NWPRTXPS
  • OERCONE
  • PDR2000
  • PEARLPC
  • PIMOT
  • PSCTRL
  • PT2025
  • QEPRO
  • REFL
  • RKNDIO
  • RKNPS
  • ROTSC
  • RUNCTRL
  • SAMPOS
  • SCHNDR
  • SCIMAG3D
  • SDTEST
  • SECI2IBEX
  • SEPRTR
  • SKFCHOPPER
  • SKFMB350
  • SM300
  • SMC100
  • SMRTMON
  • SMTOF70
  • SP2XX
  • SPINFLIPPER306015
  • SPRLG
  • STPS350
  • STSR400
  • TDK_LAMBDA_GENESYS
  • TEKAFG3XXX
  • TEKDMM40X0
  • TEKMSO4104B
  • TEST
  • TIZR
  • TRITON (PR)
  • TTI355 (PR)
  • TTIEX355P
  • TTIPLP
  • TWINCAT
  • WEEDER
  • WM323
  • ZFCNTRL
  • ZFMAGFLD

@aaron-long
Copy link
Member

aaron-long commented Oct 28, 2021

@aaron-long
Copy link
Member

@aaron-long
Copy link
Member

@aaron-long
Copy link
Member

@rerpha
Copy link
Contributor

rerpha commented Apr 22, 2022

BKHOFF (old Beckhoff ioc used on IMAT) I span this out into a different ticket but i suppose still along the same vein:
#7125 (PRs in there)

@Adam-Szw
Copy link
Contributor

Adam-Szw commented Apr 22, 2022

KHLY2700
ISISComputingGroup/EPICS-KeithleyDVM#10
ISISComputingGroup/EPICS-IOC_Test_Framework#533
ISISComputingGroup/EPICS-DeviceEmulator#144

@rerpha
Copy link
Contributor

rerpha commented Apr 22, 2022

Astrium (removal, there are none left and never will be any more) - have closed Aaron's PRs:
IOC: ISISComputingGroup/EPICS-ioc#683
EPICS top: https://github.com/ISISComputingGroup/EPICS/pull/282
IOC test framework: ISISComputingGroup/EPICS-IOC_Test_Framework#534
Once these are in we should archive https://github.com/ISISComputingGroup/EPICS-AstriumChopper and https://github.com/ISISComputingGroup/AstriumChopper

@JackEAllen
Copy link
Member

FMR has no emulator that I can find, so just moving tests and empty lewis_emulator directory into submodule:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants