Use tmt and fix the CI tests
Resolves: RHEL-2236
This commit is contained in:
parent
01d2adff6e
commit
495f02f859
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
@ -1,6 +1,6 @@
|
|||||||
Name: ibus-table
|
Name: ibus-table
|
||||||
Version: 1.9.18
|
Version: 1.9.18
|
||||||
Release: 7%{?dist}
|
Release: 8%{?dist}
|
||||||
Summary: The Table engine for IBus platform
|
Summary: The Table engine for IBus platform
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
@ -135,6 +135,10 @@ fi
|
|||||||
%{_datadir}/installed-tests/%{name}
|
%{_datadir}/installed-tests/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Oct 10 2023 Mike FABIAN <mfabian@redhat.com> - 1.9.18-8
|
||||||
|
- Fix unit tests, bump release number for new build
|
||||||
|
Resolves: RHEL-2236
|
||||||
|
|
||||||
* Thu Sep 21 2023 Mike FABIAN <mfabian@redhat.com> - 1.9.18-7
|
* Thu Sep 21 2023 Mike FABIAN <mfabian@redhat.com> - 1.9.18-7
|
||||||
- Fix requirements of Python 3
|
- Fix requirements of Python 3
|
||||||
Resolves: RHEL-2236
|
Resolves: RHEL-2236
|
||||||
|
9
plans/basic.fmf
Normal file
9
plans/basic.fmf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
summary: Basic smoke test
|
||||||
|
discover:
|
||||||
|
how: fmf
|
||||||
|
execute:
|
||||||
|
how: tmt
|
||||||
|
prepare:
|
||||||
|
how: shell
|
||||||
|
script:
|
||||||
|
- dnf config-manager --enable rhel-CRB --enable rhel-buildroot
|
44
tests/main.fmf
Normal file
44
tests/main.fmf
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
test: ./runtest.sh
|
||||||
|
duration: 50m
|
||||||
|
framework: beakerlib
|
||||||
|
require:
|
||||||
|
# This stuff is only needed if gnome-desktop-testing
|
||||||
|
# cannot be required as a package and needs to be cloned
|
||||||
|
# from the git repo and build from source:
|
||||||
|
- git
|
||||||
|
- make
|
||||||
|
- gcc
|
||||||
|
- diffutils
|
||||||
|
- autoconf
|
||||||
|
- automake
|
||||||
|
- libtool
|
||||||
|
- glib2-devel
|
||||||
|
- systemd-devel
|
||||||
|
# Other requirements:
|
||||||
|
- gnome-session
|
||||||
|
- gnome-shell
|
||||||
|
- ibus
|
||||||
|
- ibus-devel
|
||||||
|
- ibus-desktop-testing
|
||||||
|
- ibus-table
|
||||||
|
- ibus-table-tests
|
||||||
|
- rsync
|
||||||
|
- xorg-x11-server-Xvfb
|
||||||
|
- libappstream-glib
|
||||||
|
- desktop-file-utils
|
||||||
|
- python3-mock
|
||||||
|
- python3-gobject
|
||||||
|
- python3-gobject-base
|
||||||
|
- glib2
|
||||||
|
- gtk3
|
||||||
|
- dconf
|
||||||
|
- dbus-x11
|
||||||
|
- python3-devel
|
||||||
|
- python3-pyxdg
|
||||||
|
- xorg-x11-server-Xvfb
|
||||||
|
- ibus-table-chinese-wubi-jidian
|
||||||
|
- ibus-table-chinese-cangjie
|
||||||
|
- ibus-table-chinese-stroke5
|
||||||
|
recommend:
|
||||||
|
# this is not available on RHEL9
|
||||||
|
- gnome-desktop-testing
|
@ -1,21 +0,0 @@
|
|||||||
role_pkgs_req:
|
|
||||||
- rsync
|
|
||||||
- xorg-x11-server-Xvfb
|
|
||||||
- libappstream-glib
|
|
||||||
- desktop-file-utils
|
|
||||||
- python3-mock
|
|
||||||
- python3-gobject
|
|
||||||
- python3-gobject-base
|
|
||||||
- glib2
|
|
||||||
- gtk3
|
|
||||||
- dconf
|
|
||||||
- dbus-x11
|
|
||||||
- ibus
|
|
||||||
- ibus-devel
|
|
||||||
- gcc
|
|
||||||
- python3-devel
|
|
||||||
- python3-pyxdg
|
|
||||||
- xorg-x11-server-Xvfb
|
|
||||||
- ibus-table-chinese-wubi-jidian
|
|
||||||
- ibus-table-chinese-cangjie
|
|
||||||
- ibus-table-chinese-stroke5
|
|
@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
- role: str-common-init
|
|
@ -1,101 +0,0 @@
|
|||||||
---
|
|
||||||
- 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-table-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 table 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
|
|
||||||
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
|
|
||||||
|
|
48
tests/runtest.sh
Executable file
48
tests/runtest.sh
Executable file
@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||||
|
|
||||||
|
NAME=ibus-table
|
||||||
|
|
||||||
|
rlJournalStart
|
||||||
|
rlPhaseStartSetup
|
||||||
|
rlAssertRpm ${NAME}
|
||||||
|
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
|
||||||
|
rlRun "pushd $tmp"
|
||||||
|
if ! rlCheckRpm gnome-desktop-testing; then
|
||||||
|
echo "gnome-desktop-testing is not available."
|
||||||
|
echo "Trying to download and compile it:"
|
||||||
|
git clone https://gitlab.gnome.org/GNOME/gnome-desktop-testing.git
|
||||||
|
pushd gnome-desktop-testing
|
||||||
|
git checkout v2021.1
|
||||||
|
./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartTest
|
||||||
|
rlRun "ibus-desktop-testing-runner \
|
||||||
|
--no-graphics \
|
||||||
|
--runner=gnome \
|
||||||
|
--timeout=1500 \
|
||||||
|
--tests=${NAME} \
|
||||||
|
--output=${NAME}.log \
|
||||||
|
--result=test.log \
|
||||||
|
" 0 "Running ${NAME} tests"
|
||||||
|
echo "==== ${NAME}.log: ===="
|
||||||
|
cat ${NAME}.log
|
||||||
|
echo "==== EOF ${NAME}.log: ===="
|
||||||
|
echo "==== test.log ===="
|
||||||
|
cat test.log
|
||||||
|
echo "==== EOF test.log: ===="
|
||||||
|
rlAssertGrep "^FAIL:[[:space:]]*0$" test.log
|
||||||
|
rlFileSubmit ${NAME}.log
|
||||||
|
rlFileSubmit test.log
|
||||||
|
rlPhaseEnd
|
||||||
|
|
||||||
|
rlPhaseStartCleanup
|
||||||
|
rlRun "popd"
|
||||||
|
rlRun "rm -r $tmp" 0 "Remove tmp directory"
|
||||||
|
rlPhaseEnd
|
||||||
|
rlJournalEnd
|
@ -1,8 +0,0 @@
|
|||||||
- hosts: localhost
|
|
||||||
roles:
|
|
||||||
- role: ibus-desktop-testing-role
|
|
||||||
installed_test_name: ibus-table
|
|
||||||
tags:
|
|
||||||
- classic
|
|
||||||
- gating
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user