Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We currently use Drupal\simpletest\KernelTestBase for our kernel tests. This is deprecated and replaced by Drupal\KernelTests\KernelTestBase. As we are still in alpha, we can explore switching to the newer test base.
Comment | File | Size | Author |
---|---|---|---|
#10 | use_the-2647884-10.patch | 7.66 KB | hussainweb |
| |||
#10 | interdiff-8-10.txt | 427 bytes | hussainweb |
#4 | use_the-2647884-4.patch | 1.75 KB | hussainweb |
Comments
Comment #2
hussainwebRight now, we have 44 tests running (including setUp). Let's see if that changes and everything works as expected.
Comment #3
hussainwebFrom the dispatcher log, I see that all the tests are run but the way pass count is calculated is different. This is the pass count for the test on the branch:
This is the log for this patch:
All tests that use KernelTestBase have been reduced to 1 or 2 passes (which is the number of the test methods, not asserts). There are 9 such tests which account for the difference between 44 tests passed earlier and 35 now. This can be explained by setUp not counted anymore. You can see this at the job page for the test on the patch. The method setUp is not listed anymore for all kernel tests.
While this looks good to go ahead, I am thinking that we should actually see the tests work properly.
Comment #4
hussainwebI am breaking a couple of tests to see the effect. There should be two failures.
Comment #6
hussainwebThe additional failure is for entity test failure. I am not sure why it gives that error but I have seen this a few times. I will leave this for review anyway.
Comment #7
BerdirHm, not sure why this works. phpunit tests must be moved to tests/src, and the namespace has to change. See Drupal\Tests\file\Kernel\FileItemValidationTest for an example.
Comment #8
hussainwebI see. I am attempting that here in the attached patch. I am also removing the prefix 'Token' from the filenames here as the classes are namespaced with token anyway and it appears that way in test results here on d.o and in simpletest as well.
Comment #10
hussainwebOops...
Comment #11
hussainwebFor reference, here is the log and pass count from the dispatcher:
Comment #12
BerdirNice. Committed. @dawehner will be happy ;)
Comment #14
dawehnerI fear you are right.