#3722 closed Task (fixed)

Setup Travis CI to run our test suite on each pull request automatically

Reported by: matt Owned by: halfdan
Priority: major Milestone: 1.11 - Piwik 1.11
Component: Core Keywords:
Cc: Sensitive: no

Description (last modified by matt)

It would be awesome if the build was running automatically for all pull requests.

we would know, when reviewing a pull request, if the code is relatively safe.

Ideally Travis would notify in the pull request page the build result, (and link contributors to the doc explaining how to run tests).

Started in [7826]

Non trivial Feature requests:

  • Download artifacts from Travis (code coverage HTML reports, ...)
  • Run the build for both PDO Mysql and Mysqli

Change History (23)

comment:1 Changed 15 months ago by halfdan

Previous builds failed due to a missing config.ini.php.
Using the before_script command we now copy a configuration file
to config/. We also create a database for tests.
PHPUnit complained about missing XDebug - so this is added.

[7833]

(forgot the refs)

comment:2 Changed 15 months ago by halfdan

(In [7836]) Syntax error in .travis.yml

refs #3722

comment:3 Changed 15 months ago by halfdan

(In [7838]) Make travis.sh executable

refs #3722

comment:4 Changed 15 months ago by halfdan

The PHP 5.5 build is currently throwing a ton of E_DEPRECATED warnings since they are using an outdated version of PHPUnit. I created a ticket in their issue tracker: https://github.com/travis-ci/travis-ci/issues/903

comment:5 Changed 15 months ago by Fabian Becker

In 911cfdb8819541928e283896f3264a5dee7bae73:

Removing some more PHP 5.4/5.5 incompatibilities.

refs #3722

comment:6 Changed 15 months ago by Fabian Becker

In 2a0f2dd19b66d364b05166bb9d90e9115923db95:

Some tests require the sub-directories in tmp/

refs #3722

comment:7 Changed 15 months ago by Fabian Becker

In d7c6a6e6c3c235fe76331ce0a0da481636834c04:

Disabling coverage for now. refs #3722

comment:8 Changed 15 months ago by Fabian Becker

In 8fb7256b61422429c3cb0a3f490bffb8d0fe8e26:

We now use a testing matrix that matches three PHP versions
and three testsuites together.

refs #3722

comment:9 Changed 15 months ago by Fabian Becker

In a12a968e3898c9a06d43426163760243b58a18b6:

Change pwd, enable text coverage (HTML report is no use)

Adjust travis.sh

refs #3722

comment:10 Changed 15 months ago by matt (mattab)

In f2bd670e441938a245b5c59e652af21ea1c11209:

Fixed the issue with vagrant & failing tests. The solution is to setup webserver to Piwik.

  • added documentation in the test output to prevent useless test failures messages
  • I just write out the message and exit. Not sure if that's the proper way to do this
  • also added help text in case user hasn't up

Refs #3722

comment:11 Changed 15 months ago by matt (mattab)

In f26d1d175f4e639c488d962fa4a830daf2f510b5:

Need this as well to prevent error if piwik uninstalled!

Refs #3722

comment:12 Changed 15 months ago by matt (mattab)

In 477c338e334b1e8772f3d52459c2eaa35be860e6:

Fix bug in case REQUEST_URI does not contain the tests path
Refs #3722

comment:13 Changed 15 months ago by Fabian Becker

In 46e62bd7afbd164e1cb696d8f88d6b7bdaa5ee57:

PHPUnit tests for piwik require a running webserver.

travis/setup_webserver.sh will install nginx + php-fpm
and create configuration files.

travis.sh adjusted to reflect changes.

Moved everything to tests/

refs #3722

comment:14 Changed 15 months ago by Fabian Becker

comment:16 Changed 15 months ago by Fabian Becker

In 209c06b7250cbf2f3f8a65ccd0c3d02b1507d13e:

Removing matrix build for now since code coverage report gets useless.

refs #3722

comment:17 Changed 15 months ago by halfdan

https://travis-ci.org/piwik/piwik/jobs/4658397

I'm sorry but your test run exceeded 50.0 minutes.
One possible solution is to split up your test run.

I'm splitting up test suites again. Not sure why the tests suddenly take so long to run as they were finished within less than 10 minutes before.

comment:18 Changed 15 months ago by Fabian Becker

In 32e25b8d55b815ca099a564ff5e27f6eca0ef93d:

Adding build matrix again. refs #3722

comment:19 Changed 15 months ago by matt (mattab)

Not sure why the tests suddenly take so long to run

I'm pretty sure I had this problem before. Usually, it completely crashes either the computer (swapping) or php/phpunit. One problem comes when generating & displaying the backtrace for the test failures. Some backtrace are just too huge to be displayed, and result in crash or minutes of waiting. I think this is the problem here. I think that, once all tests pass again, this can be switched back to "full build" to try again.

comment:20 Changed 14 months ago by matt (mattab)

  • Description modified (diff)

It would be nice if we could enable build on both PDO Mysql and Mysqli

comment:21 Changed 14 months ago by matt (mattab)

Is it possible to setup Mysqli on Travis ?

Otherwise this ticket can be closed I think. excellent work!

comment:22 Changed 14 months ago by halfdan

Should be possible - still on my list.

comment:23 Changed 14 months ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

what a nice tool! it will tremendously help, especially if Jenkins crashes or dies in the future. Kuddos!!

Note: See TracTickets for help on using tickets.