Skip to content

Commit 2609ac2

Browse files
committed
run all test apps on CI
1 parent 5c29684 commit 2609ac2

File tree

3 files changed

+185
-1
lines changed

3 files changed

+185
-1
lines changed

.github/workflows/test-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
aggregation
6868
aggregation_regress
6969
annotations
70-
auth_tests.test_models.UserManagerTestCase
70+
auth_tests
7171
backends
7272
basic
7373
bulk_create

.github/workflows/test-python1.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: Python Tests II
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
concurrency:
8+
group: tests1-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
defaults:
12+
run:
13+
shell: bash -eux {0}
14+
15+
jobs:
16+
17+
lint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.10'
24+
cache: 'pip'
25+
cache-dependency-path: 'pyproject.toml'
26+
- name: Install Python dependencies
27+
run: |
28+
python -m pip install -U pip pre-commit
29+
- name: Run linters
30+
run: |
31+
pre-commit run --hook-stage=manual --all-files
32+
33+
build:
34+
name: Django Test Suite
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout django-mongodb
38+
uses: actions/checkout@v4
39+
- name: install the django-mongodb backend
40+
run: |
41+
pip3 install --upgrade pip
42+
pip3 install -e .
43+
- name: Checkout Django
44+
uses: actions/checkout@v4
45+
with:
46+
repository: 'mongodb-forks/django'
47+
ref: 'mongodb-5.0.x'
48+
path: 'django_repo'
49+
- name: Install system packages for Django's Python test dependencies
50+
run: |
51+
sudo apt-get update
52+
sudo apt-get install libmemcached-dev
53+
- name: Install Django and its Python test dependencies
54+
run: |
55+
cd django_repo/tests/
56+
pip3 install -e ..
57+
pip3 install -r requirements/py3.txt
58+
- name: Copy the test settings file
59+
run: cp .github/workflows/mongodb_settings.py django_repo/tests/
60+
- name: Start MongoDB
61+
uses: supercharge/[email protected]
62+
with:
63+
mongodb-version: 5.0
64+
- name: Run tests
65+
run: >
66+
python3 django_repo/tests/runtests.py --settings mongodb_settings -v 2
67+
admin_checks
68+
admin_custom_urls
69+
admin_docs
70+
admin_ordering
71+
admin_scripts
72+
admin_utils
73+
admin_widgets
74+
check_framework
75+
context_processors
76+
custom_columns
77+
custom_managers
78+
datatypes
79+
dbshell
80+
empty_models
81+
file_uploads
82+
flatpages_tests
83+
forms_tests
84+
generic_inline_admin
85+
get_earliest_or_latest
86+
get_object_or_404
87+
get_or_create
88+
i18n
89+
inline_formsets
90+
managers_regress
91+
managers_regress
92+
max_lengths
93+
messages_tests
94+
migrate_signals
95+
migration_test_data_persistence
96+
model_formsets
97+
model_formsets_regress
98+
model_indexes
99+
model_inheritance_regress
100+
model_options
101+
model_package
102+
model_regress
103+
model_utils
104+
multiple_database
105+
order_with_respect_to
106+
pagination
107+
properties
108+
proxy_models
109+
redirects_tests
110+
reserved_names
111+
reverse_lookup
112+
save_delete_hooks
113+
signals
114+
sites_framework
115+
sites_tests
116+
str
117+
string_lookup
118+
swappable_models
119+
test_client
120+
test_client_regress
121+
test_runner
122+
test_utils
123+
unmanaged_models
124+
update_only_fields
125+
user_commands
126+
view_tests
127+
128+
docs:
129+
name: Docs Checks
130+
runs-on: ubuntu-latest
131+
steps:
132+
- uses: actions/checkout@v4
133+
- uses: actions/setup-python@v5
134+
with:
135+
cache: 'pip'
136+
cache-dependency-path: 'pyproject.toml'
137+
python-version: '3.10'
138+
- name: Install dependencies
139+
run: |
140+
pip install -U pip
141+
pip install -e ".[docs]"
142+
- name: Build docs
143+
run: |
144+
cd docs
145+
make html

