Page MenuHomePhabricator

Integrate Jenkins with Git
Closed, ResolvedPublic

Description

We would like to make sure we have post-commit integration of Jenkins with Git. * When a commit comes in, we'd like a post-commit hook to start tests running

  • phpUnit tests should be run
  • TestSwarm tests should be run
  • Results should be reported back to Gerrit

Version: unspecified
Severity: enhancement

Details

Reference
bz34141

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 12:16 AM
bzimport added a project: Gerrit.
bzimport set Reference to bz34141.
  • TestSwarm tests should be run

This one depends on the Jenkins-TestSwarm plugin, which doesn't have a stable public version yet afaik, athough WMF could contribute to that.

When a commit comes in, we'd like a post-commit hook to start tests running

I have submitted a change to have gerrit send a notification to jenkins:

https://gerrit.wikimedia.org/r/2495

The hook send the repo URL that has been modified, Jenkins git plugin should then trigger a build for any job having such URL.

Above change (2495) might not be needed anymore. Meanwhile, I have configured Jenkins to interact with Gerrit directly.

State as of March 7th:

Jenkins has a link established with gerrit

It does fetch any patch set submitted to test/mediawiki/core ( MediaWiki-GIT-Fetching job ).

Then two jobs, for now, are triggered:

  • a job that runs databaseless tests
  • a job running parser tests

Still need to be polished. The tests results are not aggregated. The notification made at the end of the build says "build started".

I remember from an earlier conversation that it was decided that the unit test should indeed be ran before the merge, but not directly after the push for git review (for security reasons).

from memory:

  • after initial review unit tests are ran (cherry pick apply to git clone) and results posted to Gerrit as review +1/-1; results from these builds by jenkins are not reported on IRC
  • after the merge to master jenkins' regular (linear) project for mediawiki master picks up and runs unit tests and reports to IRC if it breaks as usual.

correct ?

sumanah wrote:

This does not block the March 21st migration. Thus, marking priority Normal.

I have uploaded the Jenkins jobs rewriting to Gerrit integration/jenkins project.

Still need to polish that up but I have been busy with other things lastly.

Jenkins jobs directory on gallium is a git repo pointing to integration/jenkins so we can track changes.

I have resumed working on Jenkins. It is polished and running again. The main fetching job is MediaWiki-GIT-Fetching : https://integration.mediawiki.org/ci/job/MediaWiki-GIT-Fetching/

There is a lot more to do, specially adding more children tests (such as linter and over tests suites) and manage to report the result of all builds back in Gerrit.

(In reply to comment #8)

The main
fetching job is MediaWiki-GIT-Fetching :
https://integration.mediawiki.org/ci/job/MediaWiki-GIT-Fetching/

Reducing to "Normal" priority.

I have Jenkins configured to run some tests. Still need to polish up the reporting though.

Please note that currently a faulty commit has been merged in master which causes API tests to fail (bug 35646)

Jenkins now runs the full PHPUnit test suite whenever a patchset is submitted to Gerrit. I am thus considering this request as implemented.

If there is anything that need to be tweaked, please open a new bug report.