From 7e1dbbd0de35fbd40bd21fd54141b98bf473771f Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Thu, 26 Aug 2021 14:04:42 +0200 Subject: [PATCH] CI: copy bifrost logs to the log directory Using them is more convenient than scrolling the whole output, especially in case of upgrades. Change-Id: Ib086f106a0e78d247bac5fa63801c2fecb40efa8 --- playbooks/ci/run.yaml | 2 +- playbooks/ci/upgrade.yaml | 4 ++-- scripts/collect-test-info.sh | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/playbooks/ci/run.yaml b/playbooks/ci/run.yaml index a0e074674..76ddd2655 100644 --- a/playbooks/ci/run.yaml +++ b/playbooks/ci/run.yaml @@ -1,7 +1,7 @@ - hosts: all tasks: - shell: - cmd: bash scripts/test-bifrost.sh + cmd: bash scripts/test-bifrost.sh 2>&1 | tee "{{ ansible_user_dir }}/bifrost.log" chdir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/bifrost'].src_dir }}" environment: BIFROST_TRACE: "true" diff --git a/playbooks/ci/upgrade.yaml b/playbooks/ci/upgrade.yaml index 90e50b7bb..686aeb63a 100644 --- a/playbooks/ci/upgrade.yaml +++ b/playbooks/ci/upgrade.yaml @@ -5,7 +5,7 @@ chdir: "{{ ansible_user_dir }}/{{ item.src_dir }}" loop: "{{ zuul.projects.values() | list }}" when: item.name not in skip_upgrade - - command: bash scripts/test-bifrost.sh + - shell: bash scripts/test-bifrost.sh 2>&1 | tee "{{ ansible_user_dir }}/bifrost-old.log" args: chdir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/bifrost'].src_dir }}" environment: @@ -20,7 +20,7 @@ chdir: "{{ ansible_user_dir }}/{{ item.src_dir }}" loop: "{{ zuul.projects.values() | list }}" when: item.name not in skip_upgrade - - command: bash scripts/test-bifrost.sh + - shell: bash scripts/test-bifrost.sh 2>&1 | tee "{{ ansible_user_dir }}/bifrost-new.log" args: chdir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/bifrost'].src_dir }}" environment: diff --git a/scripts/collect-test-info.sh b/scripts/collect-test-info.sh index b15736198..0ca880c35 100755 --- a/scripts/collect-test-info.sh +++ b/scripts/collect-test-info.sh @@ -14,6 +14,8 @@ VERBOSE_LOGS="${VERBOSE_LOGS:-False}" echo "Making logs directory and collecting logs." [ -d ${LOG_LOCATION} ] || mkdir -p ${LOG_LOCATION} +cp ${LOG_LOCATION}/../bifrost*.log ${LOG_LOCATION} + mkdir -p "$LOG_LOCATION/pip" pip freeze > "$LOG_LOCATION/pip/freeze-default.log" if which pip3 2> /dev/null; then