ostree/tests/installed/nondestructive.yml
Colin Walters b9fc3eaa15 tests/installed: Move tasks into tasks/ directory
It's cleaner to separate test playbooks from their tasks.

Closes: #1535
Approved by: jlebon
2018-04-11 19:11:07 +00:00

42 lines
1.2 KiB
YAML

# Nondestructive sysinstalled tests, run in parallel.
---
- hosts: localhost
tags:
- atomic
remote_user: root
vars:
use_git_build: True
tests: "."
# Arbitrary...we want some parallelism
batching_factor: 4
tasks:
- import_tasks: tasks/query-host.yml
- import_tasks: tasks/overlay-git.yml
when: use_git_build
# Next copy all of the tests/ directory
- name: Copy test data
synchronize: src=../../ dest=/root/tests/ archive=yes
- find:
paths: /root/tests/installed/nondestructive
patterns: "itest-*.sh"
register: all_tests
- set_fact:
selected_tests: "{{ all_tests.files|map(attribute='path') | select('match', tests) | list }}"
- assert:
that:
- "{{ selected_tests|length }} != 0"
- file: path=/root/logs state=directory
- block:
- name: Run nondestructive tests
vars:
logdir: /root/logs
async_commands: "{{ item }}"
include_tasks: execute_batch.yml
with_items:
- "{{ selected_tests | batch('{{ batching_factor }}') | list }}"
always:
- synchronize:
src: /root/logs
dest: artifacts/installed-nondestructive
mode: pull