Problem/Motivation

ViewExecutableTest fails currently with PostgreSQL as database backend.

Proposed resolution

Identify and fix the failing tests.

Remaining tasks

Write patch.

User interface changes

None.

API changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bzrudi71’s picture

Just spend some minutes to fix this one. The root cause is an exception in a views.view.test_destroy.yml. In particular caused by the filter statement for the content-id (nid) which is set to equals. But there seems to be no nid avail and thus resulting in an PostgreSQL exception in testDestroy():

Drupal\Core\Database\DatabaseExceptionWrapper: Exception in test_destroy[test_destroy]: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" LINE 12: WHERE (( (node.nid = '') AND (node_field_data.status = '0') ... ^ in Drupal\views\Plugin\views\query\Sql->execute() (line 1451 of /opt/local/apache2/htdocs/drupal8/core/modules/views/src/Plugin/views/query/Sql.php).

In addition I see a warning in the tests in an earlier state:

setDisplay() called with invalid display ID "invalid".

Not sure if this is related.

BTW Changing the filter criterium to is empty makes tests pass..

dawehner’s picture

@bzrudi71
I think you could add something like:

value: 0
value: true
value: ""
<?code> depending on string / integer / boolean of the field.

bzrudi71’s picture

Status: Active » Needs review
FileSize
2.34 KB

Ah, I see! Changed the filter to use a default value of 0 and test passes now. Thanks @dawehner!

Status: Needs review » Needs work

The last submitted patch, 3: pgsql-views-executeable-test-3.patch, failed testing.

daffie’s picture

Status: Needs work » Needs review
FileSize
2.35 KB

Rerolled, no code changes.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

It all looks good to me.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 09891b7 and pushed to 8.0.x. Thanks!

  • alexpott committed 09891b7 on 8.0.x
    Issue #2443701 by bzrudi71, daffie: PostgreSQL: Fix views\Tests\...

Status: Fixed » Closed (fixed)

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