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

fix(mango): integration tests #4610

Merged
merged 2 commits into from
May 21, 2023
Merged

fix(mango): integration tests #4610

merged 2 commits into from
May 21, 2023

Conversation

pgj
Copy link
Contributor

@pgj pgj commented May 21, 2023

  • Fix the faulty index_array_length tests:

    • They do not check the count of the returned documents but blindly
      assume that there will be results. Add an explicit assertion about
      the expected number of documents in the response so it could be
      detected if something breaks.

    • The assertion on the document count revealed that the test database
      is actually empty because it is immediately wiped out after creation
      by a misplaced recreate() call.

    • When the indexing on the array lengths is disabled, there shall be no
      documents returned, and not the sizes of the favorites arrays in
      the results shall be zero. That is because there is no information
      available on the sizes of the arrays.

  • The result of the mango.has_text_service() checks is implicitly forecasted by the @unittest.skipUnless annotations in the head of the class declaration. Hence they are not needed anymore.

pgj added 2 commits May 21, 2023 11:03
- They do not check the count of the returned documents but blindly
  assume that there will be results.  Add an explicit assertion about
  the expected number of documents in the response so it could be
  detected if something breaks.

- The assertion on the document count revealed that the test database
  is actually empty because it is immediately wiped out after creation
  by a misplaced `recreate()` call.

- When the indexing on the array lengths is disabled, there shall be no
  documents returned, and not the sizes of the `favorites` arrays in
  the results shall be zero.  That is because there is no information
  available on the sizes of the arrays.
The result of the `mango.has_text_service()` checks is implicitly
forecasted by the `@unittest.skipUnless` annotations in the head of
the class declaration.  Hence they are not needed anymore.
Copy link
Contributor

@jaydoane jaydoane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fixes!

running clouseau c59127d5657e3130b55d6e2b9575820a08e438e1

make mango-test

[ * ] Exec command COUCH_USER=adm COUCH_PASS=pass .venv/bin/python3 -m nose2  ... ........s.ss.s.s.............s.ss.s.s............s.ss.s.s.............................................................................................................................................................s...................................................................................................................................................
----------------------------------------------------------------------
Ran 362 tests in 25.601s

OK (skipped=16)

@jaydoane jaydoane merged commit 649f473 into apache:main May 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants