Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

Add travis-ci for sugardough reference project. #14

Merged
merged 1 commit into from Dec 15, 2014

Conversation

glogiotatidis
Copy link
Contributor

No description provided.

@glogiotatidis
Copy link
Contributor Author

@magopian r?

@magopian
Copy link
Contributor

So, from what I understand, it's running the tests from the "inner" template directory, right?
This is a good starting point, as at least we'll make sure the docs and tests from the template directory are correct, and that it's flake8 compliant.

Very good idea, but I have another one (not necessarily better though): how about the travis file here creates a project the way we document it, and then run the tests in it?

We could do that by creating a "test_sugardough.sh" script, launched from the .travis.yml file, which would look like the following (it needs the cookiecutter.json file to be changed to have another folder than sugardough which is already used):

pip install cookiecutter
cookiecutter --no-input .
cd sugardough_test
tox -e $TOX_ENV

This has the added benefit of making sure there's no issue with cookiecutter itself with our template.

Of course, travis could also run some more tests specific to the template itself, as explained in #12

Thoughts?

@glogiotatidis
Copy link
Contributor Author

Agreed! Actually I commented exactly the same thing here #12 (comment)

I plan to add these tests as part of #16. Sounds good?

@magopian
Copy link
Contributor

Yep!
Did you like the idea about generating the project in travis, and run the tests on it instead of using the --set-home -c parameters?

@glogiotatidis
Copy link
Contributor Author

Actually i'll try to update this PR to generate the project and run tests as you say.

When we are done with this one I'll add project generation tests in #16.

brb

@glogiotatidis
Copy link
Contributor Author

OK I added ./bin/test_sugardough.sh which creates a project and then runs tox against it. Locally I have no issues but on travis tests fail in a strange way. Maybe you have an idea what's going on?

@magopian
Copy link
Contributor

I believe it's just because there's no test to be run, so coveralls fails (because there's no coverage file generated maybe?)

The flake8 errors are easy to fix I believe.

@glogiotatidis
Copy link
Contributor Author

OK there's something strange going on that I cannot understand. When travis runs flake8 gives the following errors

sugardough/urls.py:10:2: W292 no newline at end of file
sugardough/settings/__init__.py:10:16: W292 no newline at end of file
sugardough/wsgi.py:32:65: W292 no newline at end of file
sugardough/settings/base.py:145:34: W292 no newline at end of file

All valid error because indeed those files don't have newlines at the end.

But those files in the reference project and in the cookiecutter template do have newlines at the end. Also if I run ./bin/test_sugardough.sh locally, I get no errors and files do have newlines at the end.

I don't know what's going on here. We can temporarily ignore W292 but we should figure out why cookiecutter generates different project in travis.

Can somebody cross check that these files have newlines in their local installs?

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9136b1f on glogiotatidis:travis into * on mozilla:master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 644b80b on glogiotatidis:travis into * on mozilla:master*.

@magopian
Copy link
Contributor

That is odd... I don't have any errors on my test sugardough project: https://travis-ci.org/magopian/test_sugardough/jobs/43814764

When you say there is a newline, are you talking about the last character on a line, the \n, or an empty line? I'm asking because some editors automatically add (or remove) this last character.

@glogiotatidis
Copy link
Contributor Author

The last \n is missing from these files. Check this output for more details. https://travis-ci.org/mozilla/sugardough/jobs/43823024#L341

(i do cat urls.py and you can see the result in line 340)

@magopian
Copy link
Contributor

cookiecutter/cookiecutter#183 : what version of cookiecutter are we using on travis? Could that be the issue?

@magopian
Copy link
Contributor

If we change https://github.com/mozilla/sugardough/pull/14/files#diff-354f30a63fb0907d4ad57269548329e3R10 to be cookiecutter==0.8.0, it should hopefully fix this issues ;)

@magopian
Copy link
Contributor

btw, how about leaving cookiecutter unpinned? In the README, we tell people to pip install cookiecutter, so it would be nice to have travis use the latest version also.

I'd also leave tox unpinned really...

@glogiotatidis
Copy link
Contributor Author

erm yes... and I did pin packages to be on the safe side. Thanks for solving the mystery @magopian. This is now working and ready for review.

@@ -17,6 +17,7 @@ Features:
* [peep](https://github.com/erikrose/peep) ready.

[![Requirements Status](https://requires.io/github/mozilla/sugardough/requirements.svg?branch=master)](https://requires.io/github/mozilla/sugardough/requirements/?branch=master)
[![Build Status](https://travis-ci.org/mozilla/sugardough.svg)](https://travis-ci.org/mozilla/sugardough)
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, I've used the shields.ioversions of the SVG in https://raw.githubusercontent.com/mozilla/sugardough/master/sugardough/README.md:

[![Build Status](https://img.shields.io/travis/mozilla/sugardough/master.svg)](https://travis-ci.org/mozilla/sugardough)
[![Coverage status](https://img.shields.io/coveralls/mozilla/sugardough/master.svg)](https://coveralls.io/r/mozilla/sugardough)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, changed both travis and requires.io

@magopian
Copy link
Contributor

r+wc

@glogiotatidis
Copy link
Contributor Author

Merci!

glogiotatidis added a commit that referenced this pull request Dec 15, 2014
Add travis-ci for sugardough reference project.
@glogiotatidis glogiotatidis merged commit ffd55e2 into mozilla:master Dec 15, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants