MAINT: Align fmu init with fmu-settings init behavior#109
MAINT: Align fmu init with fmu-settings init behavior#109GibranAlfa merged 2 commits intoequinor:mainfrom
fmu init with fmu-settings init behavior#109Conversation
| target_fmu_dir = get_fmu_directory(self.target) | ||
| except FileNotFoundError: | ||
| target_fmu_dir = init_fmu_directory(self.target) | ||
| target_fmu_dir = init_fmu_directory(self.target, force=True) |
There was a problem hiding this comment.
skip project-root validation here because copy targets are not necessarily FMU project roots. we still create a target .fmu so we can log the copy in its changelog.
| show_default=False, | ||
| ), | ||
| ] = False, | ||
| skip_config_import: Annotated[ |
There was a problem hiding this comment.
--skip-config-import option is removed to align the behavior to fmu-settings init behavior that auto import global config. i don't see any use case where the user need to skip config import, if there is a use case for that, then fmu-settings init has to be updated to support skip config import
| error( | ||
| "Unable to create .fmu directory.", | ||
| reason=str(e), | ||
| ) |
There was a problem hiding this comment.
no suggestion added here because the error message is already clear:
"Failed initializing .fmu directory. Initialize it from a project "
f"root containing {required_dirs}. Did not find: "
f"{missing_dirs_text}."| assert "Success: All done!" in stdout | ||
| assert "Info: Project stratigraphy was not imported by 'fmu init'." in stdout | ||
| assert "Open 'fmu settings' to import stratigraphy from RMS" in stdout | ||
| assert _find_global_config_source(tmp_path) == ( |
There was a problem hiding this comment.
assert the discovered config source directly instead of relying on the rendered CLI output, which can wrap long absolute paths and make the string assertion flaky.
| assert "Success: All done!" in stdout | ||
|
|
||
|
|
||
| def test_init_skips_adding_global_variables_with_masterdata( |
There was a problem hiding this comment.
removed test with skip config import option
| assert "Success: All done!" in result.stdout | ||
|
|
||
|
|
||
| def test_init_skips_raising_when_import_drogon_masterdata_with_skip( |
3a566fe to
e5d7d23
Compare
e5d7d23 to
a2c56f6
Compare
Resolves #106
Aligned
fmu initwithfmu-settingsinit behaviorChecklist
--cov=src/ --cov-report term-missing)