Problem/Motivation

If you go to this project's home page, you will see under 8.x-7.0-alpha5, a link to GitLab pipelines, and to the left of the "View pipelines" link, there is a red X in a circle.

The failing pipeline for he 8.x-7.x branch seems to be https://git.drupalcode.org/project/elasticsearch_connector/-/pipelines/2...

Steps to reproduce

This can be reproduced locally by following the instructions at https://github.com/ddev/ddev-drupal-contrib using Drupal 10 core.

Proposed resolution

On this project's home page it is indicated that branch 8.x-7.x is subject to security and bug fixes only. Determine if failing tests is deemed to be a bug which falls under this category; and if so consider fixing the failing tests.

Details

The first problem is that we have:

PHP Fatal error:  Declaration of Drupal\Tests\elasticsearch_connector\Kernel\ClusterSchemaTest::setUp() must be compatible with Drupal\KernelTests\KernelTestBase::setUp(): void in /builds/project/elasticsearch_connector/tests/src/Kernel/ClusterSchemaTest.php on line 30

But once we fix that, we get other issues (at least locally) such as:

2) Drupal\elasticsearch_connector\Tests\Kernel\ElasticsearchTest::testFramework
TypeError: Drupal\search_api\Utility\FieldsHelper::createField(): Argument #1 ($index) must be of type Drupal\search_api\IndexInterface, null given, called in /var/www/html/web/modules/contrib/search_api/modules/search_api_db/tests/src/Kernel/BackendTest.php on line 105

/var/www/html/web/modules/contrib/search_api/src/Utility/FieldsHelper.php:485
/var/www/html/web/modules/contrib/search_api/modules/search_api_db/tests/src/Kernel/BackendTest.php:105
/var/www/html/tests/src/Kernel/ElasticsearchTest.php:58
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:729

which seem to step from ElasticsearchTest's usage of a search_api helper function which doesn't seem to return the right type.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alberto56 created an issue. See original summary.

alberto56’s picture

Here is a patch which tries to fix the definition of setup() vs setup() : void

mparker17 made their first commit to this issue’s fork.

mparker17’s picture

Status: Active » Needs work

Awesome, tests run now! But they seem to be failing because assertions are failing.

mparker17’s picture

Note that I rebased the merge request onto the latest 8.x-7.x just now.

mparker17’s picture

For what it's worth, we seem to be down to 1 failing test in this branch...

1) Drupal\elasticsearch_connector\Tests\Kernel\ElasticsearchTest::testBackend
Search for »test« returned correct number of results.
Failed asserting that 0 matches expected 4.
/builds/project/elasticsearch_connector/web/modules/contrib/search_api/tests/src/Kernel/BackendTestBase.php:256
/builds/project/elasticsearch_connector/web/modules/contrib/search_api/tests/src/Kernel/BackendTestBase.php:98

mparker17 changed the visibility of the branch 8.x-7.x to hidden.

mparker17’s picture

Status: Needs work » Reviewed & tested by the community

Yay, tests are passing now. As the module maintainer, this is blocking a bunch of other issues, so I'm going to skip the regular RTBC process and merge this.

  • mparker17 committed 410720ef on 8.x-7.x
    [#3508312] fix: Automated tests seem to be failing on 8.x-7.x branch
    
    By...
mparker17’s picture

Status: Reviewed & tested by the community » Fixed

Merged! Thanks @alberto56! Sorry it took so long!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

mparker17’s picture

I should update the issue summary for documentation purposes.

Status: Fixed » Closed (fixed)

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