django_mongodb/features.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ class DatabaseFeatures(BaseDatabaseFeatures):
117117
# subclasses of BaseDatabaseIntrospection may require a get_constraints() method
118118
"migrations.test_operations.OperationTests.test_add_func_unique_constraint",
119119
"migrations.test_operations.OperationTests.test_remove_func_unique_constraint",
120+
# Object of type ObjectId is not JSON serializable
121+
"auth_tests.test_views.LoginTest.test_login_session_without_hash_session_key",
122+
# To investigate:
123+
"custom_managers.tests.CustomManagersRegressTestCase.test_save_clears_annotations_from_base_manager",
124+
"model_formsets.tests.ModelFormsetTest.test_inline_formsets_with_custom_save_method",
125+
# SchemaEditor doesn't collect:
126+
# https://github.com/mongodb-labs/django-mongodb/issues/141
127+
"model_options.test_tablespaces.TablespacesTests.test_tablespace_ignored_for_indexed_field",
128+
"model_options.test_tablespaces.TablespacesTests.test_tablespace_ignored_for_model",
120129
}
121130
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
122131
_django_test_expected_failures_bitwise = {
@@ -233,6 +242,7 @@ def django_test_expected_failures(self):
233242
"queries.test_qs_combinators.QuerySetSetOperationTests.test_order_raises_on_non_selected_column",
234243
},
235244
"Exists is not supported on MongoDB.": {
245+
"admin_widgets.tests.AdminForeignKeyRawIdWidget.test_nonexistent_target_id",
236246
"aggregation.test_filter_argument.FilteredAggregateTests.test_filtered_aggregate_on_exists",
237247
"aggregation.test_filter_argument.FilteredAggregateTests.test_filtered_aggregate_ref_multiple_subquery_annotation",
238248
"aggregation.tests.AggregateTestCase.test_aggregation_exists_multivalued_outeref",
@@ -242,6 +252,8 @@ def django_test_expected_failures(self):
242252
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_exists_aggregate_values_chaining",
243253
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_exists_none_query",
244254
"aggregation_regress.tests.AggregationTests.test_annotate_and_join",
255+
"auth_tests.test_models.UserWithPermTestCase.test_basic",
256+
"auth_tests.test_models.UserWithPermTestCase.test_nonexistent_permission",
245257
"delete_regress.tests.DeleteTests.test_self_reference_with_through_m2m_at_second_level",
246258
"expressions.tests.BasicExpressionsTests.test_annotation_with_deeply_nested_outerref",
247259
"expressions.tests.BasicExpressionsTests.test_boolean_expression_combined",
@@ -347,12 +359,20 @@ def django_test_expected_failures(self):
347359
"aggregation_regress.tests.AggregationTests.test_more_more4",
348360
"aggregation_regress.tests.AggregationTests.test_more_more_more5",
349361
"aggregation_regress.tests.AggregationTests.test_negated_aggregation",
362+
"custom_managers.tests.CustomManagerTests.test_removal_through_default_m2m_related_manager",
363+
"custom_managers.tests.CustomManagerTests.test_removal_through_specified_m2m_related_manager",
350364
"db_functions.comparison.test_coalesce.CoalesceTests.test_empty_queryset",
351365
"expressions.tests.FTimeDeltaTests.test_date_subquery_subtraction",
352366
"expressions.tests.FTimeDeltaTests.test_datetime_subquery_subtraction",
353367
"expressions.tests.FTimeDeltaTests.test_time_subquery_subtraction",
354368
"expressions_case.tests.CaseExpressionTests.test_annotate_with_in_clause",
355369
"expressions_case.tests.CaseExpressionTests.test_in_subquery",
370+
"flatpages_tests.test_forms.FlatpageAdminFormTests.test_flatpage_admin_form_edit",
371+
"flatpages_tests.test_forms.FlatpageAdminFormTests.test_flatpage_admin_form_url_uniqueness_validation",
372+
"flatpages_tests.test_forms.FlatpageAdminFormTests.test_flatpage_admin_form_url_validation",
373+
"flatpages_tests.test_forms.FlatpageAdminFormTests.test_flatpage_doesnt_requires_trailing_slash_without_append_slash",
374+
"flatpages_tests.test_forms.FlatpageAdminFormTests.test_flatpage_requires_leading_slash",
375+
"flatpages_tests.test_forms.FlatpageAdminFormTests.test_flatpage_requires_trailing_slash_with_append_slash",
356376
"lookup.tests.LookupTests.test_exact_query_rhs_with_selected_columns",
357377
"lookup.tests.LookupTests.test_exact_sliced_queryset_limit_one",
358378
"lookup.tests.LookupTests.test_exact_sliced_queryset_limit_one_offset",
@@ -366,8 +386,12 @@ def django_test_expected_failures(self):
366386
"many_to_many.tests.ManyToManyTests.test_set_existing_different_type",
367387
"many_to_one.tests.ManyToOneTests.test_get_prefetch_queryset_reverse_warning",
368388
"model_fields.test_jsonfield.TestQuerying.test_usage_in_subquery",
389+
"model_inheritance_regress.tests.ModelInheritanceTest.test_filter_with_parent_fk",
390+
"multiple_database.tests.QueryTestCase.test_subquery",
391+
"multiple_database.tests.RouterTestCase.test_subquery",
369392
"one_to_one.tests.OneToOneTests.test_get_prefetch_queryset_warning",
370393
"one_to_one.tests.OneToOneTests.test_rel_pk_subquery",
394+
"order_with_respect_to.tests.OrderWithRespectToBaseTests.test_previous_and_next_in_order",
371395
"queries.test_qs_combinators.QuerySetSetOperationTests.test_union_in_with_ordering",
372396
"queries.tests.CloneTests.test_evaluated_queryset_as_argument",
373397
"queries.tests.DoubleInSubqueryTests.test_double_subquery_in",
@@ -402,6 +426,7 @@ def django_test_expected_failures(self):
402426
"one_to_one.tests.OneToOneTests.test_o2o_primary_key_delete",
403427
},
404428
"Cannot use QuerySet.update() when querying across multiple collections on MongoDB.": {
429+
"custom_managers.tests.CustomManagersRegressTestCase.test_refresh_from_db_when_default_manager_filters",
405430
"expressions.tests.BasicExpressionsTests.test_filter_with_join",
406431
"queries.tests.Queries4Tests.test_ticket7095",
407432
"queries.tests.Queries5Tests.test_ticket9848",
@@ -416,6 +441,8 @@ def django_test_expected_failures(self):
416441
"backends.tests.DateQuotingTest.test_django_date_trunc",
417442
"dates.tests.DatesTests.test_dates_trunc_datetime_fields",
418443
"dates.tests.DatesTests.test_related_model_traverse",
444+
"model_regress.tests.ModelTests.test_date_filter_null",
445+
"reserved_names.tests.ReservedNameTests.test_dates",
419446
"many_to_one.tests.ManyToOneTests.test_select_related",
420447
},
421448
"QuerySet.datetimes() is not supported on MongoDB.": {
@@ -424,6 +451,7 @@ def django_test_expected_failures(self):
424451
"datetimes.tests.DateTimesTests.test_datetimes_has_lazy_iterator",
425452
"datetimes.tests.DateTimesTests.test_datetimes_returns_available_dates_for_given_scope_and_given_field",
426453
"datetimes.tests.DateTimesTests.test_related_model_traverse",
454+
"model_inheritance_regress.tests.ModelInheritanceTest.test_issue_7105",
427455
"queries.tests.Queries1Tests.test_ticket7155",
428456
"queries.tests.Queries1Tests.test_tickets_7087_12242",
429457
"timezones.tests.LegacyDatabaseTests.test_query_datetimes",
@@ -464,6 +492,7 @@ def django_test_expected_failures(self):
464492
"basic.tests.ModelTest.test_extra_method_select_argument_with_dashes_and_values",
465493
"defer.tests.DeferTests.test_defer_extra",
466494
"delete_regress.tests.Ticket19102Tests.test_ticket_19102_extra",
495+
"extra_regress.tests.ExtraRegressTests",
467496
"lookup.tests.LookupTests.test_values",
468497
"lookup.tests.LookupTests.test_values_list",
469498
"many_to_one.tests.ManyToOneTests.test_selects",
@@ -520,6 +549,7 @@ def django_test_expected_failures(self):
520549
"backends.tests.BackendTestCase.test_unicode_fetches",
521550
"backends.tests.EscapingChecks",
522551
"backends.test_utils.CursorWrapperTests",
552+
"custom_methods.tests.MethodsTests.test_custom_methods",
523553
"delete_regress.tests.DeleteLockingTest.test_concurrent_delete",
524554
"expressions.tests.BasicExpressionsTests.test_annotate_values_filter",
525555
"expressions.tests.BasicExpressionsTests.test_filtering_on_rawsql_that_is_boolean",
@@ -532,7 +562,9 @@ def django_test_expected_failures(self):
532562
"model_fields.test_jsonfield.TestQuerying.test_key_sql_injection_escape",
533563
"model_fields.test_jsonfield.TestQuerying.test_key_transform_raw_expression",
534564
"model_fields.test_jsonfield.TestQuerying.test_nested_key_transform_raw_expression",
565+
"multiple_database.tests.QueryTestCase.test_raw",
535566
"queries.tests.Queries1Tests.test_order_by_rawsql",
567+
"raw_query.tests.RawQueryTests",
536568
"schema.test_logging.SchemaLoggerTests.test_extra_args",
537569
"schema.tests.SchemaTests.test_remove_constraints_capital_letters",
538570
"timezones.tests.LegacyDatabaseTests.test_cursor_execute_accepts_naive_datetime",
@@ -542,6 +574,7 @@ def django_test_expected_failures(self):
542574
"timezones.tests.NewDatabaseTests.test_cursor_execute_returns_naive_datetime",
543575
"timezones.tests.NewDatabaseTests.test_cursor_explicit_time_zone",
544576
"timezones.tests.NewDatabaseTests.test_raw_sql",
577+
"view_tests.tests.test_debug.DebugViewQueriesAllowedTests.test_handle_db_exception",
545578
},
546579
"Custom aggregations/functions with SQL don't work on MongoDB.": {
547580
"aggregation.tests.AggregateTestCase.test_add_implementation",
@@ -679,6 +712,12 @@ def django_test_expected_failures(self):
679712
"migrations.test_commands.MigrateTests.test_sqlmigrate_replaced_migration",
680713
"migrations.test_commands.MigrateTests.test_sqlmigrate_squashed_migration",
681714
},
715+
"Disallowed queries feature doesn't work.": {
716+
# https://github.com/django/django/commit/f5b635086a07c9df5897e69685ebdc3a04049ec6
717+
"test_utils.test_testcase.TestTestCase.test_disallowed_database_queries",
718+
"test_utils.test_transactiontestcase.DisallowedDatabaseQueriesTests",
719+
"test_utils.tests.DisallowedDatabaseQueriesTests",
720+
},
682721
}
683722

684723
@cached_property

0 commit comments

Comments
 (0)