From 2a1579c0008259085216faf6b2655632ed1840f5 Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Thu, 20 Jan 2022 06:49:55 -0700 Subject: [PATCH] Per #1546, changed script to run unit tests and comparison, writing to log files --- .github/jobs/run_unit_tests.sh | 49 +++++++++------------------------- 1 file changed, 13 insertions(+), 36 deletions(-) mode change 100644 => 100755 .github/jobs/run_unit_tests.sh diff --git a/.github/jobs/run_unit_tests.sh b/.github/jobs/run_unit_tests.sh old mode 100644 new mode 100755 index 1f2d50bb47..008615f53a --- a/.github/jobs/run_unit_tests.sh +++ b/.github/jobs/run_unit_tests.sh @@ -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