Merge branch 'stable-2.15' into stable-2.16

* stable-2.15:
  run_test.sh: Fix bazelisk location detection
  Bazel: Adapt docs for custom plugins with external deps
  PolyGerrit: Run WCT tests using bazelisk

Change-Id: I9c98b28cc467ea805b677808e40393ffb4572c1a
This commit is contained in:
David Pursehouse
2019-09-02 09:47:12 +09:00
2 changed files with 22 additions and 7 deletions

View File

@@ -122,16 +122,25 @@ CUSTOM_PLUGINS_TEST_DEPS = [
----
If the plugin(s) being bundled in the release have external dependencies, include them
in `plugins/external_plugin_deps`. You should alias `external_plugin_deps()` so it
can be imported for multiple plugins. For example:
in `plugins/external_plugin_deps`. Create symbolic link from plugin's own
`external_plugin_deps()` file in plugins directory and prefix the file with
plugin name, e.g.:
----
load(":my-plugin/external_plugin_deps.bzl", my_plugin="external_plugin_deps")
load(":my-other-plugin/external_plugin_deps.bzl", my_other_plugin="external_plugin_deps")
$ cd plugins
$ ln -s oauth/external_plugin_deps.bzl oauth_external_plugin_deps.bzl
$ ln -s uploadvalidator/external_plugin_deps.bzl uploadvalidator_external_plugin_deps.bzl
----
Now the plugin specific dependency files can be imported:
----
load(":oauth_external_plugin_deps.bzl", oauth_deps="external_plugin_deps")
load(":uploadvalidator_external_plugin_deps.bzl", uploadvalidator_deps="external_plugin_deps")
def external_plugin_deps():
my_plugin()
my_other_plugin()
oauth_deps()
uploadvalidator_deps()
----
[NOTE]

View File

@@ -12,9 +12,15 @@ if [[ -z "$wct_bin" ]]; then
exit 1
fi
bazel_bin=$(which bazelisk 2>/dev/null)
if [[ -z "$bazel_bin" ]]; then
echo "Warning: bazelisk is not installed; falling back to bazel."
bazel_bin=bazel
fi
# WCT tests are not hermetic, and need extra environment variables.
# TODO(hanwen): does $DISPLAY even work on OSX?
bazel test \
${bazel_bin} test \
--test_env="HOME=$HOME" \
--test_env="WCT=${wct_bin}" \
--test_env="WCT_ARGS=${WCT_ARGS}" \