You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the base CLI test it is not entirely clear what’s going on with the working directory. Since there is currently no way to set a working directory, Onigumo defaults to cwd.
It would be possible to set the working directory by File.cd and then use File.write! with a bare file name, removing the need for input_path_tmp = Path.join(tmp_dir, input_path_env). But it would separate the preparation of the environment from the actual run of Onigumo, using the working directory. It may be more correct to explicitly write the files to concrete paths and then run Onigumo with its own path handling rather than change the working directory and then make both Elixir and Onigumo use it.
Add comments describing what’s going on, that Onigumo uses the current working directory and why we’re doing the cd here.
Possible solution, changing the working directory first and then using it both by tests and then by Onigumo. Here, we assume the current working directory is the working directory and we operate in that directory even when preparing the test environment.
Another solution using comments, changing the working directly right before running onigumo, making explicitly clear what files are we writing where and only testing that Onigumo uses cwd.
# Prepare the test environment by creating a valid URLs file in the wokring directory.input_path_env=Application.get_env(:onigumo,:input_path)input_path_tmp=Path.join(tmp_dir,input_path_env)input_file_content=InputSupport.url_list(@urls)File.write!(input_path_tmp,input_file_content)# Onigumo uses cwd as its working directory, cd into that.File.cd(tmp_dir)Onigumo.CLI.main(["downloader"])
The text was updated successfully, but these errors were encountered:
In the base CLI test it is not entirely clear what’s going on with the working directory. Since there is currently no way to set a working directory, Onigumo defaults to cwd.
It would be possible to set the working directory by
File.cd
and then useFile.write!
with a bare file name, removing the need forinput_path_tmp = Path.join(tmp_dir, input_path_env)
. But it would separate the preparation of the environment from the actual run of Onigumo, using the working directory. It may be more correct to explicitly write the files to concrete paths and then run Onigumo with its own path handling rather than change the working directory and then make both Elixir and Onigumo use it.Add comments describing what’s going on, that Onigumo uses the current working directory and why we’re doing the cd here.
Possible solution, changing the working directory first and then using it both by tests and then by Onigumo. Here, we assume the current working directory is the working directory and we operate in that directory even when preparing the test environment.
Another solution using comments, changing the working directly right before running onigumo, making explicitly clear what files are we writing where and only testing that Onigumo uses cwd.
The text was updated successfully, but these errors were encountered: