Skip to content

Reformat RST for Atlas Search prose tests #1458

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

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 61 additions & 55 deletions source/index-management/tests/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,19 @@ Case 1: Driver can successfully create and list search indexes
#. Create a collection with the "create" command using a randomly generated name (referred to as ``coll0``).
#. Create a new search index on ``coll0`` with the ``createSearchIndex`` helper. Use the following definition:

.. code:: typescript
.. code:: typescript

{
name: 'test-search-index',
definition: {
mappings: { dynamic: false }
}
}
{
name: 'test-search-index',
definition: {
mappings: { dynamic: false }
}
}

#. Assert that the command returns the name of the index: ``"test-search-index"``.
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied and store the value in a variable ``index``:
1. An index with the ``name`` of ``test-search-index`` is present and the index has a field ``queryable`` with a value of ``true``.

- An index with the ``name`` of ``test-search-index`` is present and the index has a field ``queryable`` with a value of ``true``.

#. Assert that ``index`` has a property ``latestDefinition`` whose value is ``{ 'mappings': { 'dynamic': false } }``

Expand All @@ -104,25 +105,28 @@ Case 2: Driver can successfully create multiple indexes in batch
#. Create two new search indexes on ``coll0`` with the ``createSearchIndexes`` helper. Use the following
definitions when creating the indexes. These definitions are referred to as ``indexDefinitions``.

.. code:: typescript

{
name: 'test-search-index-1',
definition: {
mappings: { dynamic: false }
}
}
{
name: 'test-search-index-2',
definition: {
mappings: { dynamic: false }
}
}
.. code:: typescript

{
name: 'test-search-index-1',
definition: {
mappings: { dynamic: false }
}
}

{
name: 'test-search-index-2',
definition: {
mappings: { dynamic: false }
}
}

#. Assert that the command returns an array containing the new indexes' names: ``["test-search-index-1", "test-search-index-2"]``.
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied.
1. An index with the ``name`` of ``test-search-index-1`` is present and index has a field ``queryable`` with the value of ``true``. Store result in ``index1``.
2. An index with the ``name`` of ``test-search-index-2`` is present and index has a field ``queryable`` with the value of ``true``. Store result in ``index2``.
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following conditions are satisfied.

- An index with the ``name`` of ``test-search-index-1`` is present and index has a field ``queryable`` with the value of ``true``. Store result in ``index1``.
- An index with the ``name`` of ``test-search-index-2`` is present and index has a field ``queryable`` with the value of ``true``. Store result in ``index2``.

#. Assert that ``index1`` and ``index2`` have the property ``latestDefinition`` whose value is ``{ "mappings" : { "dynamic" : false } }``

Case 3: Driver can successfully drop search indexes
Expand All @@ -131,18 +135,19 @@ Case 3: Driver can successfully drop search indexes
#. Create a collection with the "create" command using a randomly generated name (referred to as ``coll0``).
#. Create a new search index on ``coll0`` with the following definition:

.. code:: typescript
.. code:: typescript

{
name: 'test-search-index',
definition: {
mappings: { dynamic: false }
}
}
{
name: 'test-search-index',
definition: {
mappings: { dynamic: false }
}
}

#. Assert that the command returns the name of the index: ``"test-search-index"``.
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied:
1. An index with the ``name`` of ``test-search-index`` is present and index has a field ``queryable`` with the value of ``true``.

- An index with the ``name`` of ``test-search-index`` is present and index has a field ``queryable`` with the value of ``true``.

#. Run a ``dropSearchIndex`` on ``coll0``, using ``test-search-index`` for the name.
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until ``listSearchIndexes`` returns an empty array.
Expand All @@ -155,37 +160,38 @@ Case 4: Driver can update a search index
#. Create a collection with the "create" command using a randomly generated name (referred to as ``coll0``).
#. Create a new search index on ``coll0`` with the following definition:

.. code:: typescript
.. code:: typescript

{
name: 'test-search-index',
definition: {
mappings: { dynamic: false }
}
}
{
name: 'test-search-index',
definition: {
mappings: { dynamic: false }
}
}

#. Assert that the command returns the name of the index: ``"test-search-index"``.
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied:
1. An index with the ``name`` of ``test-search-index`` is present and index has a field ``queryable`` with the value of ``true``.

- An index with the ``name`` of ``test-search-index`` is present and index has a field ``queryable`` with the value of ``true``.

#. Run a ``updateSearchIndex`` on ``coll0``, using the following definition.

.. code:: typescript

{
name: 'test-search-index',
definition: {
mappings: { dynamic: true }
}
}
.. code:: typescript

{
name: 'test-search-index',
definition: {
mappings: { dynamic: true }
}
}

#. Assert that the command does not error and the server responds with a success.
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following condition is satisfied:
1. An index with the ``name`` of ``test-search-index`` is present. This index is referred to as ``index``.
2. The index has a field ``queryable`` with a value of ``true`` and has a field ``status`` with the value of ``READY``.

#. Assert that an index is present with the name ``test-search-index`` and the definition has a
property ``latestDefinition`` whose value is ``{ 'mappings': { 'dynamic': true } }``.
#. Run ``coll0.listSearchIndexes()`` repeatedly every 5 seconds until the following conditions are satisfied:

- An index with the ``name`` of ``test-search-index`` is present. This index is referred to as ``index``.
- The index has a field ``queryable`` with a value of ``true`` and has a field ``status`` with the value of ``READY``.

#. Assert that an index is present with the name ``test-search-index`` and the definition has a property ``latestDefinition`` whose value is ``{ 'mappings': { 'dynamic': true } }``.
Copy link
Member Author

Choose a reason for hiding this comment

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

Alternatively, this could have been fixed by adjusting the wrapping on the second line; however, other steps in this file used a single line so I did so here for consistency.


Case 5: ``dropSearchIndex`` suppresses namespace not found errors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down