From b17b129dad3784e5bbefd5fb70648b7647eb4b70 Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 15:11:32 +0800 Subject: [PATCH 01/13] Decouple coverage from test script --- .travis.yml | 9 +++++++-- Dockerfile-maya2016 | 4 ++-- test_docker.sh | 20 ++++++++++++-------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index cdd82ab01..499af513b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,24 @@ language: python python: - - 2.7 + - 3.7 services: - docker install: + - pip install coverage coveralls - docker run --name avalon-mongo -d mongo - - docker build -t avalon/core -f Dockerfile-maya2016 . + - docker build -t avalon/core:maya -f Dockerfile-maya2016 . script: - . test_docker.sh - . build_docs.sh +after_success: + - coverage combine + - coveralls + before_deploy: - sudo chmod -R 777 docs/build/ - cd docs/build diff --git a/Dockerfile-maya2016 b/Dockerfile-maya2016 index 4fa343ca8..07e33f346 100644 --- a/Dockerfile-maya2016 +++ b/Dockerfile-maya2016 @@ -22,5 +22,5 @@ ENV PYTHONDONTWRITEBYTECODE=1 WORKDIR /workspace ENTRYPOINT \ - PYTHONPATH=$(pwd):$PYTHONPATH mayapy -u run_maya_tests.py && \ - mayapy -c "import sys, os, coveralls;coveralls.wear() if os.getenv('TRAVIS_JOB_ID') else sys.stdout.write('Skipping coveralls')" + PYTHONPATH=$(pwd):$PYTHONPATH && \ + mayapy -u run_maya_tests.py diff --git a/test_docker.sh b/test_docker.sh index 51078c027..de6e1d8e5 100644 --- a/test_docker.sh +++ b/test_docker.sh @@ -1,9 +1,13 @@ + +# Run Maya test docker run \ - --rm \ - -v $(pwd):/workspace \ - --link avalon-mongo:mongo \ - -e COVERALLS_REPO_TOKEN \ - -e TRAVIS_JOB_ID \ - -e AVALON_SILENT \ - -e AVALON_MONGO=mongodb://mongo:27017 \ - avalon/core \ No newline at end of file + --rm \ + --volume $(pwd):/workspace \ + --link avalon-mongo:mongo \ + --env AVALON_SILENT \ + --env AVALON_MONGO=mongodb://mongo:27017 \ + avalon/core:maya +# Rename coverage data file and will be combined later +mv .coverage .coverage.maya + +# docker run other DCC tools.. From 97cf4af167bf90b85e3fd4fa9a5904f60b79b047 Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 15:11:51 +0800 Subject: [PATCH 02/13] Unpin all package --- Dockerfile-maya2016 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Dockerfile-maya2016 b/Dockerfile-maya2016 index 07e33f346..4a282a832 100644 --- a/Dockerfile-maya2016 +++ b/Dockerfile-maya2016 @@ -5,16 +5,13 @@ RUN wget https://bootstrap.pypa.io/get-pip.py && \ mayapy -m pip install \ nose \ nose-exclude \ - coverage==4.5.4 \ - pyblish-base==1.4.2 \ + coverage \ + pyblish-base \ pyblish-maya \ pymongo \ - # Sphinx 1.8.0 fail to build doc, pin version to 1.7.9 - # see https://github.com/sphinx-doc/sphinx/issues/5417 - sphinx==1.7.9 \ + sphinx \ six \ - sphinxcontrib-napoleon \ - python-coveralls + sphinxcontrib-napoleon # Avoid creation of auxilliary files ENV PYTHONDONTWRITEBYTECODE=1 From df78a934aa681b4e16e9dd939159ac66602871f6 Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 15:25:52 +0800 Subject: [PATCH 03/13] Reuse script --- .travis.yml | 2 +- build_docker.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 499af513b..41722a689 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ services: install: - pip install coverage coveralls - docker run --name avalon-mongo -d mongo - - docker build -t avalon/core:maya -f Dockerfile-maya2016 . + - . build_docker.sh script: - . test_docker.sh diff --git a/build_docker.sh b/build_docker.sh index 8bdd68214..954290b83 100644 --- a/build_docker.sh +++ b/build_docker.sh @@ -1 +1 @@ -docker build -t avalon/core -f Dockerfile-maya2016 . \ No newline at end of file +docker build -t avalon/core:maya -f Dockerfile-maya2016 . \ No newline at end of file From 4ca506e9adf4d114ea9cf084ba33b508b3136108 Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 15:26:11 +0800 Subject: [PATCH 04/13] Fix docker tag --- build_docs.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build_docs.sh b/build_docs.sh index 12fc477ce..13eb1e76e 100644 --- a/build_docs.sh +++ b/build_docs.sh @@ -1,11 +1,11 @@ docker run \ - --rm \ - -v $(pwd):/workspace \ - --link avalon-mongo:mongo \ - -e AVALON_SILENT \ - -e AVALON_MONGO=mongodb://mongo:27017 \ - -e PYTHONPATH=/workspace:/usr/local/lib/python2.6/site-packages \ - --entrypoint mayapy \ - --workdir /workspace/docs \ - avalon/core \ - -m sphinx source build -E -v \ No newline at end of file + --rm \ + --volume $(pwd):/workspace \ + --link avalon-mongo:mongo \ + --env AVALON_SILENT \ + --env AVALON_MONGO=mongodb://mongo:27017 \ + --env PYTHONPATH=/workspace:/usr/local/lib/python2.6/site-packages \ + --entrypoint mayapy \ + --workdir /workspace/docs \ + avalon/core:maya \ + -m sphinx source build -E -v From 85f289151343f96db9f0b1605a69f4167f510177 Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 15:26:19 +0800 Subject: [PATCH 05/13] Fix typo --- Dockerfile-maya2016 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-maya2016 b/Dockerfile-maya2016 index 4a282a832..910f6cc17 100644 --- a/Dockerfile-maya2016 +++ b/Dockerfile-maya2016 @@ -13,7 +13,7 @@ RUN wget https://bootstrap.pypa.io/get-pip.py && \ six \ sphinxcontrib-napoleon -# Avoid creation of auxilliary files +# Avoid creation of auxiliary files ENV PYTHONDONTWRITEBYTECODE=1 WORKDIR /workspace From 008e51bc71312ce04fbd95810cbe8f490c1e794e Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 16:17:32 +0800 Subject: [PATCH 06/13] Remap source root in coverage data --- .coveragerc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.coveragerc b/.coveragerc index cc8393cd1..e644c0010 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,9 +1,15 @@ [run] source = avalon +[paths] +# Remap source root path in docker +source = + avalon + /workspace/avalon + [report] include = *avalon* omit = */vendor* */tests* - */run_* \ No newline at end of file + */run_* From ebd993e804c26c4f90ec85aa51e72908bb0a3d41 Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 16:58:09 +0800 Subject: [PATCH 07/13] Migrate to macOS 10.15 in azure ci --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0f395298a..aef5b3e72 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -54,7 +54,7 @@ jobs: - job: MacOS pool: - vmImage: "macOS-10.13" # High-Sierra + vmImage: "macOS-10.15" # Catalina strategy: matrix: Python27: From 60933104664ecc46767e5c70534eb3a27756401f Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 17:26:53 +0800 Subject: [PATCH 08/13] Fix coverage not being submitted --- test_docker.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test_docker.sh b/test_docker.sh index de6e1d8e5..407f0e68d 100644 --- a/test_docker.sh +++ b/test_docker.sh @@ -6,6 +6,9 @@ docker run \ --link avalon-mongo:mongo \ --env AVALON_SILENT \ --env AVALON_MONGO=mongodb://mongo:27017 \ + --env TRAVIS_JOB_ID \ + --env TRAVIS_BRANCH \ + --env COVERALLS_REPO_TOKEN \ avalon/core:maya # Rename coverage data file and will be combined later mv .coverage .coverage.maya From fd46f9394f443f9797db03b15454fdf8a24c910e Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 18:12:06 +0800 Subject: [PATCH 09/13] Fix coverage submission --- .travis.yml | 4 ++++ test_docker.sh | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 41722a689..6468fc0e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,10 @@ language: python python: - 3.7 +env: + global: + - COVERALLS_SERVICE_NAME=travis-ci + services: - docker diff --git a/test_docker.sh b/test_docker.sh index 407f0e68d..de6e1d8e5 100644 --- a/test_docker.sh +++ b/test_docker.sh @@ -6,9 +6,6 @@ docker run \ --link avalon-mongo:mongo \ --env AVALON_SILENT \ --env AVALON_MONGO=mongodb://mongo:27017 \ - --env TRAVIS_JOB_ID \ - --env TRAVIS_BRANCH \ - --env COVERALLS_REPO_TOKEN \ avalon/core:maya # Rename coverage data file and will be combined later mv .coverage .coverage.maya From 1c83ce186fbfd2e2c589d013acb932f43bc3b52a Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 19:13:57 +0800 Subject: [PATCH 10/13] coveralls debug --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6468fc0e2..acaf5b099 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ script: after_success: - coverage combine - - coveralls + - coveralls debug before_deploy: - sudo chmod -R 777 docs/build/ From 5a489196656fc7d95cf7e0f26e41915a07afc01b Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 19:37:48 +0800 Subject: [PATCH 11/13] Change to use python-coveralls --- .travis.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index acaf5b099..2df0de7e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,15 +3,11 @@ language: python python: - 3.7 -env: - global: - - COVERALLS_SERVICE_NAME=travis-ci - services: - docker install: - - pip install coverage coveralls + - pip install coverage python-coveralls - docker run --name avalon-mongo -d mongo - . build_docker.sh @@ -21,7 +17,7 @@ script: after_success: - coverage combine - - coveralls debug + - coveralls before_deploy: - sudo chmod -R 777 docs/build/ From 834e8a64a64df01db3340cad304ffb16fa6491e2 Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 27 Jul 2020 19:49:34 +0800 Subject: [PATCH 12/13] Pin coverage We need to pin it at this version since the newer version has refactored `Reporter` class which not yet adopted by `python-coveralls`.. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2df0de7e2..cb98fb6f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ services: - docker install: - - pip install coverage python-coveralls + - pip install coverage==4.5.4 + - pip install python-coveralls - docker run --name avalon-mongo -d mongo - . build_docker.sh From 0e3b5742041e6018a4d889cb4e771263f0a79a55 Mon Sep 17 00:00:00 2001 From: Marcus Ottosson Date: Thu, 30 Jul 2020 12:06:03 +0100 Subject: [PATCH 13/13] Poke at coveralls.io