mirror of https://github.com/apache/lucene.git
LUCENE-10528: use Xvfb in test to avoid messing up user's desktop (#828)
Co-authored-by: Tomoko Uchida <tomoko.uchida.1111@gmail.com>
This commit is contained in:
parent
35ca2d79f7
commit
1089b482fc
|
@ -128,6 +128,24 @@ specifying the project and test task or a fully qualified task path. Example:
|
|||
gradlew -p lucene/core test -Ptests.verbose=true --tests "TestDemo"
|
||||
|
||||
|
||||
Run GUI tests headlessly with Xvfb (Linux only)
|
||||
-----------------------------------------------
|
||||
|
||||
GUI test for Luke application launches a window, this might mess up your
|
||||
monitor depending on the display manager you are using. In that case,
|
||||
you can install Xvfb (X Virtual Frame Buffer) so that the test runs on the
|
||||
virtual display and does not open a real window.
|
||||
|
||||
# redhat-type OS
|
||||
$ sudo yum install Xvfb
|
||||
|
||||
# ubuntu/debian-type OS
|
||||
$ sudo apt install xvfb
|
||||
|
||||
# arch
|
||||
$ sudo pacman -S xorg-server-xvfb
|
||||
|
||||
|
||||
Profiling slow tests
|
||||
--------------------
|
||||
|
||||
|
|
|
@ -26,6 +26,11 @@ if [ -z "$LAUNCH_CMD" ]; then
|
|||
else
|
||||
# We are integration-testing. Force UTF-8 as the encoding.
|
||||
LAUNCH_OPTS=-Dfile.encoding=UTF-8
|
||||
# check if Xvfb is available
|
||||
if command -v xvfb-run > /dev/null 2>&1; then
|
||||
LAUNCH_OPTS="$LAUNCH_CMD $LAUNCH_OPTS"
|
||||
LAUNCH_CMD="xvfb-run"
|
||||
fi
|
||||
fi
|
||||
|
||||
"$LAUNCH_CMD" $LAUNCH_OPTS --module-path "$MODULES/modules:$MODULES/modules-thirdparty" --module org.apache.lucene.luke "$@"
|
||||
|
|
Loading…
Reference in New Issue