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
Use travis-ci for testing #636
Conversation
sorry there is some mess atm, I'm working on this pull and have to push to get it to travis... will clean it afterwards |
Just a note, if you wanna add a repo from GitHub Ogranization, it's not that simple (two clicks) as from normal user. Follow this manual, you actually just need to fill in two fields (manually). |
Another recommendation: if we use travis, we would see if each pull request breaks some tests (see example) |
+1 :) |
I do not understand why I have to add file .travis.yml to the framework. I do not like it :-/ |
It defines how the tests should be executed, so that Travis can do it automatically. And so that it can do it for all the forks as well. The principle is similar to composer - single file in repo's root. But you're right that we need to be careful not to end up like symfony with so much crap in root dir. |
which are failing in PHP5.4 due to a bug in iconv (https://bugs.php.net/bug.php?id=61484), so that they can be skipped
Non-optional parameters are first, because of PHP bug https://bugs.php.net/bug.php?id=62988
See forum for more details, motivation and discussion about pros and cons. Edit: it was passing before, but after we added also memcache tests, it doesn't work anymore :( |
❤️ 👏 👍 |
👍 😍 🙏 |
Special thanks to @hosiplan for all of these |
Sorry but skipping the test just because php 5.4 has a bug is not propper solution. |
@hrach that is dicussed on forum |
@hrach OK then, send patch to PHP, we all will be gratefull. |
@hosiplan well, that's typicall (arogant?) answer if somebody have sth against your work, the "do it yourself". No, I do not have knowledge to do that, but it does not change the fact this approach is not right. Obsession with green dot is nice, but there are some borders, which should not be passed. Btw, @juzna is quite skilled in hacking php. He should be able to do that, shouldn't he? From that bug, I believe, it's just about passing some parameter... |
@hrach we need all green in order to use Travis properly (reasoning on forum). Sure this is not the most correct solution ever, but it's best we can get. Little cons (some small test skipped) and big pros (having travis). Always, balance needs to be found. |
@hrach the problematic test is marked as skipped - which doesn't mean resolved, it mean it's skipped. |
Is to possible run test twice? Would be nice if we can test Nette\Database against multiple databases (postgre). |
@dg I don't think this is closed. You haven't merged configuration of memcache & test fixes. There should be as little as possible of skipped tests. If the tests are failing, there is no point of having pullrequests tested. |
@dg unluckily .travis.yml has to be in project root |
juzna Tests: separated Form tests with invalid characters … 203388c --- will not be merged |
Reasoning why are failing tests skipped was written on forum:
It covers: Sure this is just a workaround and should not exist at all if PHP worked properly. But again, ...
Tests: make sure session path is valid 734f0c4 Tests: use default php.ini if none specified 2ea3ecc |
Regarding php's configuration - there should be php.ini pre-defined also for linux (now there is one only for windows), so that linux users can pass that one into -c option. This one can then be uded by travis as well. |
@juzna „We need to have all existing tests passing to gain all benefits.“ Yes, we need to have all existing tests passing - its the purpose of testing. But we must never modify tests in order they will pass. ad 203388c: compare this totally stupid solution with solution 0e79764 ad d766dd5: this test discovered very strange and important bug, so you changed the test? WTF?? ad 734f0c4: how is possible to have session dir incorrectly configured? There is ini_set('session.save_path', TEMP_DIR); ad 2ea3ecc: unpredictable environment I have solved here 2ea3ecc. Correct php.ini should be always specified, with no magic in TestRunner. |
Yes, we need php.ini for linux, but this one is not working 7dc6538#L3L-1. Did you test it? |
@dg I agree that some commits were not best solution, but only best I had. I very appreciate your critics and I see you're right. Thanks About php.ini - that one works for me (Ubuntu 10.04) and also worked on Travis. What problem does it causes to you? |
AFAIK it worked for me and @JanTvrdik too. |
Btw about that Though I agree it's not best, again only the best I had. |
ad php.ini: There are a lot of tests (i.e tests\Nette\Utils\Strings.compare().phpt) which require mbstring, so it is surprising it works without mbstring in php.ini file. |
I haven't tested on win since I'm a proud non-owner of that OS ;) On linux it worked because we have mbstring bundled in php executable, which is quiet common I guess. |
btw 0e79764 doesn't solve it properly. On php 5.4 it's still broken:
and it seems to break also two tests on 5.3:
(I hope I'm right here and there is not another stupid mistake somewhere else) |
So all of there extensions (https://github.com/nette/nette/blob/835d742ffa3874c558153e9c09f381ccebd74c89/tests/php.ini-win) are default? Sorry, I did not know that. |
What is your Multibyte string engine (in phpinfo)? |
On PHP 5.4:
On PHP 5.3 the same, but it doesn't provide info about version. |
I found it: changed error handling of invalid UTF-8 based on the unicode consorsium's recommendation: moriyoshi/libmbfl@66c371c - it skips valid |
I've got the same failures as in last travis build |
About the extensions on Linux - sometimes they're bundled, sometimes not. It depends on the person who compiles PHP. At least on Ubuntu it seems they're bundled when installed from apt-get repository, though I haven't found any information mentioning this. On my machine I compiled php myself. |
K php.ini na Linuxu... Třeba na Debianu je php v balíčku kompilováno s Eh, sorry, nevšiml jsem si angličtiny :-) |
@dg it all looks great, thanks! Perhaps one more small fix to prevent such strange errors? Would you also like to set up GitHub hook to travis, so that CI builds get triggered automatically? |
Hook would be great. |
@dg |
Fuj, zelená! http://travis-ci.org/#!/nette/nette |
👏 👍 |
Good job, thanks. I hope this is the end of surprising questions: "And on your computer all tests are passing?" ;-) |
👏 👍 I won't ask again, I promise :P |
When you enable a Service hook in github, every commit will be automatically tested in the cloud and you'll see the results like http://travis-ci.org/#!/juzna/nette