Implement latest IBus CI

Generate results.yml to follow the defined result format
https://docs.fedoraproject.org/en-US/ci/standard-test-interface/#_results_format
This commit is contained in:
Takao Fujiwara 2024-05-11 18:20:59 +09:00
parent 9486253b37
commit a337fe4f39
3 changed files with 102 additions and 49 deletions

View File

@ -0,0 +1,66 @@
#!/bin/bash
TEST_LOG="test.log"
TEST_RUN_IN_RAWHIDE="1"
if [ $# -gt 0 ] ; then
TEST_LOG="$1"
TEST_RUN_IN_RAWHIDE="$2"
fi
gen_results()
{
TEST_RUNTIME="$1"
TEST_STATUS="$2"
TEST_STATUS_UPPER="$(echo "$TEST_STATUS" | tr '[:lower:]' '[:upper:]')"
cat > results.xml << _EOF
results:
- test: results
result: $TEST_STATUS
runtime: $TEST_RUNTIME
logs:
- ${TEST_STATUS_UPPER}-str_results.log
_EOF
DIR=$(dirname "$TEST_LOG")
if [ x"$TEST_LOG" != x ] ; then
cp "$TEST_LOG" "$DIR/${TEST_STATUS_UPPER}-str_results.log"
else
touch "$DIR/${TEST_STATUS_UPPER}-str_results.log"
fi
if [ x"$DIR" != x. ] ; then
mv results.xml "$DIR"
fi
}
if [ $TEST_RUN_IN_RAWHIDE -eq 0 ] ; then
IS_RAWHIDE="$(grep -i rawhide /etc/fedora-release)"
if [ x"$IS_RAWHIDE" != x ] ; then
gen_results "0" "pass"
exit 0
fi
fi
if [ ! -f $TEST_LOG ] ; then
gen_results "0" "fail"
echo ERROR
else
FAIL="$(grep "^FAIL: " $TEST_LOG | grep -v 'FAIL: 0$')"
RUNTIME_FAIL="$(grep -v 'frame' $TEST_LOG | grep "^FAIL: " | sed -e "s/FAIL: //")"
RUNTIME_PASS="$(grep -v 'frame' $TEST_LOG | grep "^PASS: " | sed -e "s/PASS: //")"
if [ x"$RUNTIME_FAIL" = x ] ; then
RUNTIME_FAIL="0"
fi
if [ x"$RUNTIME_PASS" = x ] ; then
RUNTIME_PASS="0"
fi
RUNTIME="$(expr $RUNTIME_FAIL + $RUNTIME_PASS)"
if [ x"$FAIL" != x ] ; then
gen_results "$RUNTIME" "fail"
echo ERROR
else
gen_results "$RUNTIME" "pass"
fi
fi

View File

@ -11,57 +11,46 @@
- name: Installing build dependencies for IBus and GNOME installed-tests testing harness - name: Installing build dependencies for IBus and GNOME installed-tests testing harness
package: package:
name: name:
- git # IBus CI sets
- make
- gcc
- diffutils
- autoconf
- automake
- libtool
- glib2-devel
- systemd-devel
- gnome-session
- gnome-shell
- dbus-x11
- xorg-x11-server-Xvfb - xorg-x11-server-Xvfb
- ibus - ibus
- ibus-desktop-testing - ibus-desktop-testing
- ibus-anthy-tests - dbus-x11
# ibus-compose test needs locales - gnome-desktop-testing
- glibc-langpack-el # dnf group info GNOME
- glibc-langpack-fi - gnome-session-wayland-session
- glibc-langpack-pt - gnome-session-xsession
- gnome-settings-daemon
- name: Fetching GNOME installed-tests testing harness source from remote repository - gnome-shell
git: - polkit
repo: 'https://gitlab.gnome.org/GNOME/gnome-desktop-testing.git' - NetworkManager-ssh-gnome
dest: gnome-desktop-testing - PackageKit-command-not-found
force: yes - PackageKit-gtk3-module
- adobe-source-code-pro-fonts
- name: Configure GNOME installed-tests testing harness build - at-spi2-atk
command: ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var - at-spi2-core
args: - glib-networking
chdir: gnome-desktop-testing - gnome-backgrounds
- gnome-classic-session
- name: Build GNOME installed-tests testing harness - gnome-clocks
command: make - gnome-color-manager
args: - gnome-contacts
chdir: gnome-desktop-testing - gnome-font-viewer
- gnome-logs
- name: Install GNOME installed-tests testing harness - gnome-maps
command: make install
args:
chdir: gnome-desktop-testing
- name: Start IBus installed-tests testing harness - name: Start IBus installed-tests testing harness
environment: environment:
ANSIBLE: 1 ANSIBLE: 1
TMPDIR: '{{ remote_artifacts }}' TMPDIR: '{{ remote_artifacts }}'
G_MESSAGES_DEBUG: 'all' G_MESSAGES_DEBUG: 'all'
LANG: 'C.UTF-8'
block: block:
- name: Execute IBus tests - name: Execute IBus tests
shell: | shell: |
set -e set -e
# Delete LC_CTYPE=C.UTF-8
export -n LC_CTYPE
status="FAIL: frame" status="FAIL: frame"
if [ -f $HOME/.config/anthy/last-record2_default.utf8 ] ; then \ if [ -f $HOME/.config/anthy/last-record2_default.utf8 ] ; then \
rm $HOME/.config/anthy/last-record2_default.utf8 rm $HOME/.config/anthy/last-record2_default.utf8
@ -80,6 +69,12 @@
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
status="PASS: frame" status="PASS: frame"
fi 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 "${status}" >> {{ remote_artifacts }}/test.log
echo "#### {{ remote_artifacts }}/{{ installed_test_name }}.log" echo "#### {{ remote_artifacts }}/{{ installed_test_name }}.log"
if [ -f {{ remote_artifacts }}/{{ installed_test_name }}.log ] ; then if [ -f {{ remote_artifacts }}/{{ installed_test_name }}.log ] ; then
@ -93,17 +88,7 @@
echo "#" echo "#"
- name: Check the results - name: Check the results
#shell: grep "^FAIL" {{ remote_artifacts }}/test.log script: check-results.sh "{{ remote_artifacts }}/test.log" "0"
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
fi
fi
register: test_fails register: test_fails
failed_when: False failed_when: False

View File

@ -5,4 +5,6 @@
tags: tags:
- classic - classic
- gating - gating
required_packages:
- ibus-anthy-tests