-
Notifications
You must be signed in to change notification settings - Fork 104
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
Make sure loading gui produces just one storage folder #4053
Conversation
@@ -239,8 +239,7 @@ model_config_type *model_config_alloc_empty() { | |||
model_config->num_realizations = 0; | |||
model_config->obs_config_file = NULL; | |||
|
|||
model_config_set_enspath(model_config, | |||
fs::absolute(DEFAULT_ENSPATH).c_str()); | |||
model_config_set_enspath(model_config, DEFAULT_ENSPATH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably cause the test test_default_model_config_ens_path
to fail.
So as a quick fix I would suggest also replacing
if (config_content_has_item(config, ENSPATH_KEY))
model_config_set_enspath(
model_config,
config_content_get_value_as_abspath(config, ENSPATH_KEY));
with
if (config_content_has_item(config, ENSPATH_KEY))
model_config_set_enspath(
model_config,
config_content_get_value_as_abspath(config, ENSPATH_KEY));
else
model_config_set_enspath(
model_config,
config_content_get_value_as_abspath(config, DEFAULT_ENSPATH));
I know this makes model_config_set_enspath(model_config, DEFAULT_ENSPATH);
on ln 242 (what a nice palindromic number) a bit useless but it might be ok to just remove that line altogether
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace fs = std::filesystem;
can be removed also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we instead fix the test to assert that assert default_ens_path == set_in_file_ens_path
but where we add res_config.config_path
to default_ens_path
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure the test needs a fix. Are you suggesting fixing getEnspath
from ModelConfig
to make sure it contains res_config.config_path
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed ⬆️ replaced config_content_get_value_as_abspath(config, DEFAULT_RUNPATH));
with config_content_get_value_as_abspath(config, DEFAULT_ENSPATH));
b9f264f
to
60055bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Here we remove the unwanted change but keep test introduced in equinor#3982. Replace tmpdir with tmp_path in test_gui_load.py Do not mock resconfig and enkfmain to get more realistic tests Co-authored-by: Dan Sava <dan.sava42@gmail.com> Co-authored-by: Frode Aarstad <frodeaarstad@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #4053 +/- ##
==========================================
+ Coverage 57.71% 57.87% +0.16%
==========================================
Files 523 523
Lines 39525 39526 +1
Branches 3592 3591 -1
==========================================
+ Hits 22811 22876 +65
+ Misses 15782 15720 -62
+ Partials 932 930 -2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Issue
Resolves #4054
Pre review checklist
Adding labels helps the maintainers when writing release notes. This is the list of release note labels.