Skip to content
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

commented out inconsistent tests #176

Merged
merged 4 commits into from
Jul 11, 2024
Merged
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
22 changes: 11 additions & 11 deletions tests/run_wgrib2_rpn_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ echo "*** Takes relative humidity values, limits them to 100 and outputs to grib
touch rh.txt
diff -w rh.txt data/ref_rh.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt

#echo "*** Calculates wind speed for records 1-25, then returns the average, min, and max values"
#../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -for 1:25 -match ":(UGRD|VGRD):" \
# -if ":UGRD:" -rpn "sto_1" -fi \
# -if ":VGRD:" -rpn "sto_2" -fi \
# -if_reg 1:2 \
# -rpn "rcl_1:sq:rcl_2:sq:+:sqrt:clr_1:clr_2" \
# -set_var WIND \
# -grib_out tmp_windspeed.grb
echo "*** Calculates wind speed for records 1-25, then returns the average, min, and max values"
../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -for 1:25 -match ":(UGRD|VGRD):" \
-if ":UGRD:" -rpn "sto_1" -fi \
-if ":VGRD:" -rpn "sto_2" -fi \
-if_reg 1:2 \
-rpn "rcl_1:sq:rcl_2:sq:+:sqrt:clr_1:clr_2" \
-set_var WIND \
-grib_out tmp_windspeed.grb

# Check output
#../wgrib2/wgrib2 tmp_windspeed.grb -text tmp_windspeed.txt
../wgrib2/wgrib2 tmp_windspeed.grb -text tmp_windspeed.txt
#diff -w tmp_windspeed.txt data/ref_tmp_windspeed.txt

#../wgrib2/wgrib2 tmp_windspeed.grb -rpn print_min -rpn print_max -rpn print_ave > min_max_ave_windspeed.txt
#touch min_max_ave_windspeed.txt
../wgrib2/wgrib2 tmp_windspeed.grb -rpn print_min -rpn print_max -rpn print_ave > min_max_ave_windspeed.txt
touch min_max_ave_windspeed.txt
#diff -w min_max_ave_windspeed.txt data/ref_rpn.windspeed.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt

echo "*** SUCCESS!"
Expand Down
7 changes: 3 additions & 4 deletions tests/run_wgrib2_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ echo "*** Testing calculation of number of grid points"
../wgrib2/wgrib2 data/gdaswave.t00z.wcoast.0p16.f000.grib2 -npts > npts.txt
cat npts.txt


echo "*** Testing calculation of wind speed, direction, and UGRD & VGRD components"
../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -wind_dir wind.grb -wind_speed wind.grb -match "(UGRD|VGRD)"
../wgrib2/wgrib2 wind.grb > wind.txt
cat wind.txt
diff -w wind.txt data/ref_wind.gdas.t12z.pgrb2.1p00.anl.75r.grib2.inv
#diff -w wind.txt data/ref_wind.gdas.t12z.pgrb2.1p00.anl.75r.grib2.inv
../wgrib2/wgrib2 wind.grb -wind_uv uv.grb
../wgrib2/wgrib2 uv.grb > uv.txt
cat uv.txt
diff -w uv.txt data/ref_uv.gdas.t12z.pgrb2.1p00.anl.75r.grib2.inv
#diff -w uv.txt data/ref_uv.gdas.t12z.pgrb2.1p00.anl.75r.grib2.inv
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you just need to comment out the diff calls.

But first, try using cmp instead of diff to compare the files. I think that might work better.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched to diff so I can ignore white space in the file comparisons.

For these tests the outputs are truly different, but only sometimes. I can never seem to recreate the issue locally, it only occurs on the CI every few runs or so.


echo "*** Testing grid information"
../wgrib2/wgrib2 data/gdaswave.t00z.wcoast.0p16.f000.grib2 -grid > grid_test.txt
Expand Down Expand Up @@ -100,7 +99,7 @@ diff -w bin2grib.txt simple.txt
echo "*** Testing spread output"
../wgrib2/wgrib2 data/ref_simple_packing.grib2 -v2 -spread spread.txt
touch spread.txt
diff -w data/ref_simple_packing.grib2.spread.txt spread.txt
#diff -w data/ref_simple_packing.grib2.spread.txt spread.txt

echo "*** Testing write/read section"
../wgrib2/wgrib2 data/ref_simple_packing.grib2 -write_sec 0 sec0.dat -write_sec 1 sec1.dat \
Expand Down
Loading