ElkArte Community

Project Support => General ElkArte discussions => Topic started by: emanuele on October 30, 2013, 06:15:45 pm

Title: Auto-testing
Post by: emanuele on October 30, 2013, 06:15:45 pm
Quote from: TestMonkey – (06:21:19 PM) elk_core: [Elkarte] engelnyst synchronize pull request #667: Add a ScheduledTasks.subs.php file for scheduled tasks (master...tasks)  http://git.io/B4OF2g

(06:30:51 PM) Norv: Oh, emanuele: when you're in the mood for installing an environment for testing, http://about.travis-ci.org/docs/user/languages/php/
(06:32:23 PM) Norv: Setup Elk, then run the tests (i.e. the all_tests.php we have), then shut it down. Travis is integrated with github, which makes it really nice, you'll see the results on every PR
https://travis-ci.org/emanuele45/Dialogo/builds/13287431

YAY!! :D

That means we can add MOAR tests and let github/travis take care of them! :D
Title: Re: Auto-testing
Post by: Spuds on October 30, 2013, 07:44:18 pm
Very awesome !!!  I see a lot of projects that use Travis, just have never had the time to set anything up.  We still need to add more test in more areas, but as we do this will help us break fewer things O:-)
Title: Re: Auto-testing
Post by: emanuele on October 31, 2013, 04:03:15 am
There is still postgre that doesn't work at the moment for the way the "installer" works, I'll try to fix it later today. :)
Title: Re: Auto-testing
Post by: emanuele on October 31, 2013, 09:08:55 am
And added to the main repo! :D
https://github.com/elkarte/Elkarte/pull/959

It tests for both mysql and postgre with php 5.2, 5.3, 5.4 and 5.5.

When the beta will be out I'll investigate how to do the tests on SQLite too (I think I have to checkout the other repo and move some files around, not much more I hope).

ETA: it's still broken, sorry... :-[
Title: Re: Auto-testing
Post by: emanuele on October 31, 2013, 07:42:54 pm
Adding some more:
https://travis-ci.org/emanuele45/Dialogo/builds/13343659&url_id=5ca76ac97d9bcaa67cb11f4e8db47cf794849a4b
The build is still failing, but now the setup of the environment (including installation of apache) and the installation of Elk are actually working! :P
I have to work on the errors now. O:-)
Title: Re: Auto-testing
Post by: emanuele on November 01, 2013, 08:00:19 pm
This time it really works! :D
https://travis-ci.org/emanuele45/Dialogo/builds/13388825

Tomorrow I'll make the commits nicer and I'll send the PR.
Title: Re: Auto-testing
Post by: TE on November 02, 2013, 02:48:45 am
This is so cool  ;D

(https://github.global.ssl.fastly.net/images/icons/emoji/+1.png)
Title: Re: Auto-testing
Post by: emanuele on November 02, 2013, 07:30:19 pm
Question of the day:
Code: [Select]
$_GET['action'] = array('test1', 'test2');
$_GET['action'] = (string) $_GET['action'];

Any idea why php 5.4 and 5.5 returns an error, while php 5.3 does not?
5.3: https://travis-ci.org/emanuele45/Dialogo/jobs/13418891
5.4: https://travis-ci.org/emanuele45/Dialogo/jobs/13418890
5.5: https://travis-ci.org/emanuele45/Dialogo/jobs/13418889
Title: Re: Auto-testing
Post by: Spuds on November 02, 2013, 08:18:12 pm
Ummm trick question, maybe because php 5.3 is buggy :P ... (is that just from the test or do we need an array_map ? )
Title: Re: Auto-testing
Post by: emanuele on November 02, 2013, 08:39:40 pm
Nope, no need for array_map or alike, it is just test that checks for the error in case it is an array.

Yeah, the buggy is the first thing I thought, but it looks weird because seems a rather big error... lol

The only difference I was able to find is this:
Quote from: http://php.net/manual/en/errorfunc.constants.phpSince PHP 5 but not included in E_ALL until PHP 5.4.0
Though we are using error_reporting(E_STRICT | E_ALL), so they should act the same... headscratch
Title: Re: Auto-testing
Post by: emanuele on November 03, 2013, 04:50:41 pm
I was ready to blame travis or simpletest for the problems with postgre, and instead it is a legit bug!! xD
Title: Re: Auto-testing
Post by: IchBin on November 03, 2013, 06:32:45 pm
haha, already paid off it looks like. I'll have to look more into this. Sounds cool to have some automated testing if I'm understanding this right.
Title: Re: Auto-testing
Post by: emanuele on November 04, 2013, 04:55:38 am
Yep.
It already found... 5 bugs I think, mainly related to postgre (anyone wants to guess if we test more on mysql or postgre? :P).