Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .epicsdb2bob.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
debug: false
label_alignment: right
rtype_to_widget_map:
bo: ComboBox
bi: TextUpdate
27 changes: 24 additions & 3 deletions .github/workflows/CI.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: pixi run lint

build-and-test:
name: Build and Test
name: Build and Test ADXSPD on EL${{ matrix.rhel_version }}

needs: lint
runs-on: ubuntu-latest
Expand All @@ -46,6 +46,14 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup pixi
uses: prefix-dev/setup-pixi@8ca4608ef7f4daeb54f5205b20d0b7cb42f11143 # v0.8.14
with:
pixi-version: v0.56.0
cache: false
frozen: true

- name: Create CONFIG_SITE.local
run: |
cat > configure/CONFIG_SITE.local << EOF
Expand Down Expand Up @@ -76,6 +84,11 @@ jobs:
XML2_EXTERNAL=YES
WITH_ZLIB=YES
ZLIB_EXTERNAL=YES

# Enable coverage flags for unit tests
USR_CXX_FLAGS_Linux += --coverage
USR_LD_FLAGS_Linux += --coverage

EOF

echo "CONFIG_SITE.local created:"
Expand All @@ -96,7 +109,6 @@ jobs:
STREAM=/usr/lib64/epics
SNCSEQ=/usr/lib64/epics
RECCASTER=/usr/lib64/epics
MOTOR=/usr/lib64/epics

# EPICS_BASE should always be last
EPICS_BASE=/usr/lib64/epics
Expand All @@ -118,4 +130,13 @@ jobs:

- name: Run unit tests
run: |
./bin/linux-x86_64/TestADXSPD
pixi run tests

# TODO: add coverage reporting to CI once it is working & codecov enabled
# - name: Get coverage info
# run: |
# pixi run get-coverage-info

# - name: Show coverage summary
# run: |
# pixi run lcov -l coverage.info
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ test.py
notes.txt
checkVar.sh
setVar.sh
coverage.info
coverage-report/
13 changes: 8 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ repos:
- id: mixed-line-ending
args: ['--fix=lf']

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format

- repo: local
hooks:
- id: clang-format
name: clang-format
entry: clang-format -i
language: python
types_or: [c++, c]
args: ["-style=file"]
require_serial: false

- id: ruff
name: lint with ruff
language: system
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ realuninstall_iocs:
bobfiles:
pixi run make-bobfiles

# Generate parameter definitions and then immediately format with clang-format
paramdefs:
pixi run make-paramdefs
pixi run clang-format -i -style=file $(shell find xspdApp -name '*.h' -o -name '*.cpp')

lint:
pixi run lint
runtests:
cd xspdApp/tests && make -sj && cd ../.. && ./bin/linux-x86_64/ADXSPDTests

coverage-report:
pixi run tests
pixi run get-coverage-info
pixi run make-coverage-report
1 change: 0 additions & 1 deletion configure/CONFIG_SITE
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ CHECK_RELEASE = YES
#IOCS_APPL_TOP = </IOC/path/to/application/top>

BUILD_TESTS=NO

CURL_EXTERNAL=YES

# Get settings from AREA_DETECTOR, so we only have to configure once for all detectors if we want to
Expand Down
13 changes: 13 additions & 0 deletions iocs/xspdIOC/iocBoot/iocXSPD/st_base.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,22 @@ dbLoadRecords("$(ADXSPD)/db/ADXSPDModule.template", "P=$(PREFIX), R=mod1:,PORT=$
# Load all other plugins using commonPlugins.cmd
< $(ADCORE)/iocBoot/commonPlugins.cmd

# Load Apache Arrow file plugin
NDFileArrowConfigure("ARR1", $(QSIZE), 0, "$(PORT)", 0)
dbLoadRecords("$(ADPLUGINARROW)/db/NDFileArrow.template", "P=$(PREFIX),R=arrow1:,PORT=ARR1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=PROC1")

# set_requestfile_path("$(ADXSPD)/xspdApp/Db")

iocInit()

# save things every thirty seconds
create_monitor_set("auto_settings.req", 30, "P=$(PREFIX)")

# Set initial plugin arrow params

dbpf $(PREFIX)arrow1:FilePath "/tmp"
dbpf $(PREFIX)arrow1:FileTemplate "%s%s_%3.3d.csv"
dbpf $(PREFIX)arrow1:AutoIncrement 1
dbpf $(PREFIX)arrow1:OutputFileFormat 1
dbpf $(PREFIX)arrow1:EnableCallbacks 1
dbpf $(PREFIX)arrow1:FileName "Test"
1,051 changes: 693 additions & 358 deletions pixi.lock

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ version = "0.1.0"
[tasks]
lint = "pre-commit run --all-files"
build = "make -sj"
make-paramdefs = "dbtools-gen-paramdefs xspdApp/Db xspdApp/src && pre-commit run --all-files"
make-bobfiles = "epicsdb2bob xspdApp/Db xspdApp/op/bob -d -r _RBV -t none"
simulator = "sim/xspdSimulator.py"
make-paramdefs = "epicsdbtools paramdefs xspdApp/Db xspdApp/src -p XSPD"
make-bobfiles = "epicsdb2bob xspdApp/Db xspdApp/op/bob/autogenerated -d -r _RBV -t none"
make-sample-responses = "./xspdApp/tests/scripts/generate_sample_response_json.py"
tests = "./xspdApp/tests/O.linux-x86_64/TestADXSPD"
get-coverage-info = "lcov --no-external --capture --directory xspdApp/src --output-file coverage.info"
make-coverage-report = "genhtml coverage.info --output-directory coverage-report"

[dependencies]
pre-commit = ">=4.5.1,<5"
Expand All @@ -19,6 +22,9 @@ pip = ">=25.2,<26"
python = ">=3.12.12,<3.13"
flask = ">=3.1.2,<4"
pyzmq = ">=27.1.0,<28"
requests = ">=2.32.5,<3"
clang-format = ">=21.1.8,<22"
lcov = ">=1.16,<2"

[pypi-dependencies]
epicsdbtools = { git = "https://github.com/jwlodek/epicsdbtools.git" }
Expand Down
Loading