From 7ec022c35af8a659b75e6361be75e057de5f06b6 Mon Sep 17 00:00:00 2001 From: Petr Šplíchal Date: Jan 11 2018 16:37:12 +0000 Subject: Support for fetching tests from remote repos 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. --- diff --git a/roles/standard-test-beakerlib/README.md b/roles/standard-test-beakerlib/README.md index 33dc0f4..f6ff920 100644 --- a/roles/standard-test-beakerlib/README.md +++ b/roles/standard-test-beakerlib/README.md @@ -17,3 +17,27 @@ roles/standard-test-beakerlib/vars/main.yml: is affecting the test subject (it's similar as rebuilding an rpm package to be tested) so this should be used with caution and only when necessary. + * 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-beakerlib + 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-beakerlib/tasks/main.yml b/roles/standard-test-beakerlib/tasks/main.yml index dd51b78..3cbab75 100644 --- a/roles/standard-test-beakerlib/tasks/main.yml +++ b/roles/standard-test-beakerlib/tasks/main.yml @@ -62,6 +62,16 @@ - beakerlib - restraint-rhts - rsync + + - 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 + delegate_to: executor - block: