Commit 8744a678 authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Add --isolated-outdir flag to test executable API.

This adds an optional --isolated=outdir=PATH flag to the
test executable API; this gives the test runners a stable path
to the output directory from a swarming task, so that we can key
other files off of it without needing to pass them all explicitly
via the command line.

This also adds the arg to the isolated_script wrapper, so that we
those types of tests can handle the flag (by ignoring it for now).

We may need to work through the other cases (like gtest tests)
individually, which will be done in subsequent CLs.

Bug: 816629
Change-Id: Ibff6a47544bf94af5d7693a8446dfb669351cc07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358604
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Reviewed-by: default avatarErik Staab <estaab@chromium.org>
Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799378}
parent 5ff55fe7
...@@ -101,6 +101,13 @@ To configure a new test, you need to modify one to three files: ...@@ -101,6 +101,13 @@ To configure a new test, you need to modify one to three files:
The executable must support the following command line arguments (aka flags): The executable must support the following command line arguments (aka flags):
```
--isolated-outdir=[PATH]
```
This argument is required, and should be set to the directory created
by the swarming task for the task to write outputs into.
``` ```
--isolated-script-test-output=[FILENAME] --isolated-script-test-output=[FILENAME]
``` ```
......
...@@ -208,9 +208,14 @@ class BaseIsolatedScriptArgsAdapter(object): ...@@ -208,9 +208,14 @@ class BaseIsolatedScriptArgsAdapter(object):
self._parser = argparse.ArgumentParser() self._parser = argparse.ArgumentParser()
self._options = None self._options = None
self._rest_args = None self._rest_args = None
self._parser.add_argument(
'--isolated-outdir', type=str,
required=False, # TODO(crbug.com/816629): Make this be required.
help='value of $ISOLATED_OUTDIR from swarming task')
self._parser.add_argument( self._parser.add_argument(
'--isolated-script-test-output', type=str, '--isolated-script-test-output', type=str,
required=True) required=True,
help='path to write test results JSON object to')
self._parser.add_argument( self._parser.add_argument(
'--isolated-script-test-filter', type=str, '--isolated-script-test-filter', type=str,
required=False) required=False)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment