From bbca430417bb17d2c8b9cff9cc10cccd262acea3 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 8 Jan 2020 09:22:45 -0800 Subject: [PATCH] Stop compressing files during intermediate steps part 1 Stop compressing files that would otherwise be handled uncompressed in intermediate log handling. The reason for this is final log/artifact upload should decide if a file need to be compressed or not as some file hosting services (like swift) may not return the expected data if we get this wrong. This was noticed when we used swift to store intermediate tar.gz tarballs before final upload to permanent storage. When retrieving the tar.gz files from swift we got them back as uncompressed .tar files (because swift was being helpful) and then later when we try to uncompress these files we break. Instead we'll let the upload to swift (or other storage) decide if files should be compressed further than their existing state. This is the first change in the stack that updates this behavior for fetch-subunit-output. Change-Id: I5727b270d6d34c256fe78a443baa1ad6c3474108 --- roles/fetch-subunit-output/tasks/process.yaml | 7 +------ .../base-roles/fetch-subunit-output.yaml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/roles/fetch-subunit-output/tasks/process.yaml b/roles/fetch-subunit-output/tasks/process.yaml index 71edd0aef..4556afc40 100644 --- a/roles/fetch-subunit-output/tasks/process.yaml +++ b/roles/fetch-subunit-output/tasks/process.yaml @@ -16,15 +16,10 @@ - testrepository.subunit register: subunit_files -- name: Compress subunit files - archive: - path: "{{ item.path }}" - with_items: "{{ subunit_files.files }}" - - name: Collect test-results synchronize: dest: "{{ zuul.executor.log_root }}" mode: pull - src: "{{ item.path }}.gz" + src: "{{ item.path }}" verify_host: true with_items: "{{ subunit_files.files }}" diff --git a/test-playbooks/base-roles/fetch-subunit-output.yaml b/test-playbooks/base-roles/fetch-subunit-output.yaml index 580191feb..cd2e4cdd5 100644 --- a/test-playbooks/base-roles/fetch-subunit-output.yaml +++ b/test-playbooks/base-roles/fetch-subunit-output.yaml @@ -45,14 +45,14 @@ - name: Check that the testrepository file has been pulled delegate_to: localhost file: - path: "{{ zuul.executor.log_root }}/testrepository.subunit.gz" + path: "{{ zuul.executor.log_root }}/testrepository.subunit" state: file register: local_subunit_file - name: Check that HTML test result file has been pulled delegate_to: localhost file: - path: "{{ zuul.executor.log_root }}/testr_results.html.gz" + path: "{{ zuul.executor.log_root }}/testr_results.html" state: file register: local_html_test_results @@ -70,10 +70,10 @@ shell: | GLOBAL_RESULT=1 zgrep -q -E 'subunit_tests.test_working.WorkingTest.test_success$' \ - {{ zuul.executor.log_root }}/testr_results.html.gz + {{ zuul.executor.log_root }}/testr_results.html T1=$? zgrep -q -E 'subunit_tests.test_failing.FailingTest.test_failure.*_StringException:' \ - {{ zuul.executor.log_root }}/testr_results.html.gz + {{ zuul.executor.log_root }}/testr_results.html T2=$? if [ ${T1} -eq 0 ] && [ ${T2} -ne 0 ]; then GLOBAL_RESULT=0 @@ -92,14 +92,14 @@ - name: Check that the testrepository file has been pulled delegate_to: localhost file: - path: "{{ zuul.executor.log_root }}/testrepository.subunit.gz" + path: "{{ zuul.executor.log_root }}/testrepository.subunit" state: file register: local_subunit_file - name: Check that HTML test result file has been pulled delegate_to: localhost file: - path: "{{ zuul.executor.log_root }}/testr_results.html.gz" + path: "{{ zuul.executor.log_root }}/testr_results.html" state: file register: local_html_test_results @@ -116,10 +116,10 @@ shell: | GLOBAL_RESULT=1 zgrep -q -E 'subunit_tests.test_working.WorkingTest.test_success$' \ - {{ zuul.executor.log_root }}/testr_results.html.gz + {{ zuul.executor.log_root }}/testr_results.html T1=$? zgrep -q -E 'subunit_tests.test_failing.FailingTest.test_failure.*_StringException:' \ - {{ zuul.executor.log_root }}/testr_results.html.gz + {{ zuul.executor.log_root }}/testr_results.html T2=$? if [ ${T1} -eq 0 ] && [ ${T2} -eq 0 ]; then GLOBAL_RESULT=0