Repository: joblib/joblib
Pull request #497 (2017-02-15 13:26:50)

[MRG] Enable codecov on AppVeyor
Having intermittent problems with errors on AppVeyor that I can not reproduce locally .... :angry: 

lesteve: On top of that codecov seems to undergo a "minor service outage" at the moment: http://status.codecov.io/
aabadie: looks like a duplicate of #496 ?
lesteve: Hmmm I thought I would create the PR, be it only to advertise that I started working on it ... not soon enough apparently, oh well ...

I would rather test the package to avoid setup.py issues like missing data files.
codecov[bot]: # [Codecov](https://codecov.io/gh/joblib/joblib/pull/497?src=pr&el=h1) Report
> Merging [#497](https://codecov.io/gh/joblib/joblib/pull/497?src=pr&el=desc) into [master](https://codecov.io/gh/joblib/joblib/commit/a5e0921f4dd34b003caeb57cab893c5b1c079bf6?src=pr&el=desc) will **decrease** coverage by `-3.32%`.
> The diff coverage is `n/a`.


```diff
@@            Coverage Diff             @@
##           master     #497      +/-   ##
==========================================
- Coverage   93.26%   89.95%   -3.32%     
==========================================
  Files          36       36              
  Lines        4680     4680              
==========================================
- Hits         4365     4210     -155     
- Misses        315      470     +155
```


| [Impacted Files](https://codecov.io/gh/joblib/joblib/pull/497?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [joblib/_memory_helpers.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL19tZW1vcnlfaGVscGVycy5weQ==) | `3.07% <ø> (-70.77%)` | :x: |
| [joblib/test/common.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL3Rlc3QvY29tbW9uLnB5) | `63.46% <ø> (-21.16%)` | :x: |
| [joblib/_multiprocessing_helpers.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL19tdWx0aXByb2Nlc3NpbmdfaGVscGVycy5weQ==) | `66.66% <ø> (-9.53%)` | :x: |
| [joblib/_compat.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL19jb21wYXQucHk=) | `90.9% <ø> (-9.1%)` | :x: |
| [joblib/backports.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL2JhY2twb3J0cy5weQ==) | `31.25% <ø> (-8.34%)` | :x: |
| [joblib/func_inspect.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL2Z1bmNfaW5zcGVjdC5weQ==) | `81.97% <ø> (-6.98%)` | :x: |
| [joblib/hashing.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL2hhc2hpbmcucHk=) | `87.71% <ø> (-5.27%)` | :x: |
| [joblib/numpy_pickle.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL251bXB5X3BpY2tsZS5weQ==) | `93.9% <ø> (-4.57%)` | :x: |
| [joblib/pool.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL3Bvb2wucHk=) | `85.88% <ø> (-4.44%)` | :x: |
| [joblib/test/test_numpy_pickle.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL3Rlc3QvdGVzdF9udW1weV9waWNrbGUucHk=) | `94.63% <ø> (-4.41%)` | :x: |
| ... and [9 more](https://codecov.io/gh/joblib/joblib/pull/497/changes?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/joblib/joblib/pull/497?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/joblib/joblib/pull/497?src=pr&el=footer). Last update [a5e0921...272f040](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...272f040c2031441ca8cbcdc1c94c983e7c542d7f?src=pr&el=footer&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
codecov[bot]: # [Codecov](https://codecov.io/gh/joblib/joblib/pull/497?src=pr&el=h1) Report
> Merging [#497](https://codecov.io/gh/joblib/joblib/pull/497?src=pr&el=desc) into [master](https://codecov.io/gh/joblib/joblib/commit/a5e0921f4dd34b003caeb57cab893c5b1c079bf6?src=pr&el=desc) will **decrease** coverage by `-3.32%`.
> The diff coverage is `n/a`.


```diff
@@            Coverage Diff             @@
##           master     #497      +/-   ##
==========================================
- Coverage   93.26%   89.95%   -3.32%     
==========================================
  Files          36       36              
  Lines        4680     4680              
==========================================
- Hits         4365     4210     -155     
- Misses        315      470     +155
```


| [Impacted Files](https://codecov.io/gh/joblib/joblib/pull/497?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [joblib/_memory_helpers.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL19tZW1vcnlfaGVscGVycy5weQ==) | `3.07% <ø> (-70.77%)` | :x: |
| [joblib/test/common.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL3Rlc3QvY29tbW9uLnB5) | `63.46% <ø> (-21.16%)` | :x: |
| [joblib/_multiprocessing_helpers.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL19tdWx0aXByb2Nlc3NpbmdfaGVscGVycy5weQ==) | `66.66% <ø> (-9.53%)` | :x: |
| [joblib/_compat.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL19jb21wYXQucHk=) | `90.9% <ø> (-9.1%)` | :x: |
| [joblib/backports.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL2JhY2twb3J0cy5weQ==) | `31.25% <ø> (-8.34%)` | :x: |
| [joblib/func_inspect.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL2Z1bmNfaW5zcGVjdC5weQ==) | `81.97% <ø> (-6.98%)` | :x: |
| [joblib/hashing.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL2hhc2hpbmcucHk=) | `87.71% <ø> (-5.27%)` | :x: |
| [joblib/numpy_pickle.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL251bXB5X3BpY2tsZS5weQ==) | `93.9% <ø> (-4.57%)` | :x: |
| [joblib/pool.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL3Bvb2wucHk=) | `85.88% <ø> (-4.44%)` | :x: |
| [joblib/test/test_numpy_pickle.py](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...7fd5b1ac5098039ac228898dceaaba82bb614f8d?src=pr&el=tree#diff-am9ibGliL3Rlc3QvdGVzdF9udW1weV9waWNrbGUucHk=) | `94.63% <ø> (-4.41%)` | :x: |
| ... and [9 more](https://codecov.io/gh/joblib/joblib/pull/497/changes?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/joblib/joblib/pull/497?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/joblib/joblib/pull/497?src=pr&el=footer). Last update [a5e0921...272f040](https://codecov.io/gh/joblib/joblib/compare/a5e0921f4dd34b003caeb57cab893c5b1c079bf6...272f040c2031441ca8cbcdc1c94c983e7c542d7f?el=footer&src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
lesteve: I managed to find a work-around for the problems I was saying. To make a long story short: `ps:` lines should not print to stderr in AppVeyor otherwise this is interpreted as an error.

This seems a feature of Powershell although I don't get this behaviour on my VM ...
ogrisel: LGTM. @aabadie any comment?
lesteve: We probably want to wait for codecov to be back to normal before merging.
aabadie: > @aabadie any comment

yes, the coverage increase (+0.31%) is less than the on hit in #496 (+0.87%). I'm wondering why.

I checked the codecov report on their website. This adds `test/data/create_numpy_pickle.py` to the covered file. I don't understand why.

Maybe it's related to codecov failures today. +1 for waiting for the service to get back to normal.
lesteve: Looks like the discovery of modules is slightly different with the `--pyargs` argument for some reason. This is why joblib/test/data/create_numpy_pickle.py is found as an additional file and the coverage changes slightly.

Also I believe at the moment that our coverage of multiprocessing is not reliable and this explains thhe change joblib/_parallel_backends.py. I started looking at it a week ago but this doesn't seem like some completely straightforward AFAICT.

All in all I think this should be merged.

Patch:
diff --git a/appveyor.yml b/appveyor.yml
index 7c126a2..00a9140 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -30,14 +30,12 @@ install:
 build: false
 
 test_script:
-  # Change to a non-source folder to make sure we run the tests on the
-  # installed library.
-  - "cd C:\\"
-  - "py.test --pyargs joblib"
+  - powershell ./continuous_integration/appveyor/test.ps1
 
 artifacts:
   # Archive the generated wheel package in the ci.appveyor.com build report.
   - path: dist\*
 
-#on_success:
+on_success:
 #  - TODO: upload the content of dist/*.whl to a public wheelhouse
+  - codecov
diff --git a/continuous_integration/appveyor/requirements.txt b/continuous_integration/appveyor/requirements.txt
index fc8abe3..2bd0656 100644
--- a/continuous_integration/appveyor/requirements.txt
+++ b/continuous_integration/appveyor/requirements.txt
@@ -1,3 +1,5 @@
 numpy
 wheel
 pytest
+pytest-cov
+codecov


Test patch:
diff --git a/continuous_integration/appveyor/test.ps1 b/continuous_integration/appveyor/test.ps1
new file mode 100644
index 0000000..03c5551
--- /dev/null
+++ b/continuous_integration/appveyor/test.ps1
@@ -0,0 +1,6 @@
+$installed_joblib_folder = $(python -c "import os; os.chdir('c:/'); import joblib;\
+    print(os.path.dirname(joblib.__file__))")
+echo "joblib found in: $installed_joblib_folder"
+# --pyargs argument is used to make sure we run the tests on the
+# installed package rather than on the local folder
+py.test --pyargs joblib --cov $installed_joblib_folder