Add CI for ibus-desktop-testing-runner

This commit is contained in:
Takao Fujiwara 2020-05-18 15:48:48 +09:00 committed by Mike FABIAN
parent 5f7dcf546e
commit 5863646b93
7 changed files with 112 additions and 119 deletions

View File

@ -1,17 +0,0 @@
#!/bin/bash
set -x
check_return_value () {
if [ $1 != 0 ] ; then
exit $1
fi
}
export DISPLAY=:1
Xvfb $DISPLAY -screen 0 1024x768x16 &
/usr/bin/emoji-picker --help
check_return_value $?
/usr/bin/emoji-picker --version
check_return_value $?

View File

@ -1,19 +0,0 @@
#!/bin/bash
set -x
check_return_value () {
if [ $1 != 0 ] ; then
exit $1
fi
}
cd $1
export DISPLAY=:1
Xvfb $DISPLAY -screen 0 1024x768x16 &
./configure --prefix=/usr
check_return_value $?
make check && rc=0 || rc=1; cat tests/*.log
exit $rc

View File

@ -0,0 +1,3 @@
role_pkgs_req:
- rsync
- xorg-x11-server-Xvfb

View File

@ -0,0 +1,4 @@
---
dependencies:
- role: str-common-init

View File

@ -0,0 +1,99 @@
---
- name: Check if GNOME installed-tests testing harness is installed
register: gnome_desktop_testing_runner
find:
paths: "{{ ansible_env.PATH.split(':') }}"
pattern: gnome-desktop-testing-runner
- name: Build and install GNOME installed-tests testing harness
when: gnome_desktop_testing_runner.matched == 0
block:
- name: Installing build dependencies for IBus and GNOME installed-tests testing harness
package:
name:
- git
- make
- gcc
- diffutils
- autoconf
- automake
- libtool
- glib2-devel
- systemd-devel
- gnome-session
- gnome-shell
- dbus-x11
- xorg-x11-server-Xvfb
- ibus
- ibus-desktop-testing
- ibus-typing-booster-tests
- name: Fetching GNOME installed-tests testing harness source from remote repository
git:
repo: 'https://gitlab.gnome.org/GNOME/gnome-desktop-testing.git'
dest: gnome-desktop-testing
force: yes
- name: Configure GNOME installed-tests testing harness build
command: ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var
args:
chdir: gnome-desktop-testing
- name: Build GNOME installed-tests testing harness
command: make
args:
chdir: gnome-desktop-testing
- name: Install GNOME installed-tests testing harness
command: make install
args:
chdir: gnome-desktop-testing
- name: Start IBus installed-tests testing harness
environment:
ANSIBLE: 1
TMPDIR: '{{ remote_artifacts }}'
G_MESSAGES_DEBUG: 'all'
block:
- name: Execute IBus typing booster tests
shell: |
set -e
status="FAIL: frame"
ibus-desktop-testing-runner \
--no-graphics \
--runner=gnome \
--timeout=1200 \
--tests='{{ installed_test_name }}' \
--output='{{ remote_artifacts }}/{{ installed_test_name }}.log' \
--result='{{ remote_artifacts }}/test.log' \
null
if [ $? -eq 0 ]; then
status="PASS: frame"
fi
echo "${status} $TEST" >> {{ remote_artifacts }}/test.log
- name: Check the results
shell: |
log="{{ remote_artifacts }}/test.log"
if [ ! -f $log ] ; then
echo ERROR
else
FAIL=`grep "^FAIL: " $log | grep -v 'FAIL: 0$'`
if [ x"$FAIL" != x ] ; then
echo ERROR
else
echo PASS
fi
fi
register: test_fails
#failed_when: False
- name: Set role result
set_fact:
role_result: "{{ test_fails.stdout }}"
role_result_failed: "{{ (test_fails.stdout|d|length > 0) or (test_fails.stderr|d|length > 0) }}"
role_result_msg: "{{ test_fails.stdout|d('tests failed.') }}"
- include_role:
name: str-common-final

View File

@ -1,16 +0,0 @@
#!/bin/bash
set -x
check_return_value () {
if [ $1 != 0 ] ; then
exit $1
fi
}
pushd /usr/share/ibus-typing-booster/engine
for i in $@; do
python3 ${i} -v
check_return_value $?
done
popd

View File

@ -1,69 +1,8 @@
- hosts: localhost
vars:
- artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}"
tags:
- classic
remote_user: root
roles:
- role: standard-test-source # to get the source tar ball to do “make check”
- role: standard-test-basic
required_packages:
- make
- m17n-lib
- m17n-db-extras
- python3-enchant
- libappstream-glib
- desktop-file-utils
- python3-mock
- python3-gobject
- python3-gobject-base
- hunspell-cs
- hunspell-de
- hunspell-en
- hunspell-es
- hunspell-fr
- hunspell-it
- hunspell-ko
- glib2
- gtk3
- dconf
- dbus-x11
- ibus
- ibus-devel
- gcc
- python3-devel
- python3-pyxdg
- xorg-x11-server-Xvfb
- glibc-langpack-en
- glibc-langpack-cs
- glibc-langpack-km
- glibc-langpack-pt
- glibc-langpack-am
- glibc-langpack-de
- glibc-langpack-ar
tests:
- make-check:
dir: ./
run: bash ./make_check.sh ./source
- doctests-hunspell_suggest.py:
dir: ./
run: bash ./run_python_doctests.sh hunspell_suggest.py
- doctests-m17n_translit.py:
dir: ./
run: bash ./run_python_doctests.sh m17n_translit.py
- doctests-itb_util.py:
dir: ./
run: bash ./run_python_doctests.sh itb_util.py
# Better do not run the doctests for itb_emoji in CI.
# CI is run in the installed system where the emoji
# annotation data is in the package cldr-emoji-annotation.
# The data in that package is often a bit older than the emoji annotation
# data in the source of ibus-typing-booster, therefore the emoji
# matching tests often give slightly different results and thus may
# fail when run against the cldr-emoji-annotation package.
# - doctests-itb_emoji.py:
# dir: ./
# run: bash ./run_python_doctests.sh itb_emoji.py
- emoji-picker:
dir: ./
run: bash ./emoji_picker_tests.sh
- role: ibus-desktop-testing-role
installed_test_name: ibus-typing-booster
tags:
- classic
- gating