Remote CPP unit tests: pass environment variables

RESOLVED FIXED in mozilla20

Status

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: gbrown, Assigned: gbrown)

Tracking

unspecified
mozilla20
x86
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 4 obsolete attachments)

It should be possible to modify the environment variables used when running remote cpp unit tests. Some defaults are set by remotecppunittests.py and cppunittests.py, but certain tests may require special modifications.
Depends on: 811411
This adds a --addEnv option to remotecppunittests.py. --addEnv takes a string argument that should be of the form "envvar=value". The option may be repeated.

This way you can do something like:

export EXTRA_TEST_ARGS="--addEnv myvar1=myval1 --addEnv myvar2=myval2"
make cppunittests-remote

Each specified environment variable is passed to the remote execution environment. A variable specified with --addEnv using the same variable name as a well-known variable (like TMPDIR) over-writes the well-known default. "--addEnv myvar=" (or "--addEnv myvar") is allowed so that well-known env variables defined by cppunittests.py or remotecppunittests.py may be cleared.
Assignee: nobody → gbrown
Attachment #692442 - Flags: review?(jmaher)
Comment on attachment 692442 [details] [diff] [review]
provide --addEnv option for remotecppunittests.py

Review of attachment 692442 [details] [diff] [review]:
-----------------------------------------------------------------

::: testing/remotecppunittests.py
@@ +165,5 @@
>          defaults["remoteTestRoot"] = "/data/local/tests"
>  
> +        self.add_option("--addEnv", action = "append",
> +                    type = "string", dest = "addEnv",
> +                    help = "additional remote environment variable definitions")

can you put an example of what this would look like?  --addEnv="myenvvar=true" or something like that.
Attachment #692442 - Flags: review?(jmaher) → review+
Added example to option help as per review comment. r=jmaher
Attachment #692442 - Attachment is obsolete: true
Attachment #693100 - Flags: review+
The patch here seems to be against a previous patch or script that contains a "remoteTestRoot" clause.  None of the patches that I can find in other bugs have that, so I had to massage this by hand to make it apply.
:dmose -- sorry about that! You need a patch queue like this:

bug 811411
bug 821033
bug 821590
bug 824274
bug 821425
bug 821424

...even so, this patch had bitrotted -- updated now.
Attachment #693100 - Attachment is obsolete: true
Attachment #695234 - Flags: review+
That fixed things up nicely; thanks!
Re-based for new patch on bug 811411.
Attachment #695042 - Attachment is obsolete: true
Attachment #695234 - Attachment is obsolete: true
Attachment #697464 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/05cfc19ac6e1
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.