Files
gerrit/polygerrit-ui/app/run_test.sh
Dmitrii Filippov acd39a2d9d Add karma-runner and convert some tests to run with karma
The following changes are included in this change:
* karma-runner is added to the polygerrit-ui/package.json file
* bazel rule for karma tests is added to the polygerrit-ui/BUILD file
* The run_test.sh script is updated - it runs both deprecated
  web-component-tester(WCT) tests and karma tests
* Commands to run separately karma and wct tests are added to the top
  level package.json file
* The common-test-setup-karma.js file adds global functions to replace
  functionality provided by the WCT
* The postinstall step is added to the polygerrit-ui/package.json file
  to run 'selenium-standalone install' command.
  Note, that this is not a new command - it runs during the WCT
  install (see wct-local/scripts/postinstall.js), but sometimes it
  fails after switching between different branches. Calling it in the
  postinstall step of polygerrit-ui/package.json improves the
  situation.

Change-Id: Iaf480d22c5553d98eb7607a0e83a86b66f733caa
2020-05-06 15:27:48 +02:00

19 lines
579 B
Bash
Executable File

#!/usr/bin/env bash
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_bin} test \
--test_env="HOME=$HOME" \
--test_env="WCT_ARGS=${WCT_ARGS}" \
--test_env="DISPLAY=${DISPLAY}" \
--test_env="WCT_HEADLESS_MODE=${WCT_HEADLESS_MODE}" \
"$@" \
//polygerrit-ui/app:wct_test \
//polygerrit-ui:karma_test