#10 WIP: IBus CI
Closed 4 years ago by fujiwara. Opened 4 years ago by fujiwara.
rpms/ fujiwara/ibus tests  into  master

file added
+97
@@ -0,0 +1,97 @@ 

+ diff --git a/src/tests/ibus-compose-locales.in b/src/tests/ibus-compose-locales.in

+ index fad02965..d64a19cb 100755

+ --- a/src/tests/ibus-compose-locales.in

+ +++ b/src/tests/ibus-compose-locales.in

+ @@ -7,19 +7,27 @@ BUILDDIR=`dirname $0`

+  export IBUS_COMPOSE_CACHE_DIR=$PWD

+  

+  retval=0

+ +# Let for-loop notice '\n' as a delimiter

+ +IFS=$'\n'

+  for var in `cat $SRCDIR/ibus-compose.env`

+  do

+ +    # Revert IFS to recognize env a=foo b=foo

+ +    IFS=' '

+      IS_COMMENT=`echo "$var" | grep "^#"`

+      if [ "x$IS_COMMENT" != x ] ; then

+          continue

+      fi

+ +    echo "Starting $var $BUILDDIR/ibus-compose $SRCDIR $@"

+      env $var $BUILDDIR/ibus-compose $SRCDIR $@

+      retval=`expr $retval + $?`

+ +    echo "Finished $retval in $var $BUILDDIR/ibus-compose $SRCDIR $@"

+  

+      CACHE_FILES=`ls *.cache`

+      if [ x"$CACHE_FILES" != x ] ; then

+          echo "Clean $CACHE_FILES"

+          rm $CACHE_FILES

+      fi

+ +    IFS=$'\n'

+  done

+ +IFS=' '

+  exit $retval

+ diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c

+ index db359477..980972fc 100644

+ --- a/src/tests/ibus-compose.c

+ +++ b/src/tests/ibus-compose.c

+ @@ -331,20 +331,31 @@ create_window ()

+  static void

+  test_compose (void)

+  {

+ +    GLogLevelFlags flags;

+ +    g_debug ("test test_compose\n");

+      if (!register_ibus_engine ()) {

+          g_test_fail ();

+          return;

+      }

+ +    g_debug ("test2 test_compose\n");

+  

+      create_window ();

+ +    /* FIXME:

+ +     * IBusIMContext opens GtkIMContextSimple as the slave and

+ +     * GtkIMContextSimple opens the compose table on el_GR.UTF-8, and the

+ +     * multiple outputs in el_GR's compose causes a warning in gtkcomposetable

+ +     * and the warning always causes a fatal in GTest:

+ +     " "GTK+ supports to output one char only: "

+ +     */

+ +    g_debug ("test3 test_compose\n");

+ +    flags = g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);

+      gtk_main ();

+ -

+ +    g_log_set_always_fatal (flags);

+  }

+  

+  int

+  main (int argc, char *argv[])

+  {

+ -    GLogLevelFlags flags;

+      const gchar *test_name;

+      gchar *test_path;

+  

+ @@ -354,17 +365,10 @@ main (int argc, char *argv[])

+       */

+      g_setenv ("NO_AT_BRIDGE", "1", TRUE);

+      g_test_init (&argc, &argv, NULL);

+ -    /* FIXME:

+ -     * IBusIMContext opens GtkIMContextSimple as the slave and

+ -     * GtkIMContextSimple opens the compose table on el_GR.UTF-8, and the

+ -     * multiple outputs in el_GR's compose causes a warning in gtkcomposetable

+ -     * and the warning always causes a fatal in GTest:

+ -     " "GTK+ supports to output one char only: "

+ -     */

+ -    flags = g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL);

+ +    g_debug ("test ibus-compose\n");

+      gtk_init (&argc, &argv);

+ -    g_log_set_always_fatal (flags);

+  

+ +    g_debug ("test2 ibus-compose\n");

+      m_srcdir = argc > 1 ? g_strdup (argv[1]) : g_strdup (".");

+      m_compose_file = g_strdup (g_getenv ("COMPOSE_FILE"));

+  #if GLIB_CHECK_VERSION (2, 58, 0)

+ @@ -376,5 +380,6 @@ main (int argc, char *argv[])

+      g_test_add_func (test_path, test_compose);

+      g_free (test_path);

+  

+ +    g_debug ("test3 ibus-compose\n");

+      return g_test_run ();

+  }

file modified
+6 -4
@@ -46,6 +46,7 @@ 

  Patch0:         %{name}-HEAD.patch

  # Under testing #1349148 #1385349 #1350291 #1406699 #1432252 #1601577

  Patch1:         %{name}-1385349-segv-bus-proxy.patch

+ Patch2:         %{name}-xx-test.patch

  

  BuildRequires:  gettext-devel

  BuildRequires:  libtool
@@ -234,8 +235,9 @@ 

  The ibus-devel-docs package contains developer documentation for IBus

  

  %package desktop-testing

- Summary:  Wrapper of InstalledTests Runner for IBus

- Requires: %{name}%{?_isa} = %{version}-%{release}

+ Summary:        Wrapper of InstalledTests Runner for IBus

+ Requires:       %{name} = %{version}-%{release}

+ BuildArch:      noarch

  

  %description desktop-testing

  GNOME desktop testing runner implements the InstalledTests specification
@@ -244,8 +246,8 @@ 

  desktop testing runner internally.

  

  %package  tests

- Summary:  Tests for the %{name} package

- Requires: %{name}%{?_isa} = %{version}-%{release}

+ Summary:        Tests for the %{name} package

+ Requires:       %{name}%{?_isa} = %{version}-%{release}

  

  %description tests

  The %{name}-tests package contains tests that can be used to verify

@@ -0,0 +1,3 @@ 

+ role_pkgs_req:

+   - rsync

+   - xorg-x11-server-Xvfb

@@ -0,0 +1,4 @@ 

+ ---

+ 

+ dependencies:

+     - role: str-common-init

@@ -0,0 +1,100 @@ 

+ ---

+ - 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 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-tests

+             # ibus-compose test needs locales

+             - glibc-langpack-el

+             - glibc-langpack-fi

+             - glibc-langpack-pt

+ 

+     - 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 GNOME installed-tests testing harness

+   block:

+   - name: Execute tests

+     shell: |

+       set -e

+       status="FAIL: frame"

+       env TMPDIR='{{ remote_artifacts }}' G_MESSAGES_DEBUG='all' \

+           ibus-desktop-testing-runner \

+           --no-graphics \

+           --runner=gnome \

+           --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: grep "^FAIL" {{ remote_artifacts }}/test.log

+     shell: |

+         log="{{ remote_artifacts }}/test.log"

+         if [ ! -f $log ] ; then

+             echo ERROR

+         else

+             FAIL=`grep "^FAIL: " {{ remote_artifacts }}/test.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

+ 

file added
+8
@@ -0,0 +1,8 @@ 

+ - hosts: localhost

+   roles:

+     - role: ibus-desktop-testing-role

+       installed_test_name: ibus

+       tags:

+       - classic

+       - gating

+