Closed Bug 821425 Opened 12 years ago Closed 11 years ago

Remote CPP unit tests: pass environment variables

Categories

(Testing :: General, defect)

x86
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla20

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

Attachments

(1 file, 4 obsolete files)

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: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: