Addition of coverage
tool to unit tests in workflow
#89
Workflow file for this run
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: "Translate test (subset)" | |
on: | |
push: | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] | |
jobs: | |
all: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: [3.8.12, 3.11.7] | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
with: | |
submodules: 'recursive' | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install OpenMPI & Boost for gt4py | |
run: | | |
sudo apt-get install libopenmpi-dev libboost1.74-dev | |
- name: Install Python packages | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install .[ndsl,test] | |
- name: Prepare test_data | |
run: | | |
mkdir -p test_data | |
- name: Numpy FvTp2d | |
run: | | |
cd test_data | |
wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.FvTp2d.tar.gz | |
tar -xzvf 8.1.3_c12_6ranks_standard.FvTp2d.tar.gz | |
cd - | |
coverage run --rcfile=setup.cfg -m pytest \ | |
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ | |
--backend=numpy \ | |
--which_modules=FvTp2d \ | |
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | |
./tests/savepoint | |
- name: Numpy D_SW | |
run: | | |
cd test_data | |
wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.D_SW.tar.gz | |
tar -xzvf 8.1.3_c12_6ranks_standard.D_SW.tar.gz | |
cd - | |
coverage run --rcfile=setup.cfg -m pytest \ | |
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ | |
--backend=numpy \ | |
--which_modules=D_SW \ | |
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | |
./tests/savepoint | |
- name: Numpy Remapping | |
run: | | |
cd test_data | |
wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.Remapping.tar.gz | |
tar -xzvf 8.1.3_c12_6ranks_standard.Remapping.tar.gz | |
cd - | |
coverage run --rcfile=setup.cfg -m pytest \ | |
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ | |
--backend=numpy \ | |
--which_modules=Remapping \ | |
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | |
./tests/savepoint | |
- name: Orchestrated dace:cpu Acoustics | |
run: | | |
cd test_data | |
wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.DynCore.tar.gz | |
tar -xzvf 8.1.3_c12_6ranks_standard.DynCore.tar.gz | |
cd - | |
export FV3_DACEMODE=BuildAndRun | |
export PACE_FLOAT_PRECISION=64 | |
export PACE_TEST_N_THRESHOLD_SAMPLES=0 | |
export OMP_NUM_THREADS=1 | |
export PACE_LOGLEVEL=Debug | |
mpirun -mca orte_abort_on_non_zero_status 1 -np 6 --oversubscribe coverage run --rcfile=setup.cfg -m mpi4py -m pytest \ | |
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ | |
--backend=dace:cpu \ | |
-m parallel \ | |
--which_rank=0 \ | |
--which_modules=DynCore \ | |
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | |
./tests/savepoint | |
- name: Orchestrated dace:cpu FvTp2d | |
run: | | |
rm -rf .gt_cache_FV3_A | |
export FV3_DACEMODE=BuildAndRun | |
export PACE_FLOAT_PRECISION=64 | |
export PACE_TEST_N_THRESHOLD_SAMPLES=0 | |
export OMP_NUM_THREADS=1 | |
export PACE_LOGLEVEL=Debug | |
coverage run --rcfile=setup.cfg -m pytest \ | |
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ | |
--backend=dace:cpu \ | |
--which_rank=0 \ | |
--which_modules=FvTp2d \ | |
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | |
./tests/savepoint | |
- name: Orchestrated dace:cpu D_SW | |
run: | | |
rm -rf .gt_cache_FV3_A | |
export FV3_DACEMODE=BuildAndRun | |
export PACE_FLOAT_PRECISION=64 | |
export PACE_TEST_N_THRESHOLD_SAMPLES=0 | |
export OMP_NUM_THREADS=1 | |
export PACE_LOGLEVEL=Debug | |
coverage run --rcfile=setup.cfg -m pytest \ | |
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ | |
--backend=dace:cpu \ | |
--which_rank=0 \ | |
--which_modules=D_SW \ | |
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | |
./tests/savepoint | |
- name: Orchestrated dace:cpu Remapping | |
run: | | |
rm -rf .gt_cache_FV3_A | |
export FV3_DACEMODE=BuildAndRun | |
export PACE_FLOAT_PRECISION=64 | |
export PACE_TEST_N_THRESHOLD_SAMPLES=0 | |
export OMP_NUM_THREADS=1 | |
export PACE_LOGLEVEL=Debug | |
coverage run --rcfile=setup.cfg -m pytest \ | |
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \ | |
--backend=dace:cpu \ | |
--which_rank=0 \ | |
--which_modules=Remapping \ | |
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \ | |
./tests/savepoint | |
- name: Output code coverage | |
run: | | |
coverage combine | |
coverage report |