Problem/Motivation
Work on Rules shifted some time ago to Github, and with that, we test Rules using phpunit via a Travis CI set up. This works well for Rules.
However, work is now going on to make the new DrupalCI system work better with PHPUnit (see #2605664: [Needs change record updates] Align TestDiscovery and bootstrap.php's non-permissive loading of PSR-4 namespaces for traits and #2607866: [meta] DrupalCI/SimpletestUI/run-tests.sh/phpunit not in harmony among others), especially to improve test discovery, and to make sure that tests can be factored with traits. This works fine using phpunit and Travis, but it does not work with the DrupalCI testbot right now. Since many Contrib modules still use the testbot, and some of these will want to integrate Rules, we need a certain level of "bot friendliness".
The biggest problem right now is that some of the things that will fix the discovery problem cause interactions with run-tests.sh
, the main program used by the testbot run both SimpleTest tests and PHPUnit tests. Tests by Rules get discovered if the developer has Rules in his/her source tree, and right now, the testbot will fail certain kinds of tests if they stumble on our Tests as currently written. This will happen irrespective of whether Rules is enabled or not; if it's on disk, the testbot will see the tests.
This problem occurs because the testbot insists that all tests have the @group
annotation. While some of our tests do have this, a number do not, and this creates problem with using run-tests.sh for other projects. The main reason it isn't visible now is that all of our tests in tests/src/Unit and tests/src/Kernel are already annotated, and do not bother the testbot. Once the discovery issue is resolved, the unannotated tests will suddenly be visible to the testbot, which will confuse anyone who is developing Rules plugins right now.
Proposed resolution
The fix should be pretty simple: add a @group
annotation to all of our tests.
Remaining tasks
Review; the patch is in.
User interface changes
None.
API changes
None, although we should document this.
Data model changes
None.
Comments
Comment #2
Torenware CreditAttribution: Torenware as a volunteer commentedPR https://github.com/fago/rules/pull/281 is up. Tests all pass.
Comment #3
Torenware CreditAttribution: Torenware as a volunteer commentedComment #4
klausiMerged, thanks!