-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
add setting --tmp arg as process.env.APPIUM_TMP_DIR #12585
add setting --tmp arg as process.env.APPIUM_TMP_DIR #12585
Conversation
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.
Is the value of tmpDir
ever checked for validity?
Yes, https://github.com/appium/appium/blob/master/lib/config.js#L217-L224 creates the path before the |
|
lib/appium.js
Outdated
@@ -158,6 +158,13 @@ const pendingDriversGuard = new AsyncLock(); | |||
|
|||
class AppiumDriver extends BaseDriver { | |||
constructor (args) { | |||
// It is necessary to set `--tmp` here since it should set to |
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.
since it should be set
lib/appium.js
Outdated
@@ -158,6 +158,13 @@ const pendingDriversGuard = new AsyncLock(); | |||
|
|||
class AppiumDriver extends BaseDriver { | |||
constructor (args) { | |||
// It is necessary to set `--tmp` here since it should set to | |||
// process.env.APPIUM_TMP_DIR once at initial time in Appium lifecycle. |
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.
at an initial point in the Appium lifecycle
lib/appium.js
Outdated
@@ -158,6 +158,13 @@ const pendingDriversGuard = new AsyncLock(); | |||
|
|||
class AppiumDriver extends BaseDriver { | |||
constructor (args) { | |||
// It is necessary to set `--tmp` here since it should set to | |||
// process.env.APPIUM_TMP_DIR once at initial time in Appium lifecycle. | |||
// The process argument will be referred by BaseDriver. |
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.
will be referenced by BaseDriver
Proposed changes
related to appium/appium-support#112 and #12527
process.env.APPIUM_TMP_DIR
should be set once in Appium process.In BaseDriver,
this.opts.tmpDir
refersprocess.env.APPIUM_TMP_DIR
, and the assignment should happen before callingsuper
here.https://github.com/appium/appium-base-driver/blob/d214a0d1f2aa3aecd8fd4033460ce37176ca4c87/lib/basedriver/driver.js#L49
After this and appium/appium-support#112,
--tmp
flag will be respected in all of Appium modules which calltempDir
module.I've tested below patterns in ruby_lib_core test suite adding logs in
tempDir
module:The ruby_lib_core include screen recording, pull/push apks like appium/appium-android-driver#538
Then, I ensured Appium log had no
/var/folders/xxxx
. They called--tmp
arg.Types of changes
What types of changes does your code introduce to Appium?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...