Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.0
Description
We have unit tests. Lots of unit tests.
We have people writing code.
We even have Jenkins running Unit tests on each commit.
But only on commits to integration.git.
It would be really awesome if we could empower our developers to have all of the Moodle unit tests run automatically whenever they push a branch to GitHub.
At HQ, we simply do not have the resource on our Jenkins server to handle this (I don't think). However, GitHub integrates cleanly, easily, and freely with travis-ci.org.
It would be super awesome if we could allow this integration to be enabled by individual developers so that, whenever they push their issues to GitHub it can be unit tested. They can be alerted to failures before it's even been peer reviewed.
To integrate with travis-ci.org, we just need to include a .travis.yml with a pretty basic configuration.
I've had a go at doing this, and have PHPUnit kicking off on both MySQL, and Postgres when I push any branch which contains my .travis.yml file.
Everything is currently almost entirely contained within the .travis.yml file.
There is one exception at present, and we can improve this too. At present, we can create the config.php using admin/cli/install.php, but that does not allow us to set the phpunit_dataroot or phpunit_prefix.
At the moment I have created a new composer package which contains my postgres and my mysql (very basic) configurations instead of this. Although this then means that we have a package dependency which is installed via composer, it has two benefits:
1) clear config.php which we can adjust in the repo; and
2) we don't actually need to do both a Moodle install, and a phpunit install.
Putting up for people's thoughts and views.
Attachments
Issue Links
- has been marked as being related by
-
MDL-77714 Remove Travis support from core
-
- Closed
-
-
MDL-52693 Add .travis.yml (backport of MDL-51458)
-
- Closed
-
- has to be done before
-
MDL-53261 Enable Travis-CI integration notification email
-
- Closed
-
- Testing discovered
-
MDLSITE-4211 Add travis checks for local_ci
-
- Resolved
-