Skip to content

PyDABs: deterministic unit-test generation [WIP] - #6421

Draft
Sankalp-Mittal wants to merge 5 commits into
sankalp-mittal/pydabs-autogen-wiringfrom
sankalp-mittal/pydabs-gen-unit-tests
Draft

PyDABs: deterministic unit-test generation [WIP]#6421
Sankalp-Mittal wants to merge 5 commits into
sankalp-mittal/pydabs-autogen-wiringfrom
sankalp-mittal/pydabs-gen-unit-tests

Conversation

@Sankalp-Mittal

Copy link
Copy Markdown
Collaborator

No description provided.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 055d41f

Run: 33172079893

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 1 1 274 1206 4:28
💚​ aws windows 1 1 276 1204 3:34
💚​ azure linux 1 1 273 1206 4:11
💚​ azure windows 1 1 275 1204 3:33
💚​ gcp linux 1 1 274 1206 4:59
💚​ gcp windows 1 1 276 1204 3:27
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:30 aws windows TestAccept
3:29 azure windows TestAccept
3:23 gcp windows TestAccept

@Sankalp-Mittal
Sankalp-Mittal force-pushed the sankalp-mittal/pydabs-gen-unit-tests branch from 969719d to b3279da Compare August 28, 2026 11:29
@Sankalp-Mittal
Sankalp-Mittal force-pushed the sankalp-mittal/pydabs-autogen-wiring branch from 1def02a to d385c7f Compare August 28, 2026 12:35
Sankalp-Mittal and others added 5 commits August 28, 2026 12:38
Empty commit to open the stacked draft PR. Follow-up commits will generate
the per-resource test_resources.py cases (dict + dataclass examples) from the
codegen model.

Co-authored-by: Isaac <no-reply@databricks.com>
test_add_resource_type and test_add_resource_type_dict had byte-identical
bodies, both feeding dict_example, so the add_<resource>(dataclass)
normalization path went untested for the parametrized resources. Feed
dataclass_example to the non-_dict variant, mirroring test_add_job vs
test_add_job_dict.

Co-authored-by: Isaac <no-reply@databricks.com>
Stop hand-writing a TestCase per resource in test_resources.py. A new
codegen step (generated_test_cases.py, rendered from test_case.py.tmpl)
synthesizes dict_example and dataclass_example for every wired resource
from the schema model and writes one file per resource under
databricks_tests/core/_generated/, collected into test_cases. A newly
wired resource now gets its unit-test coverage for free.

dict_example and dataclass_example are rendered two independent ways from
one synthesized value tree, so the dict->dataclass _transform assertion
stays meaningful. Field policy: required fields fully expanded, plus
optional composite fields on the resource itself; nested objects
contribute only their required fields, which bounds example size and
avoids the recursive Task/ForEachTask schema. Optional scalar,
deprecated, and private-preview fields are omitted.

The hand-written TestCase dataclass moves to _resource_test_case.py so
the generated modules can import it without a cycle.

Co-authored-by: Isaac <no-reply@databricks.com>
The generator source lives outside databricks/databricks_tests, so
pydabs-codegen's targeted ruff --fix does not reach it, but the root
ruff check does. Sort imports and merge the two startswith calls into a
single tuple call. No change to generated output.

Co-authored-by: Isaac <no-reply@databricks.com>
@Sankalp-Mittal
Sankalp-Mittal force-pushed the sankalp-mittal/pydabs-gen-unit-tests branch from 4491087 to 055d41f Compare August 28, 2026 12:40
@Sankalp-Mittal
Sankalp-Mittal force-pushed the sankalp-mittal/pydabs-autogen-wiring branch 2 times, most recently from 6feddc6 to cfeb0a7 Compare August 28, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants