Run tests #365
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
on: | |
# push: | |
# branches: | |
# - main | |
# pull_request: | |
# branches: | |
# - main | |
schedule: | |
# Run every day at 2:30 UTC | |
- cron: "30 2 * * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
run: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo ./toolbox/install_dependencies_ubuntu.sh | |
# python3 -m venv metispipe | |
# . metispipe/bin/activate | |
export PYCPL_RECIPE_DIR="$(pwd)/metisp/pyrecipes/" | |
./toolbox/install_edps.sh | |
./toolbox/create_config.sh | |
- name: Fetch test data | |
run: | | |
git clone https://github.com/AstarVienna/METIS_Pipeline_Test_Data.git | |
# Try to checkout a branch in METIS_Pipeline_Test_Data that has | |
# the same name as the branch in METIS_Pipeline that we are testing. | |
git -C METIS_Pipeline_Test_Data checkout "${GITHUB_HEAD_REF}" || true | |
- name: Run pytest tests | |
run: | | |
set +x | |
# . metispipe/bin/activate | |
export PYESOREX_PLUGIN_DIR="$(pwd)/metisp/pyrecipes/" | |
export PYCPL_RECIPE_DIR="$(pwd)/metisp/pyrecipes/" | |
export PYTHONPATH="$(pwd)/metisp/pymetis/src/" | |
export SOF_DATA="$(pwd)/METIS_Pipeline_Test_Data/small202402/outputSmall/" | |
export SOF_DIR="$(pwd)/METIS_Pipeline_Test_Data/small202402/sofFiles/" | |
export PYESOREX_OUTPUT_DIR="$SOF_DATA" | |
python -m pytest -s | |
- name: Run pyESOREX test | |
run: | | |
set +x | |
# . metispipe/bin/activate | |
export PYESOREX_PLUGIN_DIR="$(pwd)/metisp/pyrecipes/" | |
export PYCPL_RECIPE_DIR="$(pwd)/metisp/pyrecipes/" | |
export PYTHONPATH="$(pwd)/metisp/pymetis/src/" | |
export SOF_DATA="$(pwd)/METIS_Pipeline_Test_Data/small202402/outputSmall/" | |
export SOF_DIR="$(pwd)/METIS_Pipeline_Test_Data/small202402/sofFiles/" | |
export PYESOREX_OUTPUT_DIR="$SOF_DATA" | |
# LIST RECIPES | |
pyesorex --recipes | |
# DET RECIPES | |
pyesorex metis_det_lingain "${SOF_DIR}/metis_det_lingain.lm.sof" | |
pyesorex metis_det_dark "${SOF_DIR}/metis_det_dark.lm.sof" | |
# IMG LM RECIPES | |
pyesorex metis_lm_img_distortion "${SOF_DIR}/metis_lm_img_distortion.sof" | |
pyesorex metis_lm_img_flat "${SOF_DIR}/metis_lm_img_flat.lamp.sof" | |
pyesorex metis_lm_img_basic_reduce "${SOF_DIR}/metis_lm_img_basic_reduce.std.sof" | |
pyesorex metis_lm_img_basic_reduce "${SOF_DIR}/metis_lm_img_basic_reduce.sci.sof" | |
pyesorex metis_lm_img_basic_reduce "${SOF_DIR}/metis_lm_img_basic_reduce.sky.sof" | |
pyesorex metis_lm_img_background "${SOF_DIR}/metis_lm_img_background.std.sof" | |
pyesorex metis_lm_img_background "${SOF_DIR}/metis_lm_img_background.sci.sof" | |
pyesorex metis_lm_img_std_process "${SOF_DIR}/metis_lm_img_std_process.sof" | |
pyesorex metis_lm_img_calibrate "${SOF_DIR}/metis_lm_img_calibrate.sof" | |
pyesorex metis_lm_img_sci_postprocess "${SOF_DIR}/metis_lm_img_sci_postprocess.sof" | |
# IFU RECIPES | |
pyesorex metis_ifu_distortion "${SOF_DIR}/metis_ifu_distortion.sof" | |
pyesorex metis_ifu_wavecal "${SOF_DIR}/metis_ifu_wavecal.sof" | |
pyesorex metis_ifu_rsrf "${SOF_DIR}/metis_ifu_rsrf.sof" | |
pyesorex metis_ifu_reduce "${SOF_DIR}/metis_ifu_reduce.std.sof" | |
pyesorex metis_ifu_reduce "${SOF_DIR}/metis_ifu_reduce.sci.sof" | |
pyesorex metis_ifu_telluric "${SOF_DIR}/metis_ifu_telluric.std.sof" | |
pyesorex metis_ifu_telluric "${SOF_DIR}/metis_ifu_telluric.sci.sof" | |
pyesorex metis_ifu_calibrate "${SOF_DIR}/metis_ifu_calibrate.sof" | |
pyesorex metis_ifu_postprocess "${SOF_DIR}/metis_ifu_postprocess.sof" | |
# CAL RECIPES | |
pyesorex metis_cal_chophome "${SOF_DIR}/metis_cal_chophome.sof" | |
# PUPIL IMAGING | |
pyesorex metis_pupil_imaging "${SOF_DIR}/metis_pupil_imaging.lm.sof" | |
- name: Run EDPS | |
run: | | |
# . metispipe/bin/activate | |
export PYESOREX_PLUGIN_DIR="$(pwd)/metisp/pyrecipes/" | |
export PYCPL_RECIPE_DIR="$(pwd)/metisp/pyrecipes/" | |
export PYTHONPATH="$(pwd)/metisp/pymetis/src/" | |
export SOF_DATA="$(pwd)/METIS_Pipeline_Test_Data/small202402/outputSmall/" | |
export SOF_DIR="$(pwd)/METIS_Pipeline_Test_Data/small202402/sofFiles/" | |
edps -lw | |
edps -w metis.metis_wkf -i $SOF_DATA -c | |
edps -w metis.metis_wkf -i $SOF_DATA -lt | |
edps -w metis.metis_wkf -i $SOF_DATA -m all | tee edps.stdout.txt | |
! grep "'FAILED'" edps.stdout.txt |