From 2387efd33d0afadf43bfe8d61acc649de5f49ae7 Mon Sep 17 00:00:00 2001 From: Petr Šplíchal Date: Mar 25 2019 13:53:54 +0000 Subject: Remove the standard-test-scripts role This role has not been used and duplicates functionality of standard-test-basic which has additional features. --- diff --git a/roles/standard-test-scripts/README.md b/roles/standard-test-scripts/README.md deleted file mode 100644 index d407bcc..0000000 --- a/roles/standard-test-scripts/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Ansible role for executing test scripts - -Put this role in your tests.yml playbook and specify a -number of test scripts to execute as tests. The results -of each script will be piped into log file in the artifacts -directory. If any script exits with a non-zero exit code -the role will fail. - -In the case of test subjects such a host or container, these -test scripts and related files will be copied to the target into -/var/tmp/tests before execution. - -You should define the following variables: - - * tests: An array of scripts to run - * files: A list of files or directories needed by the scripts - diff --git a/roles/standard-test-scripts/defaults/main.yml b/roles/standard-test-scripts/defaults/main.yml deleted file mode 100644 index ceb88f4..0000000 --- a/roles/standard-test-scripts/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -artifacts: "{{ lookup('env', 'TEST_ARTIFACTS') | default('./artifacts', true) }}" diff --git a/roles/standard-test-scripts/tasks/main.yml b/roles/standard-test-scripts/tasks/main.yml deleted file mode 100644 index bddd620..0000000 --- a/roles/standard-test-scripts/tasks/main.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- name: Install testing requirements - package: name={{ item }} state=present - with_items: - - rsync - when: ansible_pkg_mgr != 'unknown' - -- name: Copy test scripts to target - synchronize: - src: "{{ item }}" - dest: /var/tmp/tests/ - ssh_args: "-o UserKnownHostsFile=/dev/null" - with_items: - - "{{ tests }}" - - "{{ files }}" - -- block: - - name: Execute test scripts - shell: | - set -e - mkdir -p /var/tmp/artifacts - logfile=/var/tmp/artifacts/test.$(echo {{ item }} | sed -e 's/\//-/g').log - exec 2>>$logfile 1>>$logfile - cd /var/tmp/tests - if [ -x {{ item }} ]; then - ./$(basename {{ item }}) && result="PASS" || result="FAIL" - else - /bin/sh -e ./$(basename {{ item }}) && result="PASS" || result="FAIL" - fi - echo "$result {{ item }}" >> /var/tmp/artifacts/test.log - with_items: - - "{{ tests }}" - - always: - - name: Pull out the logs - synchronize: - dest: "{{ artifacts }}" - src: "/var/tmp/artifacts/./" - mode: pull - ssh_args: "-o UserKnownHostsFile=/dev/null" - when: artifacts|default("") != "" - - # Can't go in block. See - # https://github.com/ansible/ansible/issues/20736 - - name: Check the results - shell: grep "^FAIL" /var/tmp/artifacts/test.log - register: test_fails - failed_when: test_fails.stdout or test_fails.stderr diff --git a/roles/standard-test-scripts/vars/main.yml b/roles/standard-test-scripts/vars/main.yml deleted file mode 100644 index 81108ab..0000000 --- a/roles/standard-test-scripts/vars/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -tests: [] -files: []