In Gerrit we test the master branches of extensions with the master branch of mediawiki/core. We do not have any support to run tests against a specific MediaWiki version though that would be an interesting thing to have. Probably by having another job that look at extension.json for the minimum mediawiki version requirement.
@Foxtrott maintained mediawiki/extensions/Lingo and makes sure the master branch works on 1.27, I guess via a test in Travis. Its extension.json has:
{ "requires": { "MediaWiki": "~1.27" } }
So theorically, we could have a job triggering on master branches of all extensions which would parse the requirement field and install MediaWiki core REL1_27 then run tests.
It is a bit more complicated with the introduction of PHPUnit 6 in mediawiki. The tests would need to be made runnable with PHPUnit 4 as well :/
JADE had a similar request (T207678)