Skip to content

Commit

Permalink
Per #1546, changed script to run unit tests and comparison, writing t…
Browse files Browse the repository at this point in the history
…o log files
  • Loading branch information
georgemccabe committed Jan 20, 2022
1 parent f9b2a19 commit 2a1579c
Showing 1 changed file with 13 additions and 36 deletions.
49 changes: 13 additions & 36 deletions .github/jobs/run_unit_tests.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,53 +1,30 @@
#! /bin/bash

######################################################################
# Install tools needed to run MET unit tests in Docker
######################################################################

###
# Install Perl XML Parser
###
yum makecache
yum -y install perl-XML-Parser


###
# Install R
###
#yum -y install epel-release # already installed in MET Docker image
yum -y install R


###
# Install R NetCDF4 library (1.19)
###
yum -y install netcdf-devel.x86_64

# download tarfile into home directory
cd
wget https://cran.r-project.org/src/contrib/ncdf4_1.19.tar.gz
R CMD INSTALL ncdf4_1.19.tar.gz


###
# Install NCO to get ncdiff
###
yum -y install nco


###
# Set environment variables needed to run unit tests
###

export MET_BASE=/usr/local/share/met

export MET_REPO_DIR=/met/MET-${MET_GIT_NAME}
export MET_BUILD_BASE=${MET_REPO_DIR}/met
export MET_TEST_BASE=${MET_REPO_DIR}/test
export PERL5LIB=${MET_TEST_BASE}/lib

export MET_TEST_INPUT=/data/input/MET_test_data/unit_test
export MET_TEST_OUTPUT=/data/output/met_test_output
export MET_TEST_TRUTH=/data/output/met_test_truth

export MET_TEST_RSCRIPT=/usr/bin/Rscript
export MET_TEST_MET_PYTHON_EXE=/usr/bin/python3

###
# Run MET unit tests
###

echo "Running all MET unit tests..."
echo "Writing logs to /met/unit_test.log"
${MET_TEST_BASE}/bin/unit_test.sh > /met/unit_test.log

echo "Running comparison"
echo "Writing logs to /met/comp_dir.log"
${MET_TEST_BASE}/bin/comp_dir.sh ${MET_TEST_TRUTH} ${MET_TEST_OUTPUT} > /met/comp_dir.log

0 comments on commit 2a1579c

Please sign in to comment.