Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
Issue tags: +Needs tests
FileSize
1.07 KB

This should be testable somehow.

amateescu’s picture

Can't we test using the same method I used in #1713332: The SQLite database driver fails to drop simpletest tables, by overriding the run() method (or the phpunit equivalent)?

alexpott’s picture

@amateescu everything is destroyed in tearDown so there is nowhere to override like in #1713332: The SQLite database driver fails to drop simpletest tables

Also we have some tests that run set up multiple times generating a new prefix and in the sqlite case files that are not cleaned up in /tmp and an under declared dependency on sqlite.

amateescu’s picture

How about overriding tearDown() itself?

alexpott’s picture

Tried that... after tear down everything is gone.

dawehner’s picture

Tried out something like this, but for some reason, which is not obvious for me, the \Drupal\Core\Database\Driver\sqlite\Schema::findTables in the tearDown method itself does not find the config table. The next method in \Drupal\KernelTests\KernelTestBaseTest::tearDown then though finds it.

Status: Needs review » Needs work

The last submitted patch, 7: 2553533-7.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
FileSize
6.75 KB

Reupload.

Wim Leers’s picture

Issue tags: -Needs tests +Needs reroll

Looking good!

+++ b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php
@@ -19,7 +20,7 @@ class KernelTestBaseTest extends KernelTestBase {
-  public function testSetUpBeforeClass() {
+  public function ptestSetUpBeforeClass() {

@@ -27,7 +28,7 @@ public function testSetUpBeforeClass() {
-  public function testBootEnvironment() {
+  public function ptestBootEnvironment() {

@@ -51,31 +52,15 @@ public function testBootEnvironment() {
+  public function ptestGetDatabaseConnectionInfoWithOutManualSetDbUrl() {

… and more — all debug leftovers.

hussainweb’s picture

I think I got them all.

dawehner’s picture

It would be great if @amateescu could have a look at it.

amateescu’s picture

I tested the patch on SQLite and I can confirm that it works and the test tables are properly removed at the end of the test run.

+++ b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php
@@ -19,7 +20,7 @@ class KernelTestBaseTest extends KernelTestBase {
-  public function testSetUpBeforeClass() {
+  public function ptestSetUpBeforeClass() {

Missed one :)

amateescu’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
3.96 KB
626 bytes

No reason to hold it up over that.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

I'll be honest. I have absolutely no idea what this does, but random fails are bad, mmmkay?

Committed and pushed to 8.0.x. ;) Thanks!

  • webchick committed d6d3f6a on 8.0.x
    Issue #2553533 by alexpott, dawehner, amateescu, hussainweb:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.