On Fri, Jun 28, 2013 at 10:50 AM, Arthur Richards
<aricha...@wikimedia.org> wrote:
> Mobile web is trying to merge https://gerrit.wikimedia.org/r/#/c/69585/ but
> PHPUnit tests are failing when Jenkins executes them.
>
> What's weird is that we've executed PHPUnit tests on our various local
> machines - with no failures. We've been scratching our heads trying to
> figure out what might be causing the inconsistency.
>
> Anyone have any ideas what might be causing this?
>
Something that's tripped me up with VisualEditor a couple of times is
that Jenkins doesn't actually run the tests on your branch, it runs
them on a hypothetical merge with your branch into master. The process
is something like this:
* Attempt to merge the branch into master
* If there is a conflict, reject the commit with a message saying
something about a merge conflict, and abort
* If there was no conflict, there is now a local (to the Jenkins
server) merge commit that merges this branch into master
* Run tests on this merge commit

This means that if there was a recent change in master that broke your
code, but doesn't conflict directly (perhaps because an interface you
were using changed), the tests succeed in the branch but fail in the
merge commit. Jenkins correctly recognizes that merging your branch
would break master, and rejects your branch reporting the relevant
test failures, but this is not immediately obvious because the code as
committed worked fine.

The way I address this is to rebase the change onto master (and
because there is no conflict, you can even use Gerrit's rebase button
for this), at which point the tests will start failing locally as
well.

Roan

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to