1+ <?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="1" skipped="0" tests="1" time="305.727" timestamp="2025-02-18T15:51:33.945539+11:00" hostname="gadi-login-05.gadi.nci.org.au"><testcase classname="test-venv.lib.python3.10.site-packages.model_config_tests.test_bit_reproducibility.TestBitReproducibility" name="test_bit_repro_historical" time="304.842"><failure message="AssertionError: Checksums were not equal. The new checksums have been written to /scratch/tm70/repro-ci/experiments/access-om3-configs/9ebbf2e305e530004258a93e764dd55ea179265f/checksum/historical-3hr-checksum.json. assert {'output': {'...ion': '1-0-0'} == {'output': {'...ion': '1-0-0'} Omitting 1 identical items, use -vv to show Differing items: {'output': {'CFL': ['0.00000', '0.06867'], 'En': ['3.1034198253312566E-23', '5.2770203504346890E-04'], 'M': ['1.36404E+21', '1.36404E+21'], 'Me': ['0.00E+00', '2.55E-20'], ...}} != {'output': {'CFL': ['0.00000', '0.06876'], 'En': ['3.0906073728130855E-23', '5.1369904973574108E-04'], 'M': ['1.36404E+21', '1.36404E+21'], 'Me': ['0.00E+00', '-3.43E-10'], ...}} Use -v to get more diff">self = <model_config_tests.test_bit_reproducibility.TestBitReproducibility object at 0x7f35712dd270>
2+ output_path = PosixPath('/scratch/tm70/repro-ci/experiments/access-om3-configs/9ebbf2e305e530004258a93e764dd55ea179265f')
3+ control_path = PosixPath('/scratch/tm70/repro-ci/experiments/access-om3-configs/9ebbf2e305e530004258a93e764dd55ea179265f/base-experiment')
4+ checksum_path = PosixPath('/scratch/tm70/repro-ci/experiments/access-om3-configs/9ebbf2e305e530004258a93e764dd55ea179265f/compared/testing/checksum/historical-3hr-checksum.json')
5+ keep_archive = False
6+
7+ @pytest.mark.checksum
8+ def test_bit_repro_historical(
9+ self,
10+ output_path: Path,
11+ control_path: Path,
12+ checksum_path: Optional[Path],
13+ keep_archive: Optional[bool],
14+ ):
15+ """
16+ Test that a run reproduces historical checksums
17+
18+ Parameters (these are fixtures defined in conftest.py)
19+ ----------
20+ output_path: Path
21+ Output directory for test output and where the control and
22+ lab directories are stored for the payu experiments. Default is
23+ set in conftest.py
24+ control_path: Path
25+ Path to the model configuration to test. This is copied for
26+ for control directories in experiments. Default is set in
27+ conftests.py
28+ checksum_path: Optional[Path]
29+ Path to checksums to compare model output against. Default is
30+ set to checksums saved on model configuration (set in )
31+ keep_archive: Optional[bool]
32+ This flag is used in testing for test code to use a previous test
33+ archive, and to disable running the model with payu
34+ """
35+ # Setup checksum output directory
36+ checksum_output_dir = set_checksum_output_dir(output_path=output_path)
37+
38+ # Setup experiment
39+ exp = setup_exp(
40+ control_path, output_path, "test_bit_repro_historical", keep_archive
41+ )
42+
43+ # Set model runtime using the configured default
44+ exp.model.set_model_runtime()
45+
46+ # Run the experiment using payu
47+ status, stdout, stderr, output_files = exp.setup_and_run()
48+
49+ if status != 0 or not exp.model.output_exists():
50+ # Log the run information
51+ exp.print_run_logs(status, stdout, stderr, output_files)
52+
53+ assert status == 0, (
54+ "There was an error running the experiment. "
55+ "See the logs for more infomation on the experiment run"
56+ )
57+
58+ assert exp.model.output_exists(), (
59+ "Output file for the model does not exist. "
60+ "See the logs for more information on the experiment run"
61+ )
62+
63+ # Set the checksum output filename using the model default runtime
64+ runtime_hours = exp.model.default_runtime_seconds // HOUR_IN_SECONDS
65+ checksum_filename = f"historical-{runtime_hours}hr-checksum.json"
66+
67+ # Read the historical checksum file
68+ hist_checksums = read_historical_checksums(
69+ control_path, checksum_filename, checksum_path
70+ )
71+
72+ # Use historical file checksums schema version for parsing checksum,
73+ # otherwise use the model default, if file does not exist
74+ schema_version = (
75+ hist_checksums["schema_version"]
76+ if hist_checksums
77+ else exp.model.default_schema_version
78+ )
79+
80+ # Extract checksums
81+ checksums = exp.extract_checksums(schema_version=schema_version)
82+
83+ # Write out checksums to output file
84+ checksum_output_file = checksum_output_dir / checksum_filename
85+ with open(checksum_output_file, "w") as file:
86+ json.dump(checksums, file, indent=2)
87+
88+ > assert (
89+ hist_checksums == checksums
90+ ), f"Checksums were not equal. The new checksums have been written to {checksum_output_file}."
91+ E AssertionError: Checksums were not equal. The new checksums have been written to /scratch/tm70/repro-ci/experiments/access-om3-configs/9ebbf2e305e530004258a93e764dd55ea179265f/checksum/historical-3hr-checksum.json.
92+ E assert {'output': {'...ion': '1-0-0'} == {'output': {'...ion': '1-0-0'}
93+ E
94+ E Omitting 1 identical items, use -vv to show
95+ E Differing items:
96+ E {'output': {'CFL': ['0.00000', '0.06867'], 'En': ['3.1034198253312566E-23', '5.2770203504346890E-04'], 'M': ['1.36404E+21', '1.36404E+21'], 'Me': ['0.00E+00', '2.55E-20'], ...}} != {'output': {'CFL': ['0.00000', '0.06876'], 'En': ['3.0906073728130855E-23', '5.1369904973574108E-04'], 'M': ['1.36404E+21', '1.36404E+21'], 'Me': ['0.00E+00', '-3.43E-10'], ...}}
97+ E Use -v to get more diff
98+
99+ ../test-venv/lib/python3.10/site-packages/model_config_tests/test_bit_reproducibility.py:131: AssertionError</failure ></testcase ></testsuite ></testsuites >
0 commit comments