你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-04 11:36:52 +08:00
Fix bug when restoring tests using ReceiverMixin
- 'output_file' is not stored in the run report by reframe. Therefore, trying to access 'test_dependency.output_file' where 'test_dependency' is a restored test case was returning None and causing an error. - Instead, created a new function to build an output file path that can be reused by the ReceiverMixin class.
这个提交包含在:
@@ -248,6 +248,20 @@ class GprMaxBaseTest(RunOnlyRegressionTest):
|
||||
# Set the matplotlib cache to the work filesystem
|
||||
self.env_vars["MPLCONFIGDIR"] = "${HOME/home/work}/.config/matplotlib"
|
||||
|
||||
def build_output_file_path(self, filename: str) -> Path:
|
||||
"""Build output file Path object from filename.
|
||||
|
||||
Using a function to build this allows mixins to reuse or
|
||||
override it if needed.
|
||||
|
||||
Args:
|
||||
filename: Name of output file with no file extension.
|
||||
|
||||
Returns:
|
||||
Path: Output file Path object
|
||||
"""
|
||||
return Path(f"{filename}.h5")
|
||||
|
||||
@run_after("init")
|
||||
def set_file_paths(self):
|
||||
"""Set default test input and output files.
|
||||
@@ -256,7 +270,7 @@ class GprMaxBaseTest(RunOnlyRegressionTest):
|
||||
later in the pipeline.
|
||||
"""
|
||||
self.input_file = Path(f"{self.model}.in")
|
||||
self.output_file = Path(f"{self.model}.h5")
|
||||
self.output_file = self.build_output_file_path(self.model)
|
||||
|
||||
@run_before("run")
|
||||
def configure_test_run(self):
|
||||
|
@@ -35,7 +35,8 @@ class ReceiverMixin(GprMaxMixin):
|
||||
def add_receiver_regression_checks(self):
|
||||
test_dependency = self.get_test_dependency()
|
||||
if test_dependency is not None:
|
||||
reference_file = self.build_reference_filepath(test_dependency.output_file)
|
||||
output_file = self.build_output_file_path(test_dependency.model)
|
||||
reference_file = self.build_reference_filepath(output_file)
|
||||
else:
|
||||
reference_file = self.build_reference_filepath(self.output_file)
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户