From 84ba431af12b3a8f6c7a38bd1d923841b5bff309 Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Oct 10 2020 01:02:40 +0000 Subject: Add CI for ibus-desktop-testing-runner --- diff --git a/tests/roles/ibus-desktop-testing-role/defaults/main.yml b/tests/roles/ibus-desktop-testing-role/defaults/main.yml new file mode 100644 index 0000000..8ff7991 --- /dev/null +++ b/tests/roles/ibus-desktop-testing-role/defaults/main.yml @@ -0,0 +1,3 @@ +role_pkgs_req: + - rsync + - xorg-x11-server-Xvfb diff --git a/tests/roles/ibus-desktop-testing-role/meta/main.yml b/tests/roles/ibus-desktop-testing-role/meta/main.yml new file mode 100644 index 0000000..6626402 --- /dev/null +++ b/tests/roles/ibus-desktop-testing-role/meta/main.yml @@ -0,0 +1,4 @@ +--- + +dependencies: + - role: str-common-init diff --git a/tests/roles/ibus-desktop-testing-role/tasks/main.yml b/tests/roles/ibus-desktop-testing-role/tasks/main.yml new file mode 100644 index 0000000..c506c86 --- /dev/null +++ b/tests/roles/ibus-desktop-testing-role/tasks/main.yml @@ -0,0 +1,106 @@ +--- +- 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-hangul-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 hangul 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: | + IS_RAWHIDE=`grep -i rawhide /etc/fedora-release` + if [ x"$IS_RAWHIDE" != x ] ; then + echo PASS + exit 0 + fi + log="{{ remote_artifacts }}/test.log" + if [ ! -f $log ] ; then + echo ERROR + exit 1 + else + FAIL=`grep "^FAIL: " $log | grep -v 'FAIL: 0$'` + if [ x"$FAIL" != x ] ; then + echo ERROR + exit 1 + 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 + diff --git a/tests/tests.yml b/tests/tests.yml index 1504ee3..446779e 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -1,29 +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 - - libappstream-glib - - desktop-file-utils - - python3-gobject - - python3-gobject-base - - glib2 - - gtk3 - - dconf - - dbus-x11 - - ibus - - ibus-devel - - gcc - - intltool - - python3-devel - - libhangul-devel - tests: - - make-check: - dir: ./ - run: bash ./make_check.sh ./source + - role: ibus-desktop-testing-role + installed_test_name: ibus-hangul + tags: + - classic + - gating +