Skip to content

increase camerad readout timeout to work with slow CI VM #14

increase camerad readout timeout to work with slow CI VM

increase camerad readout timeout to work with slow CI VM #14

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