-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5253 Automated Spec Test Sync #2409
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
Changes from 31 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
fe1b07d
WIP
sleepyStick f822f31
trying to get it to work locally?
sleepyStick 6909518
wip
sleepyStick 73139a4
still a wip
sleepyStick b3a2b29
WIP
sleepyStick 49685ae
trying to get it to work locally?
sleepyStick 076ed93
wip
sleepyStick 07ea1f6
still a wip
sleepyStick f4b3ddc
add patch file, use comment bot, still a wip
sleepyStick 547dd76
Merge branch 'PYTHON-5253' of https://github.com/sleepyStick/mongo-py…
sleepyStick a97d5f4
Merge branch 'mongodb:master' into PYTHON-5253
sleepyStick 925aeb5
fun fact, using a python script is actually *way* easier
sleepyStick 67b995a
remove comment
sleepyStick 53e8945
remove comment pt2
sleepyStick 9f6f727
9am pst is 4pm utc i think?
sleepyStick 3144383
remove unused vars and cleanup debugging prints
sleepyStick 2bea24b
oops accidentally deleted this line
sleepyStick 4bef7ca
fix resync commit msg
sleepyStick 8aaf791
add / fix comments
sleepyStick 413b463
check=True, catch error instead
sleepyStick 75ddd14
Merge branch 'master' into PYTHON-5253
sleepyStick 1a3d87f
multiple patch files
sleepyStick 4f3cb61
update contributing to explain patch files
sleepyStick ec50aff
Update CONTRIBUTING.md
sleepyStick 579c194
explain what syncing is, add example, and modify spacing
sleepyStick 8c943e3
Update CONTRIBUTING.md
sleepyStick d6347e0
each patch file is for a ticket now
sleepyStick 1dc4e26
move patching logic into python script
sleepyStick 1d2cfff
not merged yet, but adding this for future
sleepyStick c6030a2
fix lint
sleepyStick 391a3f9
drivers tools is cloned elsewhere, no need to clone again
sleepyStick 734b3fa
rename patch -> spec-patch
sleepyStick f45fd46
rename create-pr -> create-spec-pr
sleepyStick 87d73cc
allow scripts to be run locally
sleepyStick 1c901c7
Update CONTRIBUTING.md
sleepyStick 380adbb
remove unnecessary logic
sleepyStick 7897afb
Merge branch 'master' into PYTHON-5253
sleepyStick 92501a6
Update CONTRIBUTING.md
sleepyStick 49b0b40
Update CONTRIBUTING.md
sleepyStick 38f6ab9
Update CONTRIBUTING.md
sleepyStick 8938aa3
Update CONTRIBUTING.md
sleepyStick 7feb336
Update CONTRIBUTING.md
sleepyStick 0629bf9
Update CONTRIBUTING.md
sleepyStick 98c471c
Update CONTRIBUTING.md
sleepyStick 8108e98
Update CONTRIBUTING.md
sleepyStick 2c33abd
remove unnecessary exits
sleepyStick 02460d3
Merge branch 'PYTHON-5253' of https://github.com/sleepyStick/mongo-py…
sleepyStick 51f2a3f
move rm logging dir back to resync-spec
sleepyStick 6bbf102
add a comment for future
sleepyStick fcc294c
add exits back for spellcheck linting
sleepyStick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/test/bson_corpus/datetime.json b/test/bson_corpus/datetime.json | ||
index f857afdc..1554341d 100644 | ||
--- a/test/bson_corpus/datetime.json | ||
+++ b/test/bson_corpus/datetime.json | ||
@@ -24,6 +24,7 @@ | ||
{ | ||
"description" : "Y10K", | ||
"canonical_bson" : "1000000009610000DC1FD277E6000000", | ||
+ "relaxed_extjson" : "{\"a\":{\"$date\":{\"$numberLong\":\"253402300800000\"}}}", | ||
"canonical_extjson" : "{\"a\":{\"$date\":{\"$numberLong\":\"253402300800000\"}}}" | ||
}, | ||
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/test/connection_monitoring/pool-create-min-size-error.json b/test/connection_monitoring/pool-create-min-size-error.json | ||
index 1c744b85..509b2a23 100644 | ||
--- a/test/connection_monitoring/pool-create-min-size-error.json | ||
+++ b/test/connection_monitoring/pool-create-min-size-error.json | ||
@@ -49,15 +49,15 @@ | ||
"type": "ConnectionCreated", | ||
"address": 42 | ||
}, | ||
+ { | ||
+ "type": "ConnectionPoolCleared", | ||
+ "address": 42 | ||
+ }, | ||
{ | ||
"type": "ConnectionClosed", | ||
"address": 42, | ||
"connectionId": 42, | ||
"reason": "error" | ||
- }, | ||
- { | ||
- "type": "ConnectionPoolCleared", | ||
- "address": 42 | ||
} | ||
], | ||
"ignore": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
diff --git a/test/gridfs/delete.json b/test/gridfs/delete.json | ||
index 277b9ed7..9a9b22fc 100644 | ||
--- a/test/gridfs/delete.json | ||
+++ b/test/gridfs/delete.json | ||
@@ -497,7 +497,7 @@ | ||
} | ||
}, | ||
"expectError": { | ||
- "isError": true | ||
+ "isClientError": true | ||
} | ||
} | ||
], | ||
@@ -650,7 +650,7 @@ | ||
} | ||
}, | ||
"expectError": { | ||
- "isError": true | ||
+ "isClientError": true | ||
} | ||
} | ||
], | ||
diff --git a/test/gridfs/download.json b/test/gridfs/download.json | ||
index f0cb8517..67658ac5 100644 | ||
--- a/test/gridfs/download.json | ||
+++ b/test/gridfs/download.json | ||
@@ -338,7 +338,7 @@ | ||
} | ||
}, | ||
"expectError": { | ||
- "isError": true | ||
+ "isClientError": true | ||
} | ||
} | ||
] | ||
@@ -370,7 +370,7 @@ | ||
} | ||
}, | ||
"expectError": { | ||
- "isError": true | ||
+ "isClientError": true | ||
} | ||
} | ||
] | ||
@@ -402,7 +402,7 @@ | ||
} | ||
}, | ||
"expectError": { | ||
- "isError": true | ||
+ "isClientError": true | ||
} | ||
} | ||
] | ||
@@ -471,7 +471,7 @@ | ||
} | ||
}, | ||
"expectError": { | ||
- "isError": true | ||
+ "isClientError": true | ||
} | ||
} | ||
] | ||
@@ -514,7 +514,7 @@ | ||
} | ||
}, | ||
"expectError": { | ||
- "isError": true | ||
+ "isClientError": true | ||
} | ||
} | ||
] | ||
diff --git a/test/gridfs/downloadByName.json b/test/gridfs/downloadByName.json | ||
index 7b20933c..45abaf7b 100644 | ||
--- a/test/gridfs/downloadByName.json | ||
+++ b/test/gridfs/downloadByName.json | ||
@@ -290,7 +290,7 @@ | ||
"filename": "xyz" | ||
}, | ||
"expectError": { | ||
- "isError": true | ||
+ "isClientError": true | ||
} | ||
} | ||
] | ||
@@ -306,7 +306,7 @@ | ||
"revision": 999 | ||
}, | ||
"expectError": { | ||
- "isError": true | ||
+ "isClientError": true | ||
} | ||
} | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
diff --git a/test/sessions/driver-sessions-dirty-session-errors.json b/test/sessions/driver-sessions-dirty-session-errors.json | ||
index 6aa1da1d..d7a1c6ab 100644 | ||
--- a/test/sessions/driver-sessions-dirty-session-errors.json | ||
+++ b/test/sessions/driver-sessions-dirty-session-errors.json | ||
@@ -347,7 +347,9 @@ | ||
"x": 1 | ||
} | ||
}, | ||
- "new": false, | ||
+ "new": { | ||
+ "$$unsetOrMatches": false | ||
+ }, | ||
"lsid": { | ||
"$$sessionLsid": "session0" | ||
}, | ||
@@ -375,7 +377,9 @@ | ||
"x": 1 | ||
} | ||
}, | ||
- "new": false, | ||
+ "new": { | ||
+ "$$unsetOrMatches": false | ||
+ }, | ||
"lsid": { | ||
"$$sessionLsid": "session0" | ||
}, | ||
@@ -627,7 +631,9 @@ | ||
"x": 1 | ||
} | ||
}, | ||
- "new": false, | ||
+ "new": { | ||
+ "$$unsetOrMatches": false | ||
+ }, | ||
"lsid": { | ||
"$$type": "object" | ||
}, | ||
@@ -655,7 +661,9 @@ | ||
"x": 1 | ||
} | ||
}, | ||
- "new": false, | ||
+ "new": { | ||
+ "$$unsetOrMatches": false | ||
+ }, | ||
"lsid": { | ||
"$$type": "object" | ||
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
PYMONGO=$(dirname "$(cd "$(dirname "$0")" || exit; pwd)") | ||
|
||
rm -rf $PYMONGO/test/server_selection/logging | ||
rm $PYMONGO/test/transactions/legacy/errors-client.json # PYTHON-1894 | ||
rm $PYMONGO/test/connection_monitoring/wait-queue-fairness.json # PYTHON-1873 | ||
rm $PYMONGO/test/client-side-encryption/spec/unified/fle2v2-BypassQueryAnalysis.json # PYTHON-5143 | ||
rm $PYMONGO/test/client-side-encryption/spec/unified/fle2v2-EncryptedFields-vs-EncryptedFieldsMap.json # PYTHON-5143 | ||
rm $PYMONGO/test/client-side-encryption/spec/unified/localSchema.json # PYTHON-5143 | ||
rm $PYMONGO/test/client-side-encryption/spec/unified/maxWireVersion.json # PYTHON-5143 | ||
rm $PYMONGO/test/unified-test-format/valid-pass/poc-queryable-encryption.json # PYTHON-5143 | ||
rm $PYMONGO/test/gridfs/rename.json # PYTHON-4931 | ||
rm $PYMONGO/test/discovery_and_monitoring/unified/pool-clear-application-error.json # PYTHON-4918 | ||
rm $PYMONGO/test/discovery_and_monitoring/unified/pool-clear-checkout-error.json # PYTHON-4918 | ||
rm $PYMONGO/test/discovery_and_monitoring/unified/pool-clear-min-pool-size-error.json # PYTHON-4918 | ||
|
||
# Python doesn't implement DRIVERS-3064 | ||
rm $PYMONGO/test/collection_management/listCollections-rawdata.json | ||
rm $PYMONGO/test/crud/unified/aggregate-rawdata.json | ||
rm $PYMONGO/test/crud/unified/bulkWrite-deleteMany-rawdata.json | ||
rm $PYMONGO/test/crud/unified/bulkWrite-deleteOne-rawdata.json | ||
rm $PYMONGO/test/crud/unified/bulkWrite-replaceOne-rawdata.json | ||
rm $PYMONGO/test/crud/unified/bulkWrite-updateMany-rawdata.json | ||
rm $PYMONGO/test/crud/unified/bulkWrite-updateOne-rawdata.json | ||
rm $PYMONGO/test/crud/unified/client-bulkWrite-delete-rawdata.json | ||
rm $PYMONGO/test/crud/unified/client-bulkWrite-replaceOne-rawdata.json | ||
rm $PYMONGO/test/crud/unified/client-bulkWrite-update-rawdata.json | ||
rm $PYMONGO/test/crud/unified/count-rawdata.json | ||
rm $PYMONGO/test/crud/unified/countDocuments-rawdata.json | ||
rm $PYMONGO/test/crud/unified/db-aggregate-rawdata.json | ||
rm $PYMONGO/test/crud/unified/deleteMany-rawdata.json | ||
rm $PYMONGO/test/crud/unified/deleteOne-rawdata.json | ||
rm $PYMONGO/test/crud/unified/distinct-rawdata.json | ||
rm $PYMONGO/test/crud/unified/estimatedDocumentCount-rawdata.json | ||
rm $PYMONGO/test/crud/unified/find-rawdata.json | ||
rm $PYMONGO/test/crud/unified/findOneAndDelete-rawdata.json | ||
rm $PYMONGO/test/crud/unified/findOneAndReplace-rawdata.json | ||
rm $PYMONGO/test/crud/unified/findOneAndUpdate-rawdata.json | ||
rm $PYMONGO/test/crud/unified/insertMany-rawdata.json | ||
rm $PYMONGO/test/crud/unified/insertOne-rawdata.json | ||
rm $PYMONGO/test/crud/unified/replaceOne-rawdata.json | ||
rm $PYMONGO/test/crud/unified/updateMany-rawdata.json | ||
rm $PYMONGO/test/crud/unified/updateOne-rawdata.json | ||
rm $PYMONGO/test/index_management/index-rawdata.json | ||
|
||
echo "done removing unimplemented tests" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,9 +45,12 @@ then | |
fi | ||
|
||
# Ensure the JSON files are up to date. | ||
cd $SPECS/source | ||
make | ||
cd - | ||
if ! [ -n "${CI:-}" ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CI is always defined in an EVG run and we only want to run these things in a local checkout. |
||
then | ||
cd $SPECS/source | ||
make | ||
cd - | ||
fi | ||
# cpjson unified-test-format/tests/invalid unified-test-format/invalid | ||
# * param1: Path to spec tests dir in specifications repo | ||
# * param2: Path to where the corresponding tests live in Python. | ||
|
@@ -110,7 +113,6 @@ do | |
cmap|CMAP|connection-monitoring-and-pooling) | ||
cpjson connection-monitoring-and-pooling/tests/logging connection_logging | ||
cpjson connection-monitoring-and-pooling/tests/cmap-format connection_monitoring | ||
rm $PYMONGO/test/connection_monitoring/wait-queue-fairness.json # PYTHON-1873 | ||
;; | ||
apm|APM|command-monitoring|command_monitoring) | ||
cpjson command-logging-and-monitoring/tests/monitoring command_monitoring | ||
|
@@ -174,7 +176,6 @@ do | |
;; | ||
server-selection|server_selection) | ||
cpjson server-selection/tests/ server_selection | ||
rm -rf $PYMONGO/test/server_selection/logging | ||
cpjson server-selection/tests/logging server_selection_logging | ||
;; | ||
server-selection-logging|server_selection_logging) | ||
|
@@ -186,7 +187,6 @@ do | |
transactions|transactions-convenient-api) | ||
cpjson transactions/tests/ transactions | ||
cpjson transactions-convenient-api/tests/ transactions-convenient-api | ||
rm $PYMONGO/test/transactions/legacy/errors-client.json # PYTHON-1894 | ||
;; | ||
unified|unified-test-format) | ||
cpjson unified-test-format/tests/ unified-test-format/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
blink1073 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
tools="$(realpath -s "../drivers-tools")" | ||
pushd $tools/.evergreen/github_app || exit | ||
|
||
owner="mongodb" | ||
repo="mongo-python-driver" | ||
|
||
# Bootstrap the app. | ||
echo "bootstrapping" | ||
source utils.sh | ||
bootstrap drivers/comment-bot | ||
|
||
# Run the app. | ||
source ./secrets-export.sh | ||
|
||
# Get a github access token for the git checkout. | ||
echo "Getting github token..." | ||
|
||
token=$(bash ./get-access-token.sh $repo $owner) | ||
if [ -z "${token}" ]; then | ||
echo "Failed to get github access token!" | ||
popd || exit | ||
exit 1 | ||
fi | ||
echo "Getting github token... done." | ||
popd || exit | ||
|
||
# Make the git checkout and create a new branch. | ||
echo "Creating the git checkout..." | ||
branch="spec-resync-"$(date '+%m-%d-%Y') | ||
|
||
git remote set-url origin https://x-access-token:${token}@github.com/$owner/$repo.git | ||
git checkout -b $branch "origin/master" | ||
git add ./test | ||
git commit -am "resyncing specs $(date '+%m-%d-%Y')" | ||
echo "Creating the git checkout... done." | ||
|
||
git push origin $branch | ||
resp=$(curl -L \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $token" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
-d "{\"title\":\"[Spec Resync] $(date '+%m-%d-%Y')\",\"body\":\"$(cat "$1")\",\"head\":\"${branch}\",\"base\":\"master\"}" \ | ||
--url https://api.github.com/repos/$owner/$repo/pulls) | ||
echo $resp | jq '.html_url' | ||
echo "Creating the PR... done." | ||
|
||
rm -rf $tools |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a comment explaining why we remove this directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took this line from
resync-spec.sh
(moved it here for consistency) but there was no comment inresync-spec.sh
for why its removed..do you happen to know why?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We put those tests in
test/server_selection_logging
instead.