Skip to content

Coverage & CI Setup Improvement #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Conversation

vmuriart
Copy link
Contributor

@vmuriart vmuriart commented Jan 27, 2017

What does this implement/fix? Explain your changes.

  • Add coverage (cs code limited to windows, no mature coverage tools for mono)
  • Cleans up CI configurations
  • Speeds up Travis ~30% by using containers
  • Simplifies and unfreezes mono setup
  • Speed up AppVeyor by 50% by not downloading and building with miniconda.

Does this close any currently open issues?

#237
#334

Any other comments?

Sample coverage report.

Checklist

Check all those that are applicable and complete.

@vmuriart vmuriart self-assigned this Jan 27, 2017
@codecov-io
Copy link

codecov-io commented Jan 27, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@ef133a3).

@@           Coverage Diff            @@
##             master    #335   +/-   ##
========================================
  Coverage          ?   61.1%           
========================================
  Files             ?      61           
  Lines             ?    5324           
  Branches          ?     897           
========================================
  Hits              ?    3253           
  Misses            ?    1832           
  Partials          ?     239

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef133a3...44ba698. Read the comment docs.

- sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install mono-devel mono-complete referenceassemblies-pcl ca-certificates-mono nunit-console
env:
global:
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain the purpose of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can help get a bit more info on the tracebacks:
http://stackoverflow.com/a/18947029/5208670

@den-run-ai
Copy link
Contributor

@vmuriart this pull request removes the conda packages. Is there any reason for this?

@den-run-ai
Copy link
Contributor

@vmuriart can we break this into 2 PR? one for code coverage and one for build improvements?

@vmuriart
Copy link
Contributor Author

The conda packaging is what makes the builds the AppVeyor extremely slow and we don't even use them for testing. Do we need them as part of the CI?

@den-run-ai
Copy link
Contributor

den-run-ai commented Jan 29, 2017

@vmuriart we build conda packages, and provide the recipe and downloadable binaries (from appveyor artifacts) for everyone to use in this project. @filmor was very happy about conda support. we do not test conda package, but could add couple lines in appveyor.yml to do this.

Regarding the low speed of the builds - we can re-use installed Miniconda environments from appveyor CI.

It is also important to show how the conda recipe is used to build the package, since this is not trivial.

Finally I plan to extend this conda recipe to conda-forge.

@vmuriart
Copy link
Contributor Author

I tried using the built in miniconda's, they were incomplete (don't have the build command 😞.

I thought the interest on the original pr was to create the recipe for miniconda (which is still with the package). @filmor can clarify a bit more on this.

If the intent though really is for AppVeyor to build the miniconda packages, we can have them build only on pr or when the build was triggered by a schedule (ie, they would be built once a day)

@den-run-ai
Copy link
Contributor

den-run-ai commented Jan 29, 2017 via email

@vmuriart
Copy link
Contributor Author

vmuriart commented Jan 29, 2017

Long-term, moving this to conda-forge is probably the better way. For now I rewrote the pull request to keep conda-build part of the CI, but only build them if its part of a Pull Request.

On my fork they weren't building, but it did once it was uploaded to this pull request.
It makes more sense to build on pull requests than on a scheduled basis, since the scheduled one will probably keep rebuilding the same unchanged branch.

@vmuriart
Copy link
Contributor Author

whoops, deleted the wrong branch earlier. sorry

Copy link
Member

@filmor filmor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I think we should have most if not all testing integrated into the conda build recipe. That could simplify the travis and appveyor configuration quite a bit

- PYTHON_VERSION: 3.3
- PYTHON_VERSION: 3.4
- PYTHON_VERSION: 3.5
- PYTHON_VERSION: 3.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this? Wouldn't this result in the version numbers being parsed as floats?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are still being used as strings. Remeber this is doing set PYTHON_VERSION=3.3 which comes out as a string when you do %PYTHON_VERSION%

- set PYTHON=C:\PYTHON%PYTHON_VERSION:.=%
- if %PLATFORM%==x86 (set CONDA_BLD_ARCH=32)
- if %PLATFORM%==x86 (set NUNIT=%NUNIT%-x86)
- if %PLATFORM%==x64 (set PYTHON=%PYTHON%-x64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you use %CONDA_PY%? Why change the casing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%CONDA_PY% was removed originally, I added it back later, but decided to keep it on PYTHON_VERSION in case it was removed later.
The casing was to keep all constants on upper case and the rest on lowercase.

# Shortcut path to executables. Mostly because of OpenCover
- set PYTHON_EXE=%PYTHON%\python.exe
- set NUNIT_EXE=.\packages\NUnit.Runners.2.6.2\tools\%NUNIT%.exe
- set OPENCOVER_EXE=.\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are hard-coding versions here, this just leads to unnecessary pain (e.g. I'd like to update NUnit in the future).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a very annoying shortcoming from OpenCover.


test_script:
- ps: '& "$env:PYTHON\\Scripts\\pip.exe" install --no-cache-dir --force-reinstall --ignore-installed ("dist\\" + (gci dist\*.whl)[0].Name)'
- ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName C:\testdir
- "%PYTHON%\\python.exe src\\tests\\runtests.py"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still carried out somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. here

@vmuriart
Copy link
Contributor Author

@filmor My problem with that is that the conda build adds an extra 60-90 seconds per build and then it wouldnt be testing under our standard packing that we would use on pypi. If you unpack the wheel and the conda recipe output, they are nearly the same so double testing/building is redundant with the exception that conda build puts alot of it out of our hands.

Originally I wanted to remove the conda build altogether from the CI testing which simplifies this alot more, but was talked into leaving it and made it so that it builds once a pull_request has been submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants