From e840f8fcb0e13b0b5f6397bbec547d1b1b0f077e Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Wed, 12 Feb 2020 16:09:22 -0800 Subject: [PATCH] ci: Add verbosity to pytest results, store in ci Makes the pytest runs for building conda packages more verbose and stores the results for viewing inside of CircleCI Signed-off-by: Eli Uriegas --- .circleci/config.yml | 6 ++++++ .circleci/config.yml.in | 6 ++++++ packaging/build_conda.sh | 1 + packaging/pkg_helpers.bash | 6 ++++++ packaging/torchvision/meta.yaml | 2 +- 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 461bd6f9cb7..364cdd5f0b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,6 +105,8 @@ jobs: root: /opt/conda/conda-bld/linux-64 paths: - "*" + - store_test_results: + path: build_results/ binary_linux_conda_cuda: <<: *binary_common @@ -190,6 +192,8 @@ jobs: conda install -yq conda-build "conda-package-handling!=1.5.0" bash packaging/build_conda.sh shell: powershell.exe + - store_test_results: + path: build_results/ binary_win_conda_cuda: <<: *binary_common @@ -246,6 +250,8 @@ jobs: root: /Users/distiller/miniconda3/conda-bld/osx-64 paths: - "*" + - store_test_results: + path: build_results/ # Requires org-member context binary_conda_upload: diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index e3747134c6f..de5ec111684 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -105,6 +105,8 @@ jobs: root: /opt/conda/conda-bld/linux-64 paths: - "*" + - store_test_results: + path: build_results/ binary_linux_conda_cuda: <<: *binary_common @@ -190,6 +192,8 @@ jobs: conda install -yq conda-build "conda-package-handling!=1.5.0" bash packaging/build_conda.sh shell: powershell.exe + - store_test_results: + path: build_results/ binary_win_conda_cuda: <<: *binary_common @@ -246,6 +250,8 @@ jobs: root: /Users/distiller/miniconda3/conda-bld/osx-64 paths: - "*" + - store_test_results: + path: build_results/ # Requires org-member context binary_conda_upload: diff --git a/packaging/build_conda.sh b/packaging/build_conda.sh index 61022f3c5fa..9ec011d7d75 100755 --- a/packaging/build_conda.sh +++ b/packaging/build_conda.sh @@ -10,4 +10,5 @@ export SOURCE_ROOT_DIR="$PWD" setup_conda_pytorch_constraint setup_conda_cudatoolkit_constraint setup_visual_studio_constraint +setup_junit_results_folder conda build $CONDA_CHANNEL_FLAGS -c defaults -c conda-forge --no-anaconda-upload --python "$PYTHON_VERSION" packaging/torchvision diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash index 7fe47970359..d13e77cb637 100644 --- a/packaging/pkg_helpers.bash +++ b/packaging/pkg_helpers.bash @@ -270,3 +270,9 @@ setup_visual_studio_constraint() { cp packaging/$VSTOOLCHAIN_PACKAGE/conda_build_config.yaml packaging/torchvision/conda_build_config.yaml fi } + +setup_junit_results_folder() { + if [[ "$CI" == "true" ]]; then + export CONDA_PYTORCH_BUILD_RESULTS_DIRECTORY="${SOURCE_ROOT_DIR}/build_results/results.xml" + fi +} diff --git a/packaging/torchvision/meta.yaml b/packaging/torchvision/meta.yaml index 1bc199e437b..a97bc429e32 100644 --- a/packaging/torchvision/meta.yaml +++ b/packaging/torchvision/meta.yaml @@ -49,7 +49,7 @@ test: - ca-certificates {{ environ.get('CONDA_TYPING_CONSTRAINT') }} commands: - pytest . + pytest . --verbose --junitxml={{ environ.get("CONDA_PYTORCH_BUILD_RESULTS_DIRECTORY", "build/test_results.xml" )}} about: