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

CSHARP-4420: EG tests for Atlas Search #1001

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
facf8a1
- Search text operator
BorisDog Nov 18, 2022
0c9e2a6
CSHARP-4440: Incorporate MongoDB.Labs.Search library
BorisDog Dec 12, 2022
7bcf7c3
- Tests fix
BorisDog Dec 12, 2022
bd3bb51
Hide aws sdk package. (#981)
DmitryLukyanov Dec 5, 2022
332b09a
Revert "Hide aws sdk package. (#981)" (#982)
DmitryLukyanov Dec 6, 2022
ad74cdf
CSHARP-4428: LINQ3 not handling down cast in UpdateDefinitionBuilder …
rstam Dec 7, 2022
ff4c396
CSHARP-4421: Unify all spec tests in single test project (#977)
BorisDog Dec 8, 2022
cae2582
CSHARP-4427: Negative array indexes should throw ExpressionNotSupport…
rstam Dec 8, 2022
20bc1eb
CSHARP-4399: Remove use of activate_venv.sh and utils.sh. (#983)
DmitryLukyanov Dec 8, 2022
40b011d
CSHARP-4400: Upgrade xunit to 2.4.2 and remove SkippableFact package …
BorisDog Dec 12, 2022
0daabd7
CSHARP-4446: MongoQueryable methods should validate that mandatory ar…
rstam Dec 8, 2022
4d81692
CSHARP-4339: Added database.AsQueryable().
rstam Dec 6, 2022
43d8939
CSHARP-4339: Add support for $documents in LINQ.
rstam Dec 14, 2022
5ce4903
CSHARP-4358: Update tests that only test against LINQ2 to test agains…
rstam Dec 10, 2022
cc9a895
CSHARP-4445: Support 64-bit values for Skip and Limit/Take.
rstam Dec 13, 2022
586b2cc
Fix compilation errors resulting from merge.
rstam Dec 14, 2022
f159956
CSHARP-4255: Automatically create Queryable Encryption keys. (#961)
DmitryLukyanov Dec 14, 2022
454f37c
CSHARP-4255: Fix merge conflict. (#992)
DmitryLukyanov Dec 14, 2022
b3ca622
CSHARP-4455: Fix test assertation. (#994)
DmitryLukyanov Dec 17, 2022
cb8a4be
CSHARP-4420: EG tests for Atlas Search
BorisDog Dec 22, 2022
150dd8a
- PR comments
BorisDog Jan 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 8 additions & 8 deletions CSharpDriver.sln
Expand Up @@ -10,7 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D2012971-32B
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{E472BDF5-61F1-461D-872B-9F53BB3ACA80}"
ProjectSection(SolutionItems) = preProject
tests\Directory.Build.props = tests\Directory.Build.props
tests\BuildProps\Tests.Build.props = tests\BuildProps\Tests.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MongoDB.Bson", "src\MongoDB.Bson\MongoDB.Bson.csproj", "{9FCB42A5-3BC6-492B-8EA0-53EF32E9F8CD}"
Expand Down Expand Up @@ -54,8 +54,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
MongoDBTest.ruleset = MongoDBTest.ruleset
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkippableTests", "tests\SkippableTests\SkippableTests.csproj", "{D198833A-6AC3-4327-8B02-5095455192D0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MongoDB.Driver.TestConsoleApplication", "tests\MongoDB.Driver.TestConsoleApplication\MongoDB.Driver.TestConsoleApplication.csproj", "{2E5780D2-29A5-483C-9CA2-844F45A66D0C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AstrolabeWorkloadExecutor", "tests\AstrolabeWorkloadExecutor\AstrolabeWorkloadExecutor.csproj", "{B90F025F-89D3-436A-AD78-6AA304A6E240}"
Expand All @@ -64,6 +62,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MongoDB.Driver.SmokeTests.S
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SmokeTests", "SmokeTests", "{F64BF86A-1EF1-4596-84A6-6B4AB766CD77}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MongoDB.TestHelpers", "tests\MongoDB.TestHelpers\MongoDB.TestHelpers.csproj", "{DF888021-744F-4A8B-9324-831DEFC48AB8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -134,10 +134,6 @@ Global
{7A015030-6329-4FAD-B6E3-CED5ED53019C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A015030-6329-4FAD-B6E3-CED5ED53019C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A015030-6329-4FAD-B6E3-CED5ED53019C}.Release|Any CPU.Build.0 = Release|Any CPU
{D198833A-6AC3-4327-8B02-5095455192D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D198833A-6AC3-4327-8B02-5095455192D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D198833A-6AC3-4327-8B02-5095455192D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D198833A-6AC3-4327-8B02-5095455192D0}.Release|Any CPU.Build.0 = Release|Any CPU
{2E5780D2-29A5-483C-9CA2-844F45A66D0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E5780D2-29A5-483C-9CA2-844F45A66D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E5780D2-29A5-483C-9CA2-844F45A66D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -150,6 +146,10 @@ Global
{B711A69F-A337-452C-95E1-A6B15C727CBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B711A69F-A337-452C-95E1-A6B15C727CBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B711A69F-A337-452C-95E1-A6B15C727CBA}.Release|Any CPU.Build.0 = Release|Any CPU
{DF888021-744F-4A8B-9324-831DEFC48AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF888021-744F-4A8B-9324-831DEFC48AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF888021-744F-4A8B-9324-831DEFC48AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF888021-744F-4A8B-9324-831DEFC48AB8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -171,11 +171,11 @@ Global
{C50D554C-2771-4CC1-9B2C-BB17FB27F935} = {E472BDF5-61F1-461D-872B-9F53BB3ACA80}
{DAB8DFFD-0020-43B3-9C08-7723F5D68E90} = {E472BDF5-61F1-461D-872B-9F53BB3ACA80}
{7A015030-6329-4FAD-B6E3-CED5ED53019C} = {E472BDF5-61F1-461D-872B-9F53BB3ACA80}
{D198833A-6AC3-4327-8B02-5095455192D0} = {E472BDF5-61F1-461D-872B-9F53BB3ACA80}
{2E5780D2-29A5-483C-9CA2-844F45A66D0C} = {E472BDF5-61F1-461D-872B-9F53BB3ACA80}
{B90F025F-89D3-436A-AD78-6AA304A6E240} = {E472BDF5-61F1-461D-872B-9F53BB3ACA80}
{B711A69F-A337-452C-95E1-A6B15C727CBA} = {F64BF86A-1EF1-4596-84A6-6B4AB766CD77}
{F64BF86A-1EF1-4596-84A6-6B4AB766CD77} = {E472BDF5-61F1-461D-872B-9F53BB3ACA80}
{DF888021-744F-4A8B-9324-831DEFC48AB8} = {E472BDF5-61F1-461D-872B-9F53BB3ACA80}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {24BEC44B-92B0-43AA-9B15-163459D0C098}
Expand Down
7 changes: 7 additions & 0 deletions build.cake
Expand Up @@ -240,6 +240,13 @@ Task("TestAtlasDataLake")
action: (BuildConfig buildConfig, Path testProject) =>
RunTests(buildConfig, testProject, filter: "Category=\"AtlasDataLake\""));

Task("TestAtlasSearch")
.IsDependentOn("Build")
.DoesForEach(
items: GetFiles("./**/MongoDB.Driver.Tests.csproj"),
action: (BuildConfig buildConfig, Path testProject) =>
RunTests(buildConfig, testProject, filter: "Category=\"AtlasSearch\""));

Task("TestOcsp")
.IsDependentOn("Build")
.DoesForEach(
Expand Down
95 changes: 69 additions & 26 deletions evergreen/evergreen.yml
Expand Up @@ -446,11 +446,12 @@ functions:
type: test
params:
silent: true
shell: "bash"
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
. ./activate-authawsvenv.sh
mongo aws_e2e_regular_aws.js
- command: shell.exec
type: test
Expand All @@ -470,12 +471,13 @@ functions:
type: test
params:
silent: true
shell: "bash"
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
# The aws_e2e_assume_role script requires python3 with boto3.
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
. ./activate-authawsvenv.sh
mongo aws_e2e_assume_role.js
- command: shell.exec
type: test
Expand All @@ -501,6 +503,7 @@ functions:
type: test
params:
silent: true
shell: "bash"
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
Expand All @@ -509,7 +512,7 @@ functions:
exit 0
fi
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
. ./activate-authawsvenv.sh
mongo aws_e2e_ec2.js
- command: shell.exec
type: test
Expand All @@ -532,6 +535,7 @@ functions:
type: test
params:
silent: true
shell: "bash"
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
Expand All @@ -540,7 +544,7 @@ functions:
exit 0
fi
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
. ./activate-authawsvenv.sh
echo "Project Directory: $PROJECT_DIRECTORY"
# SRC_DIRECTORY is workaround since EG_TOOLS expects "src" folder as a root
SRC_DIRECTORY=$(dirname $PROJECT_DIRECTORY)/src
Expand All @@ -560,6 +564,7 @@ functions:
- command: shell.exec
type: test
params:
shell: "bash"
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
Expand All @@ -568,7 +573,7 @@ functions:
exit 0
fi
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
. ./activate-authawsvenv.sh
mongo aws_e2e_web_identity.js
- command: shell.exec
type: test
Expand Down Expand Up @@ -679,6 +684,15 @@ functions:
${PREPARE_SHELL}
evergreen/run-atlas-data-lake-test.sh

run-atlas-search-test:
- command: shell.exec
type: test
params:
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
ATLAS_SEARCH="${ATLAS_SEARCH}" evergreen/run-atlas-search-test.sh

run-ocsp-test:
- command: shell.exec
type: test
Expand Down Expand Up @@ -708,10 +722,12 @@ functions:
- command: shell.exec
params:
background: true
shell: "bash"
script: |
set -o xtrace
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
nohup ./venv/Scripts/python ocsp_mock.py \
. ./activate-ocspvenv.sh
nohup python ocsp_mock.py \
--ca_file ${OCSP_ALGORITHM}/ca.pem \
--ocsp_responder_cert ${OCSP_ALGORITHM}/ca.crt \
--ocsp_responder_key ${OCSP_ALGORITHM}/ca.key \
Expand All @@ -727,10 +743,12 @@ functions:
- command: shell.exec
params:
background: true
shell: "bash"
script: |
set -o xtrace
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
nohup ./venv/Scripts/python ocsp_mock.py \
. ./activate-ocspvenv.sh
nohup python ocsp_mock.py \
--ca_file ${OCSP_ALGORITHM}/ca.pem \
--ocsp_responder_cert ${OCSP_ALGORITHM}/ocsp-responder.crt \
--ocsp_responder_key ${OCSP_ALGORITHM}/ocsp-responder.key \
Expand All @@ -746,10 +764,12 @@ functions:
- command: shell.exec
params:
background: true
shell: "bash"
script: |
set -o xtrace
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
nohup ./venv/Scripts/python.exe ocsp_mock.py \
. ./activate-ocspvenv.sh
nohup python ocsp_mock.py \
--ca_file ${OCSP_ALGORITHM}/ca.pem \
--ocsp_responder_cert ${OCSP_ALGORITHM}/ca.crt \
--ocsp_responder_key ${OCSP_ALGORITHM}/ca.key \
Expand All @@ -767,10 +787,12 @@ functions:
- command: shell.exec
params:
background: true
shell: "bash"
script: |
set -o xtrace
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
nohup ./venv/Scripts/python.exe ocsp_mock.py \
. ./activate-ocspvenv.sh
nohup python ocsp_mock.py \
--ca_file ${OCSP_ALGORITHM}/ca.pem \
--ocsp_responder_cert ${OCSP_ALGORITHM}/ocsp-responder.crt \
--ocsp_responder_key ${OCSP_ALGORITHM}/ocsp-responder.key \
Expand Down Expand Up @@ -848,83 +870,93 @@ functions:
start-kms-mock-servers:
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
cd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
- command: shell.exec
params:
background: true
shell: "bash"
script: |
#expired client cert
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle
$PYTHON -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8000
. ./activate-kmstlsvenv.sh
python -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8000
- command: shell.exec
params:
background: true
shell: "bash"
script: |
#wrong-host client cert
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle
$PYTHON -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8001
. ./activate-kmstlsvenv.sh
python -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8001
- command: shell.exec
params:
background: true
shell: "bash"
script: |
#server.pem client cert
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle
$PYTHON -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8002 --require_client_cert
. ./activate-kmstlsvenv.sh
python -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8002 --require_client_cert

start-kms-mock-kmip-server:
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
cd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
- command: shell.exec
params:
shell: "bash"
background: true
script: |
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle
$PYTHON -u kms_kmip_server.py
. ./activate-kmstlsvenv.sh
python -u kms_kmip_server.py

start-kms-mock-gcp-server:
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
cd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
- command: shell.exec
params:
background: true
shell: "bash"
script: |
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms
$PYTHON -m pip install PyJWT
. ./activate-kmstlsvenv.sh
python -m pip install PyJWT
mkdir ${DRIVERS_TOOLS}/tmp
echo '${GOOGLE_APPLICATION_CREDENTIALS_CONTENT}' > ${DRIVERS_TOOLS}/tmp/testgcpkms_key_file.json
export GOOGLE_APPLICATION_CREDENTIALS=${DRIVERS_TOOLS}/tmp/testgcpkms_key_file.json
$PYTHON -u mock_server.py
python -u mock_server.py

start-kms-mock-azure-imds-server:
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
cd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
- command: shell.exec
params:
background: true
shell: "bash"
script: |
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle
$PYTHON bottle.py fake_azure:imds
. ./activate-kmstlsvenv.sh
python bottle.py fake_azure:imds

cleanup:
- command: shell.exec
Expand Down Expand Up @@ -1179,6 +1211,10 @@ tasks:
- func: bootstrap-mongohoused
- func: run-atlas-data-lake-test

- name: atlas-search-test
commands:
- func: run-atlas-search-test

- name: test-serverless-net472
exec_timeout_secs: 2700 # 45 minutes: 15 for setup + 30 for tests
commands:
Expand Down Expand Up @@ -2045,6 +2081,13 @@ buildvariants:
tasks:
- name: atlas-data-lake-test

- name: atlas-search-test
display_name: "Atlas Search Tests"
run_on:
- windows-64-vs2017-test
tasks:
- name: atlas-search-test

- name: gssapi-auth-tests-windows
run_on:
- windows-64-vs2017-test
Expand Down
29 changes: 0 additions & 29 deletions evergreen/get-python-path.sh

This file was deleted.