import sources

This commit is contained in:
Adam Samalik 2023-06-21 14:53:42 +02:00
parent a50f19d506
commit e61afc56d6
6 changed files with 146 additions and 2 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
SOURCES/clutter-1.26.2.tar.xz
/clutter-1.26.2.tar.xz
/clutter-1.*.tar.xz

View File

@ -0,0 +1,34 @@
gnome-desktop-testing-role
==========================
This ansible role is to make it easy to leverage gnome installed tests (via the gnome-desktop-testing module)
Requirements
------------
Xvfb
If gnome-desktop-testing isn't installed it will be built from version control.
Role Variables
--------------
The variable installed_test_name is used to describe the name of the installed tests to run.
(the basename of the directory in /usr/share/installed-tests)
Dependencies
------------
standard-test-roles
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: localhost
roles:
- role: gnome-desktop-testing-role
test_name: mutter
tags:
- classic
License
-------
BSD

View File

@ -0,0 +1,6 @@
role_pkgs_req:
- rsync
- xorg-x11-server-Xvfb
- dbus-daemon
- sudo
- tmux

View File

@ -0,0 +1,4 @@
---
dependencies:
- role: str-common-init

View File

@ -0,0 +1,93 @@
---
- 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
- 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: Create a user to run GNOME installed-tests as
user:
name: shadowman
state: present
- name: Start GNOME installed-tests testing harness
block:
- name: Allow shadowman user access to artifacts dir
file:
path: "{{ remote_artifacts }}"
mode: 01777
- name: Determine log file name
set_fact:
log_file: "{{ remote_artifacts }}/{{ installed_test_name }}.log"
- name: Delete any stale log file
file:
path: "{{ log_file }}"
state: absent
- name: Execute tests
become: yes
become_user: shadowman
shell: |
set -e
log_file="{{ log_file }}"
exec 2>>$log_file 1>>$log_file
status="FAIL"
xvfb-run -d -s '-screen 0 1024x768x24' dbus-run-session env TMPDIR='{{ remote_artifacts }}' G_MESSAGES_DEBUG='all' LANG=en_US.utf8 gnome-desktop-testing-runner '{{ installed_test_name }}'
if [ $? -eq 0 ]; then
status="PASS"
fi
echo "${status} $TEST" >> {{ remote_artifacts }}/test.log
args:
chdir: "{{ remote_artifacts }}"
- name: Check the results
shell: grep "^FAIL" {{ remote_artifacts }}/test.log
register: test_fails
failed_when: False
- name: Set role result
set_fact:
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

8
tests/tests.yml Normal file
View File

@ -0,0 +1,8 @@
- hosts: localhost
roles:
- role: gnome-desktop-testing-role
installed_test_name: clutter
tags:
- classic
- gating