Skip to content

Commit 194b280

Browse files
committed
test(native): assert exact seeded SQL-test assembly counts and deferrals
1 parent 4182487 commit 194b280

2 files changed

Lines changed: 13 additions & 18 deletions

File tree

‎tests/integration/src/sqlbuild/compiler/sql_test_glue/_test_types.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,4 @@ class GeneratedSqlTestAssemblyParityTestCase:
3333
count: int
3434
test_count: int
3535
shape: SqlTestCorpusShape
36-
expected_minimum_native_assembled: int
37-
expected_minimum_native_with_diagnostics: int
38-
expected_minimum_native_case_fingerprints: int
39-
expected_minimum_deferred_macro_mocks: int
36+
expected_native_assemblies: dict[str, int]

‎tests/integration/src/sqlbuild/compiler/sql_test_glue/test_native_sql_test_planning_glue.py‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,14 @@ def test_given_generated_sql_tests_when_planning_natively_then_plans_match_the_j
193193
assertion_share=0.2,
194194
unflattenable_assertion_share=0.1,
195195
),
196-
expected_minimum_native_assembled=150,
197-
expected_minimum_native_with_diagnostics=13,
198-
expected_minimum_native_case_fingerprints=80,
199-
expected_minimum_deferred_macro_mocks=3,
196+
expected_native_assemblies={
197+
"native_assembled": 181,
198+
"native_with_diagnostics": 17,
199+
"native_case_fingerprints": 96,
200+
"deferred_macro_mocks": 4,
201+
"deferred_non_ascii_text": 11,
202+
"deferred_decimal_context": 5,
203+
},
200204
)
201205
],
202206
ids=lambda case: case.description,
@@ -227,13 +231,7 @@ def test_given_generated_sql_tests_when_assembling_natively_then_compiled_tests_
227231
differences.extend(mismatches(inputs=[index], expected=[expected], actual=[actual]))
228232
outcomes[outcome_kind(actual)] += 1
229233

230-
assert (
231-
differences,
232-
native_assemblies["native_assembled"] >= test_case.expected_minimum_native_assembled,
233-
native_assemblies["native_with_diagnostics"]
234-
>= test_case.expected_minimum_native_with_diagnostics,
235-
native_assemblies["native_case_fingerprints"]
236-
>= test_case.expected_minimum_native_case_fingerprints,
237-
native_assemblies["deferred_macro_mocks"]
238-
>= test_case.expected_minimum_deferred_macro_mocks,
239-
) == ([], True, True, True, True), (native_assemblies, outcomes)
234+
assert (differences, dict(native_assemblies)) == (
235+
[],
236+
test_case.expected_native_assemblies,
237+
), outcomes

0 commit comments

Comments
 (0)