cockpit/tests/roles/standard-test-scripts/tasks/main.yml
Stef Walter d9a218b7d5 Initial smoke tests run from upstream Cockpit project
Later once the upstream no longer uses phantomjs, we should
be able to execute the entire integration test suite.

This includes the standard-test-overlay role, and the
standard-test-scripts role. These will be suggested to the
standard-test-roles repo.
2017-09-21 12:01:44 +02:00

34 lines
886 B
YAML

---
- name: Copy test scripts to target
synchronize:
src: "{{ item }}"
dest: /usr/local/bin/
ssh_args: "-o UserKnownHostsFile=/dev/null"
with_items:
- "{{ tests }}"
- "{{ files }}"
- block:
- name: Execute test scripts
shell: |
mkdir -p /tmp/artifacts
logfile=/tmp/artifacts/test.$(echo {{ item }} | sed -e 's/\//-/g').log
exec 2>>$logfile 1>>$logfile
cd /usr/local/bin
if [ -x {{ item }} ]; then
./$(basename {{ item }}) && result="PASS" || result="FAIL"
else
/bin/sh -e ./$(basename {{ item }}) && result="PASS" || result="FAIL"
fi
echo "$result {{ item }}" >> /tmp/artifacts/test.log
with_items:
- "{{ tests }}"
always:
- name: Pull out the logs
synchronize:
dest: "{{ artifacts }}"
src: "/tmp/artifacts/./"
mode: pull
when: artifacts|default("") != ""