PyDABs: deterministic unit-test generation [WIP] - #6421
Draft
Sankalp-Mittal wants to merge 5 commits into
Draft
Conversation
Collaborator
Integration test reportCommit: 055d41f
Top 3 slowest tests (at least 2 minutes):
|
Sankalp-Mittal
force-pushed
the
sankalp-mittal/pydabs-gen-unit-tests
branch
from
August 28, 2026 11:29
969719d to
b3279da
Compare
Sankalp-Mittal
force-pushed
the
sankalp-mittal/pydabs-autogen-wiring
branch
from
August 28, 2026 12:35
1def02a to
d385c7f
Compare
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
force-pushed
the
sankalp-mittal/pydabs-gen-unit-tests
branch
from
August 28, 2026 12:40
4491087 to
055d41f
Compare
Sankalp-Mittal
force-pushed
the
sankalp-mittal/pydabs-autogen-wiring
branch
2 times, most recently
from
August 28, 2026 14:31
6feddc6 to
cfeb0a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.