-
Notifications
You must be signed in to change notification settings - Fork 15
Testbr #1
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
Open
JohnDoeAkira
wants to merge
7
commits into
lesteve:for-prs
Choose a base branch
from
JohnDoeAkira:testbr
base: for-prs
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Testbr #1
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
db5b74e
Add exercises.md
lesteve e9bead0
Add exercises.md
lesteve ac1eab0
Fix md formatting
lesteve 7e7d3eb
Create .travis.yml
JohnDoeAkira b10e560
Update test_all.py
JohnDoeAkira 1f710ac
Update test_all.py
JohnDoeAkira 00edbc1
Added simple test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| language: python | ||
|
|
||
| dist: trusty | ||
|
|
||
| script: py.test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| # Set-up | ||
| Any problems with install instructions? | ||
|
|
||
| Fork my repo https://github.com/lesteve/travis-tutorial. Clone your | ||
| own repo: | ||
| ``` | ||
| git clone https://github.com/<your-github-account>/travis-tutorial | ||
| ``` | ||
|
|
||
| Activate your repo on Travis: https://travis-ci.org/profile/your-github-account/travis-tutorial | ||
| Click on "Activate repo" | ||
|
|
||
| # Simple .travis.yml file | ||
| ```yaml | ||
| language: python | ||
|
|
||
| dist: trusty | ||
|
|
||
| script: py.test | ||
| ``` | ||
|
|
||
| commit + push. Look at build on https://travis-ci.org/your-github-account/travis-tutorial | ||
|
|
||
| # Broken .travis.yml | ||
| What happens if you have a broken .travis.yml? | ||
|
|
||
| http://lint.travis-ci.org/ | ||
| Alternative: `gem install travis` + `travis lint`. | ||
|
|
||
| # Pushing a commit | ||
| Add one commit (e.g. another assert) + watch the build on travis-ci.org. | ||
|
|
||
| # Opening a PR | ||
| Open a PR on my repo https://github.com/lesteve/travis-tutorial | ||
|
|
||
| Create a feature branch as the PR source and use `for-prs` as the target | ||
| branch. Maybe some conflicts will need to be solved along the line ... | ||
|
|
||
| Try to follow best practices and put some minimal effort in your PR | ||
| title and PR description. | ||
| # Testing on multiple Python versions | ||
| Add test_division: | ||
|
|
||
| Add this to `test_all.py`: | ||
| ```py | ||
| def test_division(): | ||
| assert 3/2 == 1.5 | ||
| ``` | ||
|
|
||
| Add this to your `.travis.yml`: | ||
| ``` | ||
| python: | ||
| - 2.7 | ||
| - 3.6 | ||
| ``` | ||
|
|
||
| # `install` step | ||
| New dependency: numpy. | ||
|
|
||
| Add a new function test_partition with a simple test. | ||
| for [numpy.partition](https://docs.scipy.org/doc/numpy/reference/generated/numpy.partition.html). | ||
|
|
||
| What is the numpy version (already installed in the virtualenv)? Add | ||
| print statement in .travis.yml. | ||
|
|
||
| Add build matrix entries with different versions of numpy (1.7.1 and 1.12.1). | ||
|
|
||
| Add this to your .travis.yml: | ||
| ```yml | ||
| env: | ||
| - NUMPY_VERSION=1.7.1 | ||
| - NUMPY_VERSION=1.12.1 | ||
|
|
||
| install: pip install numpy==$NUMPY_VERSION | ||
| ``` | ||
|
|
||
| See [doc](https://docs.travis-ci.com/user/customizing-the-build) for | ||
| more details about all the build steps. | ||
|
|
||
| Build matrix: More explicit way of defining build matrix. | ||
| See [doc](https://docs.travis-ci.com/user/customizing-the-build#Build-Matrix) | ||
|
|
||
| More complicated install step: test on Ubuntu. Hint: use deactivate | ||
| and use an install script. Also look at: | ||
| [apt plugin doc](https://docs.travis-ci.com/user/installing-dependencies/#Adding-APT-Packages). | ||
|
|
||
| # Cache | ||
| The Python 3.6 + numpy 1.7.1 should take more time than the others, | ||
| any idea why? | ||
|
|
||
| cache pip dependencies by adding this to your .travis.yml file: | ||
| ```yaml | ||
| cache: pip | ||
| ``` | ||
| Note: another useful cache setup is `cache: ccache` for C/C++ projects) | ||
|
|
||
| Does it have an impact on the build timings? | ||
|
|
||
| Do the same by caching the ~/.pip/cache folder. | ||
|
|
||
| Find a dummy use case to feature custom directory caching, e.g. a | ||
| function that sleeps a few seconds before returning. | ||
|
|
||
| Read the [caching doc](https://docs.travis-ci.com/user/caching/) and test a few things they mention: | ||
| * branch use cache from master if the branch does not have a cache yet | ||
| * per-environment cache, i.e. does multiple build matrix entries share the same cache? | ||
| * clear the cache via the web UI. | ||
|
|
||
| # Docker | ||
|
|
||
| Using continuumio/miniconda docker image, creating a conda | ||
| environment with the right python + numpy version. | ||
|
|
||
| # Additional things to play with | ||
| - set up Travis for your own project | ||
| - allow_failures | ||
| - Use Travis docker images to run Travis locally: | ||
| http://eng.localytics.com/best-practices-and-common-mistakes-with-travis-ci/ | ||
| - try using ccache and caching the .ccache in scikit-learn, is it | ||
| faster (if yes by how much) than compiling each time from scratch. | ||
| How big does the cache grow (i.e. ccache defaults)? How much time | ||
| does it take to restore. What is a reasonable cache size to set ? | ||
| How quickly does the cache grow ? | ||
|
|
||
| # Useful documentation pages | ||
| Some useful documentation pages: | ||
| https://docs.travis-ci.com/user/customizing-the-build | ||
| https://docs.travis-ci.com/user/languages/python/ | ||
| https://docs.travis-ci.com/user/ci-environment/ | ||
| https://docs.travis-ci.com/user/caching/ | ||
| https://docs.travis-ci.com/user/docker/ | ||
| https://docs.travis-ci.com/user/common-build-problems/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| def test_addition(): | ||
| assert 1 + 1 == 2 | ||
|
|
||
| def test_True(): | ||
| assert 3 == 3 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flake8 violation