Skip to content
Merged
2 changes: 1 addition & 1 deletion .evergreen/remove-unimplemented-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ rm $PYMONGO/test/index_management/index-rawdata.json
rm $PYMONGO/test/collection_management/modifyCollection-*.json

# PYTHON-5248 - Remove support for MongoDB 4.0
rm $PYMONGO/test/**/pre-42-*.json
find /$PYMONGO /test -type f -name 'pre-42-*.json' -delete

# PYTHON-3359 - Remove Database and Collection level timeout override
rm $PYMONGO/test/csot/override-collection-timeoutMS.json
Expand Down
20 changes: 12 additions & 8 deletions .evergreen/scripts/resync-all-specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@ def resync_specs(directory: pathlib.Path, errored: dict[str, str]) -> None:
print("Done syncing specs")


def apply_patches():
def apply_patches(errored):
print("Beginning to apply patches")
subprocess.run(["bash", "./.evergreen/remove-unimplemented-tests.sh"], check=True) # noqa: S603, S607
subprocess.run(
["git apply -R --allow-empty --whitespace=fix ./.evergreen/spec-patch/*"], # noqa: S607
shell=True, # noqa: S602
check=True,
)
try:
subprocess.run(
["git apply -R --allow-empty --whitespace=fix ./.evergreen/spec-patch/*"], # noqa: S607
shell=True, # noqa: S602
check=True,
stderr=subprocess.PIPE,
)
except CalledProcessError as exc:
errored["applying patches"] = exc.stderr


def check_new_spec_directories(directory: pathlib.Path) -> list[str]:
Expand Down Expand Up @@ -85,7 +89,7 @@ def write_summary(errored: dict[str, str], new: list[str], filename: Optional[st
pr_body += "\n -".join(succeeded)
pr_body += "\n"
if len(errored) > 0:
pr_body += "\n\nThe following spec syncs encountered errors:\n -"
pr_body += "\n\nThe following spec syncs encountered errors:"
for k, v in errored.items():
pr_body += f"\n -{k}\n```{v}\n```"
pr_body += "\n"
Expand All @@ -106,7 +110,7 @@ def main(args: Namespace):
directory = pathlib.Path("./test")
errored: dict[str, str] = {}
resync_specs(directory, errored)
apply_patches()
apply_patches(errored)
new = check_new_spec_directories(directory)
write_summary(errored, new, args.filename)

Expand Down
1 change: 1 addition & 0 deletions .evergreen/scripts/resync-all-specs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Run spec syncing script and create PR
set -eu
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this should make errors more visible to us


# SETUP
SRC_URL="https://github.com/mongodb/specifications.git"
Expand Down
10 changes: 5 additions & 5 deletions .evergreen/spec-patch/PYTHON-3712.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
diff --git a/test/discovery_and_monitoring/unified/serverMonitoringMode.json b/test/discovery_and_monitoring/unified/serverMonitoringMode.json
index 4b492f7d8..e44fad1bc 100644
index e44fad1b..4b492f7d 100644
--- a/test/discovery_and_monitoring/unified/serverMonitoringMode.json
+++ b/test/discovery_and_monitoring/unified/serverMonitoringMode.json
@@ -5,8 +5,7 @@
@@ -5,7 +5,8 @@
{
"topologies": [
"single",
+ "sharded"
- "sharded",
- "sharded-replicaset"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already did this ticket but for whatever reason the spec repo still has this one instance of sharded-replicaset so we're applying this patch to keep it out of our tests. (I've made a comment on the drivers ticket asking why its still in the spec repo)

- "sharded"
+ "sharded",
+ "sharded-replicaset"
],
"serverless": "forbid"
}
Loading
Loading