On Metatag I've added an abstract class which is then instantiated on each submodule to verify that submodule's meta tags work correctly. The abstract class inherits from WebTestBase, and then other tests inherit from it. When I execute run-tests.sh and tell it to run all of the Metatag tests it discovers the abstract class and tries to run it:
Fatal error: Cannot instantiate abstract class Drupal\metatag\Tests\MetatagTagsTestBase in core/scripts/run-tests.sh on line 716
FATAL Drupal\metatag\Tests\MetatagTagsTestBase: test runner returned a non-zero error code (255).
Drupal\metatag\Tests\MetatagTagsTestBase 0 passes 1 fails
This error does not happen when tests are executed via drupalci, e.g.: https://www.drupal.org/pift-ci-job/388047
The question is: is this a bug in core's test discovery system that causes it to load classes it shouldn't, or is there an existing (undocumented) practice for putting such tests in a different location, or named differently, to skip them being processed?
Note: this doesn't happen in the D7 release, only in D8.
Comments
Comment #2
DamienMcKennaIncidentally this only happens when I run the scripts locally, the problem is not triggered when tests are run by the drupalci.
Comment #3
DamienMcKennaComment #12
quietone CreditAttribution: quietone as a volunteer commentedTriaging issues in simpletest.module as part of the Bug Smash Initiative to determine if they should be in the Simpletest Project or core.
run-tests is still in core so moving to the Phpunit component, the only testing related component.
Comment #19
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedDoes this still happen using Gitlab pipelines? Given we are moving away from Drupal CI and the lack of commentary on this issue, I'm inclined to close it.
Please reopen if needed.