From b7168298c815d9cf7d7ac8fb4192e2166767d766 Mon Sep 17 00:00:00 2001 From: Petr Šplíchal Date: Jan 15 2018 13:08:22 +0000 Subject: Support for fetching tests (standard-test-rhts) Add a new variable "repositories" which can be used to easily fetch tests from remote repos for execution. Useful especially when several packages share the same test coverage. This commit brings the fetch support to the standard-test-rhts role. --- diff --git a/roles/standard-test-rhts/README.md b/roles/standard-test-rhts/README.md index 338ce10..054068f 100644 --- a/roles/standard-test-rhts/README.md +++ b/roles/standard-test-rhts/README.md @@ -10,3 +10,27 @@ to have the following variables defined: undefined, it will default to /tmp/artifacts * required_packages: A list of prerequisite packages required by RHTS tests * rpms: Space separated list of RPMs to install (optional, may include SRPMs) + * repositories: A list of dictionaries defining git repos with + tests to be fetched. Available options are consistent with the + ansible git module syntax: + url ... repository url (required) + dest ... destination directory (required) + version ... desired branch (optional, defaults to master) + +Example usage: + +- hosts: localhost + roles: + - role: standard-test-rhts + tags: + - classic + repositories: + - repo: "https://src.fedoraproject.org/tests/shell.git" + dest: "shell" + tests: + - shell/func + - shell/login + - shell/smoke + required_packages: + - expect + - which diff --git a/roles/standard-test-rhts/tasks/main.yml b/roles/standard-test-rhts/tasks/main.yml index 6b83777..1284f69 100644 --- a/roles/standard-test-rhts/tasks/main.yml +++ b/roles/standard-test-rhts/tasks/main.yml @@ -34,6 +34,15 @@ with_items: - "{{ required_packages }}" +- name: Fetch tests from remote repositories + git: + repo: "{{ item.repo }}" + dest: "{{ item.dest }}" + version: "{{ item.version | default('master') }}" + with_items: + "{{ repositories }}" + when: repositories is defined + - name: Define remote_artifacts if it is not already defined set_fact: remote_artifacts: /tmp/artifacts