From 6bbbc014e397c3cd9b078dc8524bfe8a0153a87a Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Mon, 13 Jul 2020 22:07:27 +0000 Subject: [PATCH 1/4] Store coverage on CCI --- .circleci/config.yml | 25 ++++++++++++++++--------- .circleci/config.yml.in | 25 ++++++++++++++++--------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3bf72c3a6d..c4ffe903b7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -424,12 +424,13 @@ jobs: - run: name: Run tests command: .circleci/unittest/linux/scripts/run_test.sh + - store_test_results: + path: test-results - run: name: Post process command: .circleci/unittest/linux/scripts/post_process.sh - - store_test_results: - path: test-results - + - store_artifacts: + path: htmlcov unittest_linux_gpu: <<: *binary_common machine: @@ -456,11 +457,13 @@ jobs: - run: name: Run tests command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/run_test.sh + - store_test_results: + path: test-results - run: name: Post Process command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/post_process.sh - - store_test_results: - path: test-results + - store_artifacts: + path: htmlcov unittest_windows_cpu: <<: *binary_common @@ -479,11 +482,13 @@ jobs: - run: name: Run tests command: .circleci/unittest/windows/scripts/run_test.sh + - store_test_results: + path: test-results - run: name: Post process command: .circleci/unittest/windows/scripts/post_process.sh - - store_test_results: - path: test-results + - store_artifacts: + path: htmlcov unittest_windows_gpu: <<: *binary_common @@ -505,11 +510,13 @@ jobs: - run: name: Run tests command: .circleci/unittest/windows/scripts/run_test.sh + - store_test_results: + path: test-results - run: name: Post process command: .circleci/unittest/windows/scripts/post_process.sh - - store_test_results: - path: test-results + - store_artifacts: + path: htmlcov unittest_macos_cpu: <<: *binary_common diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index 8e01b1da56..e22c4091ea 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -424,12 +424,13 @@ jobs: - run: name: Run tests command: .circleci/unittest/linux/scripts/run_test.sh + - store_test_results: + path: test-results - run: name: Post process command: .circleci/unittest/linux/scripts/post_process.sh - - store_test_results: - path: test-results - + - store_artifacts: + path: htmlcov unittest_linux_gpu: <<: *binary_common machine: @@ -456,11 +457,13 @@ jobs: - run: name: Run tests command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/run_test.sh + - store_test_results: + path: test-results - run: name: Post Process command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/post_process.sh - - store_test_results: - path: test-results + - store_artifacts: + path: htmlcov unittest_windows_cpu: <<: *binary_common @@ -479,11 +482,13 @@ jobs: - run: name: Run tests command: .circleci/unittest/windows/scripts/run_test.sh + - store_test_results: + path: test-results - run: name: Post process command: .circleci/unittest/windows/scripts/post_process.sh - - store_test_results: - path: test-results + - store_artifacts: + path: htmlcov unittest_windows_gpu: <<: *binary_common @@ -505,11 +510,13 @@ jobs: - run: name: Run tests command: .circleci/unittest/windows/scripts/run_test.sh + - store_test_results: + path: test-results - run: name: Post process command: .circleci/unittest/windows/scripts/post_process.sh - - store_test_results: - path: test-results + - store_artifacts: + path: htmlcov unittest_macos_cpu: <<: *binary_common From 3e0c7550141e202500b6b33199328daba0a69749 Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Mon, 19 Apr 2021 17:42:09 +0000 Subject: [PATCH 2/4] Remove post process --- .circleci/config.yml | 17 ++--------------- .circleci/config.yml.in | 17 ++--------------- .../unittest/linux/scripts/post_process.sh | 8 -------- .../unittest/windows/scripts/post_process.sh | 8 -------- 4 files changed, 4 insertions(+), 46 deletions(-) delete mode 100755 .circleci/unittest/linux/scripts/post_process.sh delete mode 100644 .circleci/unittest/windows/scripts/post_process.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index c4ffe903b7..322ee23c21 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -426,9 +426,6 @@ jobs: command: .circleci/unittest/linux/scripts/run_test.sh - store_test_results: path: test-results - - run: - name: Post process - command: .circleci/unittest/linux/scripts/post_process.sh - store_artifacts: path: htmlcov unittest_linux_gpu: @@ -459,9 +456,6 @@ jobs: command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/run_test.sh - store_test_results: path: test-results - - run: - name: Post Process - command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/post_process.sh - store_artifacts: path: htmlcov @@ -484,9 +478,6 @@ jobs: command: .circleci/unittest/windows/scripts/run_test.sh - store_test_results: path: test-results - - run: - name: Post process - command: .circleci/unittest/windows/scripts/post_process.sh - store_artifacts: path: htmlcov @@ -512,9 +503,6 @@ jobs: command: .circleci/unittest/windows/scripts/run_test.sh - store_test_results: path: test-results - - run: - name: Post process - command: .circleci/unittest/windows/scripts/post_process.sh - store_artifacts: path: htmlcov @@ -539,11 +527,10 @@ jobs: - run: name: Run tests command: .circleci/unittest/linux/scripts/run_test.sh - - run: - name: Post process - command: .circleci/unittest/linux/scripts/post_process.sh - store_test_results: path: test-results + - store_artifacts: + path: htmlcov stylecheck: <<: *binary_common diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index e22c4091ea..68a618c978 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -426,9 +426,6 @@ jobs: command: .circleci/unittest/linux/scripts/run_test.sh - store_test_results: path: test-results - - run: - name: Post process - command: .circleci/unittest/linux/scripts/post_process.sh - store_artifacts: path: htmlcov unittest_linux_gpu: @@ -459,9 +456,6 @@ jobs: command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/run_test.sh - store_test_results: path: test-results - - run: - name: Post Process - command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/post_process.sh - store_artifacts: path: htmlcov @@ -484,9 +478,6 @@ jobs: command: .circleci/unittest/windows/scripts/run_test.sh - store_test_results: path: test-results - - run: - name: Post process - command: .circleci/unittest/windows/scripts/post_process.sh - store_artifacts: path: htmlcov @@ -512,9 +503,6 @@ jobs: command: .circleci/unittest/windows/scripts/run_test.sh - store_test_results: path: test-results - - run: - name: Post process - command: .circleci/unittest/windows/scripts/post_process.sh - store_artifacts: path: htmlcov @@ -539,11 +527,10 @@ jobs: - run: name: Run tests command: .circleci/unittest/linux/scripts/run_test.sh - - run: - name: Post process - command: .circleci/unittest/linux/scripts/post_process.sh - store_test_results: path: test-results + - store_artifacts: + path: htmlcov stylecheck: <<: *binary_common diff --git a/.circleci/unittest/linux/scripts/post_process.sh b/.circleci/unittest/linux/scripts/post_process.sh deleted file mode 100755 index a84a0dea55..0000000000 --- a/.circleci/unittest/linux/scripts/post_process.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e - -eval "$(./conda/bin/conda shell.bash hook)" -conda activate ./env - -codecov diff --git a/.circleci/unittest/windows/scripts/post_process.sh b/.circleci/unittest/windows/scripts/post_process.sh deleted file mode 100644 index b132113194..0000000000 --- a/.circleci/unittest/windows/scripts/post_process.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e - -eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')" -conda activate ./env - -codecov From 41ecef2495ca6c8dc83540044c4f6e856909a592 Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Mon, 19 Apr 2021 19:15:58 +0000 Subject: [PATCH 3/4] Fix htmlcov generation --- .circleci/unittest/linux/scripts/install.sh | 2 +- .circleci/unittest/linux/scripts/run_test.sh | 1 + .circleci/unittest/windows/scripts/install.sh | 2 +- .circleci/unittest/windows/scripts/run_test.sh | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/unittest/linux/scripts/install.sh b/.circleci/unittest/linux/scripts/install.sh index 5638a28850..3b0cd4bc4c 100755 --- a/.circleci/unittest/linux/scripts/install.sh +++ b/.circleci/unittest/linux/scripts/install.sh @@ -56,5 +56,5 @@ fi ( set -x conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} 'librosa>=0.8.0' parameterized 'requests>=2.20' - pip install kaldi-io SoundFile codecov pytest pytest-cov scipy + pip install kaldi-io SoundFile coverage pytest pytest-cov scipy ) diff --git a/.circleci/unittest/linux/scripts/run_test.sh b/.circleci/unittest/linux/scripts/run_test.sh index e083743630..4e8d24748b 100755 --- a/.circleci/unittest/linux/scripts/run_test.sh +++ b/.circleci/unittest/linux/scripts/run_test.sh @@ -24,3 +24,4 @@ declare -a args=( cd test pytest "${args[@]}" torchaudio_unittest +coverage html diff --git a/.circleci/unittest/windows/scripts/install.sh b/.circleci/unittest/windows/scripts/install.sh index be0c890614..9ed4f203ad 100644 --- a/.circleci/unittest/windows/scripts/install.sh +++ b/.circleci/unittest/windows/scripts/install.sh @@ -44,5 +44,5 @@ fi ( set -x conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} 'librosa>=0.8.0' parameterized 'requests>=2.20' - pip install kaldi-io SoundFile codecov pytest pytest-cov scipy + pip install kaldi-io SoundFile coverage pytest pytest-cov scipy ) diff --git a/.circleci/unittest/windows/scripts/run_test.sh b/.circleci/unittest/windows/scripts/run_test.sh index 7fdd1d4c6d..c6e7ffd37f 100644 --- a/.circleci/unittest/windows/scripts/run_test.sh +++ b/.circleci/unittest/windows/scripts/run_test.sh @@ -8,3 +8,4 @@ conda activate ./env python -m torch.utils.collect_env cd test pytest --cov=torchaudio --junitxml=../test-results/junit.xml -v --durations 20 torchaudio_unittest +coverage html From 975bd326e2fe508ec90c7bf080ce89e316b0479a Mon Sep 17 00:00:00 2001 From: moto <855818+mthrok@users.noreply.github.com> Date: Mon, 19 Apr 2021 20:05:00 +0000 Subject: [PATCH 4/4] Fix --- .circleci/config.yml | 10 +++++----- .circleci/config.yml.in | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 322ee23c21..2cbddf2e3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -427,7 +427,7 @@ jobs: - store_test_results: path: test-results - store_artifacts: - path: htmlcov + path: test/htmlcov unittest_linux_gpu: <<: *binary_common machine: @@ -457,7 +457,7 @@ jobs: - store_test_results: path: test-results - store_artifacts: - path: htmlcov + path: test/htmlcov unittest_windows_cpu: <<: *binary_common @@ -479,7 +479,7 @@ jobs: - store_test_results: path: test-results - store_artifacts: - path: htmlcov + path: test/htmlcov unittest_windows_gpu: <<: *binary_common @@ -504,7 +504,7 @@ jobs: - store_test_results: path: test-results - store_artifacts: - path: htmlcov + path: test/htmlcov unittest_macos_cpu: <<: *binary_common @@ -530,7 +530,7 @@ jobs: - store_test_results: path: test-results - store_artifacts: - path: htmlcov + path: test/htmlcov stylecheck: <<: *binary_common diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index 68a618c978..f15767041e 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -427,7 +427,7 @@ jobs: - store_test_results: path: test-results - store_artifacts: - path: htmlcov + path: test/htmlcov unittest_linux_gpu: <<: *binary_common machine: @@ -457,7 +457,7 @@ jobs: - store_test_results: path: test-results - store_artifacts: - path: htmlcov + path: test/htmlcov unittest_windows_cpu: <<: *binary_common @@ -479,7 +479,7 @@ jobs: - store_test_results: path: test-results - store_artifacts: - path: htmlcov + path: test/htmlcov unittest_windows_gpu: <<: *binary_common @@ -504,7 +504,7 @@ jobs: - store_test_results: path: test-results - store_artifacts: - path: htmlcov + path: test/htmlcov unittest_macos_cpu: <<: *binary_common @@ -530,7 +530,7 @@ jobs: - store_test_results: path: test-results - store_artifacts: - path: htmlcov + path: test/htmlcov stylecheck: <<: *binary_common