Skip to content
Open
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
87 changes: 87 additions & 0 deletions .github/workflows/emulator-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Emulator integration tests

on:
push:
branches: [ "main", "mike/camera2-emulator" ]
pull_request:
branches: [ "main" ]

jobs:
cryoscope-emulator-test:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libccfits-dev libcfitsio-dev libcurl4-openssl-dev \
nlohmann-json3-dev libzmq3-dev \
libopencv-dev libboost-thread-dev libboost-chrono-dev

- name: Build and install zmqpp from source
run: |
git clone --depth 1 https://github.com/zeromq/zmqpp.git /tmp/zmqpp
cd /tmp/zmqpp
mkdir build && cd build
cmake ..
make -j$(nproc)
sudo make install
sudo ldconfig

- name: Build camerad and emulator
run: |
mkdir -p ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake -DCONTROLLER=archon -DINSTR=hispec_tracking_camera -DDETECTOR_TYPE=Hxrg ..
make camerad emulator socksend -j$(nproc)

- name: CryoScope synthetic test
run: |
bin/emulator Config/cryoscope/cryoscope.cfg -i generic &
sleep 2
bin/camerad --foreground --config Config/cryoscope/cryoscope.cfg &
sleep 3

send() { bin/socksend -p 3031 -t 60 "$1"; }

send "open"
send "load"
send "power on"
send "exptime 0.1"
resp=$(send "expose 1")
echo "expose -> $resp"
echo "$resp" | grep -q "DONE" || exit 1

pkill -f 'bin/camerad' || true
pkill -f 'bin/emulator' || true
sleep 1

- name: CryoScope FITS playback test
run: |
cp Config/cryoscope/cryoscope.cfg /tmp/cryoscope_fits_test.cfg
echo "EMULATOR_DATADIR=Config/cryoscope" >> /tmp/cryoscope_fits_test.cfg

bin/emulator /tmp/cryoscope_fits_test.cfg -i generic &
sleep 2
bin/camerad --foreground --config /tmp/cryoscope_fits_test.cfg &
sleep 3

send() { bin/socksend -p 3031 -t 60 "$1"; }

send "open"
send "load"
send "power on"
send "mode VIDEORXR"
send "exptime 0.1"
resp=$(send "expose 1")
echo "expose -> $resp"
echo "$resp" | grep -q "DONE" || exit 1

pkill -f 'bin/camerad' || true
pkill -f 'bin/emulator' || true
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ find_package(nlohmann_json REQUIRED)
add_subdirectory(${PROJECT_BASE_DIR}/utils)
add_subdirectory(${PROJECT_BASE_DIR}/common)
add_subdirectory(${PROJECT_BASE_DIR}/camerad)
#add_subdirectory(${PROJECT_BASE_DIR}/emulator)
add_subdirectory(${PROJECT_BASE_DIR}/emulator)
add_subdirectory(${PROJECT_BASE_DIR}/tests EXCLUDE_FROM_ALL)
Binary file not shown.
Loading
Loading