Skip to content

Make test script more portable and ignore output files #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test_files/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.nc
tests_output*
cfcache-files-py3/
14 changes: 9 additions & 5 deletions test_files/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
outdir=tests_output.$$
mkdir $outdir

std_name_table=http://cfconventions.org/Data/cf-standard-names/current/src/cf-standard-name-table.xml
area_table=http://cfconventions.org/Data/area-type-table/current/src/area-type-table.xml
# Pin the tables, as the tests fail if they differ.
# This can be unpinned in future MRs updating the tests.
std_name_table=https://cfconventions.org/Data/cf-standard-names/79/src/cf-standard-name-table.xml
area_table=https://cfconventions.org/Data/area-type-table/10/src/area-type-table.xml

cfchecker="cfchecks"

cfchecker=$(which cfchecks)

failed=0

echo "Unzipping input netcdf files..."
gzip -d *.gz

cache_opts="-x --cache_dir /home/ros/temp/cfcache-files-py3"
mkdir -p cfcache-files-py3
cache_opts="-x --cache_dir ./cfcache-files-py3"

for file in `ls *.nc`
do
Expand All @@ -37,7 +41,7 @@ do
$cfchecker $cache_opts -s $std_name_table -v 1.0 $file > $outdir/$file.out 2>&1
else
# Run checker using the CF version specified in the conventions attribute of the file
$cfchecker $cache_opts -s $std_name_table -v auto $file > $outdir/$file.out 2>&1
$cfchecker $cache_opts -s $std_name_table -a $area_table -v auto $file > $outdir/$file.out 2>&1
fi

# Check the output against what is expected
Expand Down