-
Notifications
You must be signed in to change notification settings - Fork 786
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
Local run data dir #997
Local run data dir #997
Conversation
EnvironmentConfig needs to handle environment variables and '~' in its `data_dir` property. Other components that consume `data_dir` need environment variables and '~' resolved to an absolute path. Add a property called `data_dir_abs_path` that calculates the absolute path from `data_dir`. Since `data_dir` remains unchanged, the EnvironmentConfig can be saved to file without modifying the `data_dir` option in the file.
22f9ca9
to
3d3ac1b
Compare
3d3ac1b
to
b7df168
Compare
Codecov Report
@@ Coverage Diff @@
## appimage #997 +/- ##
============================================
+ Coverage 19.10% 19.42% +0.31%
============================================
Files 337 338 +1
Lines 11487 11519 +32
============================================
+ Hits 2195 2237 +42
+ Misses 9292 9282 -10
Continue to review full report at Codecov.
|
DeepCode failed to analyze this pull requestSomething went wrong despite trying multiple times, sorry about that. |
def set_home_env(monkeypatch, tmpdir): | ||
monkeypatch.setenv("HOME", str(tmpdir)) | ||
|
||
|
||
def test_data_dir_abs_path_from_file(monkeypatch, tmpdir): | ||
set_home_env(monkeypatch, tmpdir) |
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.
Why not make set_home_env
a fixture?
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.
In this case, both set_home_env()
and the test need to use the same tmpdir
. Passing a tmpdir to a function that sets an environment variable, to me, seems easier to understand than a fixture that relies on another fixture and returns a directory. Since it's only used in one test that's 3 lines long, it probably doesn't matter much one way or the other, but it's something to revisit if this test suite is expanded.
What does this PR do?
Uses the runtime-configurable
data_dir
to store the monkey agent executable when the monkey is run from the island.PR Checklist
Testing Checklist