Blob Blame History Raw
---
- 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:
            # IBus CI sets
            - xorg-x11-server-Xvfb
            - ibus
            - ibus-desktop-testing
            - dbus-x11
            - gnome-desktop-testing
            # dnf group info GNOME
            - gnome-session-wayland-session
            - gnome-session-xsession
            - gnome-settings-daemon
            - gnome-shell
            - polkit
            - NetworkManager-ssh-gnome
            - PackageKit-command-not-found
            - PackageKit-gtk3-module
            - adobe-source-code-pro-fonts
            - at-spi2-atk
            - at-spi2-core
            - glib-networking
            - gnome-backgrounds
            - gnome-classic-session
            - gnome-clocks
            - gnome-color-manager
            - gnome-contacts
            - gnome-font-viewer
            - gnome-logs
            - gnome-maps
            - gnome-photos
            - gnome-remote-desktop
            - gnome-screenshot
            - gnome-system-monitor
            - gnome-terminal-nautilus
            - gnome-themes-extra
            - gnome-user-docs
            - gnome-user-share
            - gnome-weather
            - gvfs-afc
            - gvfs-afp
            - gvfs-archive
            - gvfs-fuse
            - gvfs-goa
            - gvfs-gphoto2
            - gvfs-mtp
            - gvfs-smb
            - libcanberra-gtk3
            - libcanberra-gtk3
            - libproxy-webkitgtk4
            - librsvg2
            - libsane-hpaio
            - mesa-dri-drivers
            - mesa-libEGL
            - orca
            - rygel
            - sane-backends-drivers-scanners
            - simple-scan
            - tracker
            - tracker-miners
            - xdg-desktop-portal
            - xdg-desktop-portal-gtk
            - xdg-user-dirs-gtk

- name: Start IBus installed-tests testing harness
  environment:
    ANSIBLE: 1
    TMPDIR: '{{ remote_artifacts }}'
    G_MESSAGES_DEBUG: 'all'
    LANG: 'C.UTF-8'
  block:
  - name: Execute IBus tests
    shell: |
      set -e
      # Delete LC_CTYPE=C.UTF-8
      export -n LC_CTYPE
      status="FAIL: frame"
      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
      if [ -f /var/tmp/ibus-ci-autostart.log ] ; then
          echo "#### /var/tmp/ibus-ci-autostart.log"
          cat /var/tmp/ibus-ci-autostart.log
          rm /var/tmp/ibus-ci-autostart.log
          echo "#"
      fi
      echo "${status}" >> {{ remote_artifacts }}/test.log
      echo "#### {{ remote_artifacts }}/{{ installed_test_name }}.log"
      if [ -f {{ remote_artifacts }}/{{ installed_test_name }}.log ] ; then
          cat {{ remote_artifacts }}/{{ installed_test_name }}.log
      fi
      echo "#"
      echo "#### {{ remote_artifacts }}/test.log"
      if [ -f {{ remote_artifacts }}/test.log ] ; then
          cat {{ remote_artifacts }}/test.log
      fi
      echo "#"

  - name: Check the results
    script: check-results.sh "{{ remote_artifacts }}/test.log" "0"
    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