Skip to content

Commit 8205175

Browse files
committed
[temp] isolate replica tests
1 parent 000f2cf commit 8205175

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/test-python-replica.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ jobs:
5555
mongodb-version: 6.0
5656
mongodb-replica-set: test-rs
5757
- name: Run tests
58-
run: python3 django_repo/tests/runtests.py --settings mongodb_settings -v 2
58+
run: python3 django_repo/tests/runtests_.py

django_mongodb_backend/features.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ class DatabaseFeatures(BaseDatabaseFeatures):
9696
"expressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_xor_right_null",
9797
"expressions.tests.ExpressionOperatorTests.test_lefthand_transformed_field_bitwise_or",
9898
}
99+
_django_test_expected_failures_transactions = {
100+
# When get_or_create() fails with IntegrityError, the transaction is no longer usable.
101+
"get_or_create.tests.UpdateOrCreateTests.test_manual_primary_key_test",
102+
"get_or_create.tests.UpdateOrCreateTestsWithManualPKs.test_create_with_duplicate_primary_key",
103+
# To investigate (some difference between dbs that do and don't support
104+
# savepoints, most likely):
105+
"test_utils.test_testcase.TestDataTests.test_class_attribute_identity",
106+
"test_utils.tests.CaptureOnCommitCallbacksTests.test_with_rolled_back_savepoint",
107+
}
99108

100109
@cached_property
101110
def supports_transactions(self):
@@ -125,6 +134,8 @@ def django_test_expected_failures(self):
125134
expected_failures.update(self._django_test_expected_failures)
126135
if not self.is_mongodb_6_3:
127136
expected_failures.update(self._django_test_expected_failures_bitwise)
137+
if self.supports_transactions:
138+
expected_failures.update(self._django_test_expected_failures_transactions)
128139
return expected_failures
129140

130141
django_test_skips = {

0 commit comments

Comments
 (0)