Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit Test Failures with SearchPress adaptor #109

Open
mslinnea opened this issue Dec 6, 2024 · 0 comments
Open

Unit Test Failures with SearchPress adaptor #109

mslinnea opened this issue Dec 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mslinnea
Copy link
Member

mslinnea commented Dec 6, 2024

Description of the bug

When running tests with the SearchPress adaptor, there are test failures for loggedIn.php that relate to post statuses. See the below output.

Testing with SearchPress adapter, using SearchPress version 0.5 and host http://localhost:9200
Elasticsearch is up and running, using version 8.16.1.
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 9.6.21 by Sebastian Bergmann and contributors.

.......................................................FF.FF.FF  63 / 187 ( 33%)
............................................................... 126 / 187 ( 67%)
......S..........S...........................................   187 / 187 (100%)

Time: 00:36.800, Memory: 46.50 MB

There were 6 failures:

1) Tests_Query_LoggedIn::test_query_not_logged_in_any_status
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
     3 => 'pending'
     4 => 'private'
     5 => 'publish'
-    6 => 'request-completed'
-    7 => 'request-confirmed'
-    8 => 'request-failed'
-    9 => 'request-pending'
 )

/var/www/sandbox/wp-content/plugins/es-wp-query/tests/query/loggedIn.php:52

2) Tests_Query_LoggedIn::test_query_not_logged_in_all_statuses
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'auto-draft'
-    1 => 'draft'
-    2 => 'future'
-    3 => 'inherit'
-    4 => 'pending'
-    5 => 'private'
-    6 => 'publish'
-    7 => 'request-completed'
-    8 => 'request-confirmed'
-    9 => 'request-failed'
-    10 => 'request-pending'
-    11 => 'trash'
+    0 => 'draft'
+    1 => 'future'
+    2 => 'inherit'
+    3 => 'pending'
+    4 => 'private'
+    5 => 'publish'
 )

/var/www/sandbox/wp-content/plugins/es-wp-query/tests/query/loggedIn.php:67

3) Tests_Query_LoggedIn::test_query_admin_logged_in_any_status
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
     3 => 'pending'
     4 => 'private'
     5 => 'publish'
-    6 => 'request-completed'
-    7 => 'request-confirmed'
-    8 => 'request-failed'
-    9 => 'request-pending'
 )

/var/www/sandbox/wp-content/plugins/es-wp-query/tests/query/loggedIn.php:103

4) Tests_Query_LoggedIn::test_query_admin_logged_in_all_statuses
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'auto-draft'
-    1 => 'draft'
-    2 => 'future'
-    3 => 'inherit'
-    4 => 'pending'
-    5 => 'private'
-    6 => 'publish'
-    7 => 'request-completed'
-    8 => 'request-confirmed'
-    9 => 'request-failed'
-    10 => 'request-pending'
-    11 => 'trash'
+    0 => 'draft'
+    1 => 'future'
+    2 => 'inherit'
+    3 => 'pending'
+    4 => 'private'
+    5 => 'publish'
 )

/var/www/sandbox/wp-content/plugins/es-wp-query/tests/query/loggedIn.php:123

5) Tests_Query_LoggedIn::test_query_subscriber_logged_in_any_status
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
     3 => 'pending'
     4 => 'private'
     5 => 'publish'
-    6 => 'request-completed'
-    7 => 'request-confirmed'
-    8 => 'request-failed'
-    9 => 'request-pending'
 )

/var/www/sandbox/wp-content/plugins/es-wp-query/tests/query/loggedIn.php:159

6) Tests_Query_LoggedIn::test_query_subscriber_logged_in_all_statuses
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    0 => 'auto-draft'
-    1 => 'draft'
-    2 => 'future'
-    3 => 'inherit'
-    4 => 'pending'
-    5 => 'private'
-    6 => 'publish'
-    7 => 'request-completed'
-    8 => 'request-confirmed'
-    9 => 'request-failed'
-    10 => 'request-pending'
-    11 => 'trash'
+    0 => 'draft'
+    1 => 'future'
+    2 => 'inherit'
+    3 => 'pending'
+    4 => 'private'
+    5 => 'publish'
 )

/var/www/sandbox/wp-content/plugins/es-wp-query/tests/query/loggedIn.php:179

Steps To Reproduce

Install SearchPress plugin into your testing environment.
Create a es.php file in the tests directory.
Set up the es.php file like this:

<?php
require_once __DIR__ . '/../../searchpress/searchpress.php';
define( 'ES_WP_QUERY_TEST_ENV', true );
es_wp_query_load_adapter( 'searchpress' );

Run tests with composer run phpunit

Additional Information

No response

@mslinnea mslinnea added the bug Something isn't working label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant