Allow karma browsers parameter to be set from bazel

When running karma tests through bazel, ChromeHeadless is the default
browser. Currently there is no option to change the browser without
editing polygerrit-ui/karma.conf.js. This change makes it easier for
CQ to use ChromiumHeadless.

Bug: 1196790
Change-Id: I4328120f33a630b33f9345ce908684fdbeef88c8
1 file changed
tree: 487eccce3fcc64e4234d56ec4c23d014e2cd493e
  1. src/
  2. web/
  3. .gitignore
  4. BUILD
  5. codereview.settings

LandingWidget Plugin for Gerrit


This plugin must be placed inside the Gerrit plugins directory:

git clone --recurse-submodules
cd gerrit/plugins
git clone

Web Plugin Development

For running unit tests execute:

bazel test --test_output=all //plugins/landingwidget/web:karma_test

For checking or fixing eslint formatter problems run:

bazel test //plugins/landingwidget/web:lint_test
bazel run //plugins/landingwidget/web:lint_bin -- --fix "$(pwd)/plugins/landingwidget/web"

For testing the plugin with Gerrit FE Dev Helper build the JavaScript bundle and copy it to the plugins/landingwidget folder:

bazel build //plugins/landingwidget/web:landingwidget
cp -f bazel-bin/plugins/landingwidget/web/landingwidget.js plugins/landingwidget

and let the Dev Helper redirect from .+/plugins/landingwidget/static/landingwidget.js to http://localhost:8081/plugins_/plugins/landingwidget.js.

Note for local testing: this plugin fetches from an external site which may be blocked by CORS policy.