Problem/Motivation
I originally filed #2383217: Skip D8 tests having non-Drupal.org dependencies on the Testbot project, but @Berdir pointed out that the bug might be with Core.
Simpletest skips any tests whose annotation declares a dependency on a missing module (@requires module X where X is not in the modules directory). The run-tests.sh script however seems to override this for files specified with the --file arg.
Proposed resolution
Filter by @requires after handling the --file arg.
Remaining tasks
User interface changes
None
API changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | run-tests-should-verify-dependencies-2383395-9.patch | 2.42 KB | Pavan B S |
| #1 | run-tests-should-verify-dependencies-2383395-1.patch | 2.78 KB | berdir |
Comments
Comment #1
berdirThis seems to work. I actually noticed that I had the way to specify dependencies wrong, it is @dependencies $module_name. But it didn't work anyway.
The patch replaces a class exists for --class and a class exists + parent check with a check if the class exists in the test registry.
Additionally, I'm dropping support for non-namespaced test classes, doesn't really belong here, but we certainly no longer support that I think :)
Comment #3
mile23Comment #7
mile23This happens because TestDiscovery is determining whether the @require/@dependencies annotation is satisfied or not. --file doesn't need to do discovery, since it knows the file already.
Work on this is occuring in #1273478: Implement @requires and @dependencies within TestBase, mark tests as skipped for simpletest-based tests, and #2728579: Explicitly skip @requires module in PHPUnit Kernel and Browser tests for phpunit-based tests.
When those are complete, tests with missing dependencies will be marked as skipped, rather than just not run.
Comment #8
Pavan B S commentedRerolled the patch
Comment #13
mile23This is currently likely a duplicate of #2905007: Allow run-tests.sh to report skipped/incomplete PHPUnit tests, though that issue doesn't directly address
--file.Setting this as postponed on that one.
Comment #16
quietone 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 #23
mondrakeNow Simpletest is gone, TestDiscovery is using PHPUnit API, and PHPUnit no longer uses annotations for test metadata. Closing as outdated. If reopening, please update IS.