diff --git a/Jenkinsfile b/Jenkinsfile index 910cd6a..9091933 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,6 +49,7 @@ library( ) List arches = params.ARCHES.tokenize(',') +def errorMessages = '' def config = TestUtils.getProvisioningConfig(this) TestUtils.runParallelMultiArchTest( @@ -60,18 +61,16 @@ TestUtils.runParallelMultiArchTest( /* TEST BODY */ /* @param host Provisioned host details. */ /*********************************************************/ - dir('test') { - stage ('Download Test Files') { - downloadTests() - } + stage ('Download Test Files') { + downloadTests() + } - stage ('Run Test') { - runTests(config, host) - } + stage ('Run Test') { + runTests(config, host) + } - stage ('Archive Test Output') { - archiveOutput() - } + stage ('Archive Test Output') { + archiveOutput() } /*****************************************************************/ @@ -80,7 +79,8 @@ TestUtils.runParallelMultiArchTest( /*****************************************************************/ }, { Exception exception, def host -> - echo "Exception ${exception} occured on ${host.arch}" + def error = "Exception ${exception} occured on ${host.arch}\n" + errorMessages += error if (host.arch.equals("x86_64") || host.arch.equals("ppc64le")) { currentBuild.result = 'FAILURE' } diff --git a/tests/ansible-playbooks/example-test/playbook.yml b/tests/ansible-playbooks/example-test/playbook.yml deleted file mode 100644 index 194682c..0000000 --- a/tests/ansible-playbooks/example-test/playbook.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Example Test - hosts: all - gather_facts: true - - tasks: - - debug: msg="{{ playbook_dir }}" - - - name: Create output directory - file: path="{{ playbook_dir}}/artifacts" state=directory mode=0755 - - - template: - src: "{{ playbook_dir }}/templates/example-test.j2" - dest: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" - mode: 0644 - - - fetch: - src: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" - dest: "{{ playbook_dir }}/artifacts/{{ ansible_architecture }}-test_{{ inventory_hostname }}.txt" - flat: yes diff --git a/tests/ansible-playbooks/host-summary/playbook.yml b/tests/ansible-playbooks/host-summary/playbook.yml new file mode 100644 index 0000000..a76896d --- /dev/null +++ b/tests/ansible-playbooks/host-summary/playbook.yml @@ -0,0 +1,20 @@ +--- +- name: Host Summary + hosts: all + gather_facts: true + + tasks: + - debug: msg="{{ playbook_dir }}" + + - name: Create output directory + file: path="{{ playbook_dir}}/artifacts/host-summary" state=directory mode=0755 + + - template: + src: "{{ playbook_dir }}/templates/host-summary.j2" + dest: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}.txt" + mode: 0644 + + - fetch: + src: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}.txt" + dest: "{{ playbook_dir }}/artifacts/host-summary/{{ ansible_architecture }}.txt" + flat: yes diff --git a/tests/ansible-playbooks/example-test/templates/example-test.j2 b/tests/ansible-playbooks/host-summary/templates/host-summary.j2 similarity index 75% rename from tests/ansible-playbooks/example-test/templates/example-test.j2 rename to tests/ansible-playbooks/host-summary/templates/host-summary.j2 index 45cecf0..f6bb53e 100644 --- a/tests/ansible-playbooks/example-test/templates/example-test.j2 +++ b/tests/ansible-playbooks/host-summary/templates/host-summary.j2 @@ -1,4 +1,4 @@ -Subject: Example Test [System Architecture="{{ ansible_architecture }}"] +Subject: Host Summary [System Architecture="{{ ansible_architecture }}"] Report Date: "{{ansible_date_time.date}}"