From 6943ba1ac430753f90340b042f0022b61bc0b041 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Wed, 20 Dec 2023 15:27:05 +0000 Subject: [PATCH] DRIVERS-2797 Check for substring in Index Management error asserts (#1485) --- .../index-management/tests/createSearchIndex.json | 4 ++-- .../index-management/tests/createSearchIndex.yml | 8 +++++--- .../tests/createSearchIndexes.json | 6 +++--- .../tests/createSearchIndexes.yml | 11 +++++++---- .../index-management/tests/dropSearchIndex.json | 2 +- source/index-management/tests/dropSearchIndex.yml | 3 ++- .../index-management/tests/listSearchIndexes.json | 6 +++--- .../index-management/tests/listSearchIndexes.yml | 11 +++++++---- .../tests/searchIndexIgnoresReadWriteConcern.json | 10 +++++----- .../tests/searchIndexIgnoresReadWriteConcern.yml | 15 ++++++++++----- .../index-management/tests/updateSearchIndex.json | 2 +- .../index-management/tests/updateSearchIndex.yml | 3 ++- 12 files changed, 48 insertions(+), 33 deletions(-) diff --git a/source/index-management/tests/createSearchIndex.json b/source/index-management/tests/createSearchIndex.json index 04cffbe9c9..f9c4e44d3e 100644 --- a/source/index-management/tests/createSearchIndex.json +++ b/source/index-management/tests/createSearchIndex.json @@ -55,7 +55,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], @@ -102,7 +102,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], diff --git a/source/index-management/tests/createSearchIndex.yml b/source/index-management/tests/createSearchIndex.yml index 6aa56f3bc4..2e3cf50f8d 100644 --- a/source/index-management/tests/createSearchIndex.yml +++ b/source/index-management/tests/createSearchIndex.yml @@ -30,8 +30,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -50,8 +51,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -59,4 +61,4 @@ tests: command: createSearchIndexes: *collection0 indexes: [ { definition: *definition, name: 'test index' } ] - $db: *database0 \ No newline at end of file + $db: *database0 diff --git a/source/index-management/tests/createSearchIndexes.json b/source/index-management/tests/createSearchIndexes.json index 95dbedde77..3cf56ce12e 100644 --- a/source/index-management/tests/createSearchIndexes.json +++ b/source/index-management/tests/createSearchIndexes.json @@ -49,7 +49,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], @@ -89,7 +89,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], @@ -138,7 +138,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], diff --git a/source/index-management/tests/createSearchIndexes.yml b/source/index-management/tests/createSearchIndexes.yml index 54a6e84ccb..db8f02e551 100644 --- a/source/index-management/tests/createSearchIndexes.yml +++ b/source/index-management/tests/createSearchIndexes.yml @@ -30,8 +30,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -51,8 +52,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -71,8 +73,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -80,4 +83,4 @@ tests: command: createSearchIndexes: *collection0 indexes: [ { definition: *definition, name: 'test index' } ] - $db: *database0 \ No newline at end of file + $db: *database0 diff --git a/source/index-management/tests/dropSearchIndex.json b/source/index-management/tests/dropSearchIndex.json index 0f21a5b68d..d8957a2227 100644 --- a/source/index-management/tests/dropSearchIndex.json +++ b/source/index-management/tests/dropSearchIndex.json @@ -49,7 +49,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], diff --git a/source/index-management/tests/dropSearchIndex.yml b/source/index-management/tests/dropSearchIndex.yml index e384cf26c5..8a8e829454 100644 --- a/source/index-management/tests/dropSearchIndex.yml +++ b/source/index-management/tests/dropSearchIndex.yml @@ -30,8 +30,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: diff --git a/source/index-management/tests/listSearchIndexes.json b/source/index-management/tests/listSearchIndexes.json index 24c51ad88c..a8cef42f7a 100644 --- a/source/index-management/tests/listSearchIndexes.json +++ b/source/index-management/tests/listSearchIndexes.json @@ -46,7 +46,7 @@ "object": "collection0", "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], @@ -81,7 +81,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], @@ -122,7 +122,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], diff --git a/source/index-management/tests/listSearchIndexes.yml b/source/index-management/tests/listSearchIndexes.yml index a50becdf1d..f05a368585 100644 --- a/source/index-management/tests/listSearchIndexes.yml +++ b/source/index-management/tests/listSearchIndexes.yml @@ -28,8 +28,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -48,8 +49,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -71,8 +73,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -82,4 +85,4 @@ tests: cursor: { batchSize: 10 } pipeline: - $listSearchIndexes: { name: *indexName } - $db: *database0 \ No newline at end of file + $db: *database0 diff --git a/source/index-management/tests/searchIndexIgnoresReadWriteConcern.json b/source/index-management/tests/searchIndexIgnoresReadWriteConcern.json index 5d36c7ccf3..47b4ccfa79 100644 --- a/source/index-management/tests/searchIndexIgnoresReadWriteConcern.json +++ b/source/index-management/tests/searchIndexIgnoresReadWriteConcern.json @@ -59,7 +59,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], @@ -105,7 +105,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], @@ -143,7 +143,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], @@ -178,7 +178,7 @@ "object": "collection0", "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], @@ -220,7 +220,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], diff --git a/source/index-management/tests/searchIndexIgnoresReadWriteConcern.yml b/source/index-management/tests/searchIndexIgnoresReadWriteConcern.yml index 8a1495b29e..bac38bd278 100644 --- a/source/index-management/tests/searchIndexIgnoresReadWriteConcern.yml +++ b/source/index-management/tests/searchIndexIgnoresReadWriteConcern.yml @@ -34,8 +34,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -57,8 +58,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -80,8 +82,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -101,8 +104,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: @@ -125,8 +129,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: diff --git a/source/index-management/tests/updateSearchIndex.json b/source/index-management/tests/updateSearchIndex.json index 88a46a3069..76a5962146 100644 --- a/source/index-management/tests/updateSearchIndex.json +++ b/source/index-management/tests/updateSearchIndex.json @@ -50,7 +50,7 @@ }, "expectError": { "isError": true, - "errorContains": "Search index commands are only supported with Atlas" + "errorContains": "Atlas" } } ], diff --git a/source/index-management/tests/updateSearchIndex.yml b/source/index-management/tests/updateSearchIndex.yml index bb18ab512e..2c56e75ef6 100644 --- a/source/index-management/tests/updateSearchIndex.yml +++ b/source/index-management/tests/updateSearchIndex.yml @@ -31,8 +31,9 @@ tests: expectError: # This test always errors in a non-Atlas environment. The test functions as a unit test by asserting # that the driver constructs and sends the correct command. + # The expected error message was changed in SERVER-83003. Check for the substring "Atlas" shared by both error messages. isError: true - errorContains: Search index commands are only supported with Atlas + errorContains: Atlas expectEvents: - client: *client0 events: