Skip to content

Commit

Permalink
Run test utils on Compy for v2.5.0rc2 (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
forsyth2 authored Apr 25, 2024
1 parent aa1f20a commit 3986849
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 43 deletions.
46 changes: 9 additions & 37 deletions tests/integration/generated/directions_compy.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,32 +86,17 @@ cp /compyfs/www/zppy_test_resources/expected_complete_run expected_complete_run_
### test_bash_generation

```
rm -rf /compyfs/www/zppy_test_resources/expected_bash_files
cd <top level of zppy repo>
# Your output will now become the new expectation.
# You can just move (i.e., not copy) the output since re-running this test will re-generate the output.
mv test_bash_generation_output/post/scripts /compyfs/www/zppy_test_resources/expected_bash_files
# Rerun test
python -u -m unittest tests/integration/test_bash_generation.py
chmod u+x tests/integration/generated/update_bash_generation_expected_files_compy.sh
./tests/integration/generated/update_bash_generation_expected_files_compy.sh
```

### test_bundles

```
rm -rf /compyfs/www/zppy_test_resources/expected_bundles
# Your output will now become the new expectation.
# Copy output so you don't have to rerun zppy to generate the output.
cp -r /compyfs/www/fors729/zppy_test_bundles_www/<UNIQUE ID>/v2.LR.historical_0201 /compyfs/www/zppy_test_resources/expected_bundles
mkdir -p /compyfs/www/zppy_test_resources/expected_bundles/bundle_files
cp -r /compyfs/fors729/zppy_test_bundles_output/<UNIQUE ID>/v2.LR.historical_0201/post/scripts/bundle*.bash /compyfs/www/zppy_test_resources/expected_bundles/bundle_files
cd /compyfs/www/zppy_test_resources/expected_bundles
# Remove the image check failures, so they don't end up in the expected files.
rm -rf image_check_failures
# This file will list all the expected images.
find . -type f -name '*.png' > ../image_list_expected_bundles.txt
cd <top level of zppy repo>
# Rerun test
python -u -m unittest tests/integration/test_bundles.py
chmod u+x tests/integration/generated/update_bundles_expected_files_compy.sh
./tests/integration/generated/update_bundles_expected_files_compy.sh
```

### test_campaign
Expand All @@ -132,30 +117,17 @@ mv test_campaign_high_res_v1_output/post/scripts/*.settings /compyfs/www/zppy_te
### test_complete_run

```
rm -rf /compyfs/www/zppy_test_resources/expected_complete_run
# Your output will now become the new expectation.
# Copy output so you don't have to rerun zppy to generate the output.
cp -r /compyfs/www/fors729/zppy_test_complete_run_www/<UNIQUE ID>/v2.LR.historical_0201 /compyfs/www/zppy_test_resources/expected_complete_run
cd /compyfs/www/zppy_test_resources/expected_complete_run
# Remove the image check failures, so they don't end up in the expected files.
rm -rf image_check_failures
# This file will list all the expected images.
find . -type f -name '*.png' > ../image_list_expected_complete_run.txt
cd <top level of zppy repo>
# Rerun test
python -u -m unittest tests/integration/test_complete_run.py
chmod u+x tests/integration/generated/update_complete_run_expected_files_compy.sh
./tests/integration/generated/update_complete_run_expected_files_compy.sh
```

### test_defaults

```
rm -rf /compyfs/www/zppy_test_resources/test_defaults_expected_files
mkdir -p /compyfs/www/zppy_test_resources/test_defaults_expected_files
# Your output will now become the new expectation.
# You can just move (i.e., not copy) the output since re-running this test will re-generate the output.
mv test_defaults_output/post/scripts/*.settings /compyfs/www/zppy_test_resources/test_defaults_expected_files
# Rerun test
python -u -m unittest tests/integration/test_defaults.py
cd <top level of zppy repo>
chmod u+x tests/integration/generated/update_defaults_expected_files_compy.sh
./tests/integration/generated/update_defaults_expected_files_compy.sh
```

## Commands to generate official expected results for a release
Expand Down
11 changes: 7 additions & 4 deletions tests/integration/generated/test_complete_run_compy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ years = "1850:1854:2",
vars = "LAISHA,LAISUN"
ts_fmt = "cmip"

[[ land_monthly_glb ]]
[[ lnd_monthly_glb ]]
frequency = "monthly"
input_files = "eam.h0"
input_subdir = "archive/atm/hist"
input_files = "elm.h0"
input_subdir = "archive/lnd/hist"
mapping_file = "glb"
vars = "LAISHA,LAISUN"
years = "1850:1860:5",

[[ rof_monthly ]]
extra_vars = 'areatotal2'
Expand Down Expand Up @@ -179,14 +181,15 @@ climo_years ="1850-1854", "1855-1860",
experiment_name = "v2.LR.historical_0201"
figstr = "v2_historical_0201"
moc_file=mocTimeSeries_1850-1860.nc
plots_lnd = "LAISHA,LAISUN"
ts_num_years = 5
ts_years = "1850-1854", "1850-1860",
walltime = "00:30:00"
years = "1850-1860",

[ilamb]
active = True
grids = '180x360_aave'
grid = '180x360_aave'
nodes = 8
partition = "slurm"
short_name = 'v2.LR.historical_0201'
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/generated/test_debug_compy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ years = "1850:1854:2",

[ilamb]
active = True
grids = '180x360_aave'
grid = '180x360_aave'
nodes = 8
partition = "slurm"
short_name = 'v2.LR.historical_0201'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Run this script to update expected files for test_bash_generation.py
# Run from the top level of the zppy repo
# Run as `./tests/integration/generated/update_bash_generation_expected_files.sh`

rm -rf /compyfs/www/zppy_test_resources/expected_bash_files
# Your output will now become the new expectation.
# You can just move (i.e., not copy) the output since re-running this test will re-generate the output.
mv test_bash_generation_output/post/scripts /compyfs/www/zppy_test_resources/expected_bash_files
# Rerun test
python -u -m unittest tests/integration/test_bash_generation.py
20 changes: 20 additions & 0 deletions tests/integration/generated/update_bundles_expected_files_compy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Run this script to update expected files for test_bundles.py
# Run from the top level of the zppy repo
# Run as `./tests/integration/generated/update_bundles_expected_files.sh`

# Remove old expected files.
rm -rf /compyfs/www/zppy_test_resources/expected_bundles
# Your output will now become the new expectation.
# Copy output so you don't have to rerun zppy to generate the output.
cp -r /compyfs/www/fors729/zppy_test_bundles_www/unique_id/v2.LR.historical_0201 /compyfs/www/zppy_test_resources/expected_bundles
mkdir -p /compyfs/www/zppy_test_resources/expected_bundles/bundle_files
cp -r /compyfs/fors729/zppy_test_bundles_output/unique_id/v2.LR.historical_0201/post/scripts/bundle*.bash /compyfs/www/zppy_test_resources/expected_bundles/bundle_files
zppy_top_level=$(pwd)
cd /compyfs/www/zppy_test_resources/expected_bundles
# Remove the image check failures, so they don't end up in the expected files.
rm -rf image_check_failures
# This file will list all the expected images.
find . -type f -name '*.png' > ../image_list_expected_bundles.txt
cd ${zppy_top_level}
# Rerun test
python -u -m unittest tests/integration/test_bundles.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Run this script to update expected files for test_campaign.py
# Run from the top level of the zppy repo
# Run as `./tests/integration/update_campaign_expected_files.sh`
# Run as `./tests/integration/generated/update_campaign_expected_files.sh`

for campaign in "cryosphere" "cryosphere_override" "high_res_v1" "none" "water_cycle" "water_cycle_override"
do
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Run this script to update expected files for test_complete_run.py
# Run from the top level of the zppy repo
# Run as `./tests/integration/generated/update_complete_run_expected_files.sh`

# Remove old expected files.
rm -rf /compyfs/www/zppy_test_resources/expected_complete_run
# Your output will now become the new expectation.
# Copy output so you don't have to rerun zppy to generate the output.
cp -r /compyfs/www/fors729/zppy_test_complete_run_www/unique_id/v2.LR.historical_0201 /compyfs/www/zppy_test_resources/expected_complete_run
zppy_top_level=$(pwd)
cd /compyfs/www/zppy_test_resources/expected_complete_run
# Remove the image check failures, so they don't end up in the expected files.
rm -rf image_check_failures
# This file will list all the expected images.
find . -type f -name '*.png' > ../image_list_expected_complete_run.txt
cd ${zppy_top_level}
# Rerun test
python -u -m unittest tests/integration/test_complete_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Run this script to update expected files for test_defaults.py
# Run from the top level of the zppy repo
# Run as `./tests/integration/generated/update_defaults_expected_files.sh`

rm -rf /compyfs/www/zppy_test_resources/test_defaults_expected_files
mkdir -p /compyfs/www/zppy_test_resources/test_defaults_expected_files
# Your output will now become the new expectation.
# You can just move (i.e., not copy) the output since re-running this test will re-generate the output.
mv test_defaults_output/post/scripts/*.settings /compyfs/www/zppy_test_resources/test_defaults_expected_files
# Rerun test
python -u -m unittest tests/integration/test_defaults.py

0 comments on commit 3986849

Please sign in to comment.