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
Travis CI + Flake8 #17
Comments
|
If you find how to do this, please post it here. I would love a simple On Mon, May 16, 2016 at 11:17 PM, Dave Crossland
|
|
I got stuck with the root requirement :( https://travis-ci.org/davelab6/edit-fonts-activity |
|
https://pygobject.readthedocs.io/en/latest/memory_leaks.html suggests we could automate checking for memory leaks |
|
Travis CI shows a build error after the ./osbuild shell command because there is no response after 100ms This is the .travis.yml file used : https://github.com/sugarlabs/edit-fonts-activity/blob/yash-v0/.travis.yml |
|
here is the complete error log for the above mentioned build https://raw.githubusercontent.com/sugarlabs/edit-fonts-activity/yash-v0/log.txt |
|
Osbuild shell just runs a shell. Shells wait for user input to do commands. You might need to supply some user input. What do you want to do? |
|
@YashAgarwal Alright! You've got the same error (no response) because you're opening a shell and then not giving it valid commands as input (and initially, not giving it any commands at all :) And now @samdroid-apps has just explained how to send input to the shell - thank you Sam! :) For the travis file, it doesn't really matter which section of the travis file you execute the commands in; the different sections are almost merely 'syntactic sugar' - if you wanted to put all the commands in the So, lets walk through your travis file sudo: required
language: python
branches:
only:
- yash-v0
python:
- "2.7"That all looks good! before_install:
- pip install flake8
- "git clone git://github.com/sugarlabs/sugar-build.git"
- "cd sugar-build"
- "./osbuild pull"
- "./osbuild build"That looks okay. However, I wonder about using the git HEAD for development; its the latest current edge stuff, but perhaps we should be testing for a. the latest stable release with a container of https://hub.docker.com/_/fedora/ has some tips on using fedora docker images install:
- "cd activities/"
- "git clone https://github.com/YashAgarwal/testingTravis.git edit-fonts.activity"I would like to see us move to script:
- "flake8 edit-fonts.activity"@samdroid-apps is this default flake8 code style profile correct? after_success:
- "cd .."
# - "travis_wait 30 mvn install"
- "./osbuild shell"
- "python setup.py dist_xo"
- "cd ~; ls -alFR"This is ok, but the @samdroid-apps is there already any python/shell scripts for automating the posting to ASLO? (PS, please note that when you want to make a preformatted (code) section in Github comments, you should use 3 graves instead of 1 on a line on their own, to start and end the block, rather than just 1 - which is for incline code words; and you can add (without spaces) the name of the file extension relevant to the code to get syntax highlighting, eg which looks like: something:
- sweet |
|
Normal flake 8 should be fine. I don't think there is a way to upload the bundles to ASLO automatically. Maybe mint some RPMs and put them in a CPOR? |
|
@davelab6, how do you set a custom docker container? I was reading the docs and I couldn't find anything. Also the announcement said:
If it is not avaliable, is there an alternate CI provider that offers that? Is there something that we can self host if needed? |
|
@davelab6, maybe look at http://docs.gitlab.com/ce/ci/quick_start/README.html GitLab is FLOSS (yay!) and with the runners you can setup your own and it runs it on a specific machine that you setup (like a fedora 23 docker, or an xo emulator, or even maybe an xo). It also looks like very travis style config file :) |
|
Forget all those proposals. here is the best one: SL once (thanks to @dnarvaez) had an amazing buildbot that ran all the tests. But it decayed and the server got rebooted. The docs were never found and it decayed and died :( BUT I just stumbled upon a repo for it... with tones of docs! https://github.com/sugarlabs/sugar-buildbot Let's get that great thing back and running again! |
Except it isn't, because the business model is making the important bits proprietary |
Please do; however, I think it is likely to decay and die, and isn't worth bothering with :) |
|
@davelab6 should I focus this now or rather develop the activity for the mid-term evaluation, I think it will be better to get the activity to a release stage before doing all of this |
The announcement was a long time ago :D https://docs.travis-ci.com/user/docker/ offers an example in https://github.com/travis-ci/docker-sinatra and with a quick Google search for |
|
@YashAgarwal I agree, focus on the activity functionality :) |
|
After 3 weeks of focus on functionality, I suggest now is a good time to return to a focus on process :) |
|
Looking at https://travis-ci.org/sugarlabs/edit-fonts-activity flake8 is running on our entire repo, including all the modules we don't develop which don't conform to pep8, and this makes the log too long to display haha :) In (.travis.yml) we run We can run I make PR #59 to address this |
|
I added a couple of tasks to the top:
|
|
This means that no one can commit to master directly any more; you HAVE to work on a branch and make a PR and wait for Travis to pass that branch before it can be merged :) |
|
There were 939 errors reported by flake8, I've added them to the top of this issue and will tick off the ones I'm fixing as I'm fixing them, in part of PR #61 |
|
haha wow, Travis currently takes 50 minutes to complete! :) I'm going to adjust it |
|
Okay, so, I undid branch protection to adjust the travis file to run fast, by commenting out all the osbuild stuff, and used this command to find out which files had the most flake8 errors: |
|
So, Eli will take And I'll do the same with And so on until they are all clean |
|
Okay, they are all clean :) Now when opening a pull request, Travis runs flake8 on the codebase: And if it passes, the PR looks like this: If it doesn't pass, the PR looks like this: You can see the 'merge' button is greyed out; it only becomes green when the checks pass. Also it is now not possible to push to the master branch; instead all changes to master must be done via pull request - which ensures that the codebase always passes flake8. This is the error when trying to push commits directly to master: If you have commit things to master, just branch from there, push the branch to github (origin) and create a PR :) |
|
Hey @davelab6, great work with this ci! is it possible to get this running on sugar{,-toolkit-gtk3} as well? Is this portable to other activities? |
|
@samdroid-apps thanks :) Yes, the current .travis.yml file is really just a few lines now, so it should be portable to any python project. However, there will be a lot of errors in those codebases I expect, and probably there are other more important things to do for the codebase - like moving issues from trac to Github :) |





http://victorlin.me/posts/2013/09/19/fall-in-love-with-continuous-testing-and-integration-travis-ci
Eg https://github.com/edx/harprofiler/pull/52/files
https://pypi.python.org/pypi/tox might be good too
The text was updated successfully, but these errors were encountered: