From f08a52f8965ec28a61a046c1b0b0be4b8dc629fd Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Thu, 2 May 2024 15:52:26 +0000 Subject: [PATCH] update scripts to call python unit test script instead of the old perl script --- .github/jobs/run_unit_tests.sh | 2 +- internal/test_unit/bin/unit_test.sh | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/jobs/run_unit_tests.sh b/.github/jobs/run_unit_tests.sh index e866b2cc61..b85bac84fe 100755 --- a/.github/jobs/run_unit_tests.sh +++ b/.github/jobs/run_unit_tests.sh @@ -15,7 +15,7 @@ source ${MET_REPO_DIR}/.github/jobs/test_env_vars.sh echo "Running MET unit tests..." for testname in $TESTS_TO_RUN; do CMD_LOGFILE=/met/logs/unit_${testname}.log - time_command ${MET_TEST_BASE}/perl/unit.pl ${MET_TEST_BASE}/xml/unit_${testname}.xml + time_command ${MET_TEST_BASE}/python/unit.py ${MET_TEST_BASE}/xml/unit_${testname}.xml if [ $? != 0 ]; then echo "ERROR: Unit test ${testname} failed" cat /met/logs/unit_${testname}.log diff --git a/internal/test_unit/bin/unit_test.sh b/internal/test_unit/bin/unit_test.sh index 0f0493720f..0e2579464d 100755 --- a/internal/test_unit/bin/unit_test.sh +++ b/internal/test_unit/bin/unit_test.sh @@ -24,14 +24,14 @@ if [[ -z "${MET_TEST_MET_PYTHON_EXE}" ]] ; then export MET_TEST_MET_PYTHON_EXE=/usr/local/python3/bin/python3 fi -PERL_UNIT_OPTS="" +UNIT_OPTS="" for arg in $@; do - [ $arg == "-memchk" -o $arg == "memchk" ] && PERL_UNIT_OPTS="$PERL_UNIT_OPTS -memchk" - [ $arg == "-callchk" -o $arg == "callchk" ] && PERL_UNIT_OPTS="$PERL_UNIT_OPTS -callchk" + [ $arg == "-memchk" -o $arg == "memchk" ] && UNIT_OPTS="$UNIT_OPTS -memchk" + [ $arg == "-callchk" -o $arg == "callchk" ] && UNIT_OPTS="$UNIT_OPTS -callchk" done # Unit test script -PERL_UNIT=${MET_TEST_BASE}/perl/unit.pl +UNIT=${MET_TEST_BASE}/python/unit.py # Unit test XML UNIT_XML="unit_ascii2nc.xml \ @@ -107,15 +107,15 @@ UNIT_XML="${UNIT_XML} unit_ugrid.xml" for CUR_XML in ${UNIT_XML}; do echo - echo "CALLING: ${PERL_UNIT} $PERL_UNIT_OPTS ${MET_TEST_BASE}/xml/${CUR_XML}" + echo "CALLING: ${UNIT} $UNIT_OPTS ${MET_TEST_BASE}/xml/${CUR_XML}" echo - ${PERL_UNIT} $PERL_UNIT_OPTS ${MET_TEST_BASE}/xml/${CUR_XML} + ${UNIT} $UNIT_OPTS ${MET_TEST_BASE}/xml/${CUR_XML} RET_VAL=$? # Fail on non-zero return status if [ ${RET_VAL} != 0 ]; then echo - echo "ERROR: ${PERL_UNIT} ${CUR_XML} failed." + echo "ERROR: ${UNIT} ${CUR_XML} failed." echo echo "*** UNIT TESTS FAILED ***" echo