Skip to content

Conversation

@elprans
Copy link
Member

@elprans elprans commented Sep 2, 2025

  • models: Add the ability to generate std separately and then import it
  • Formalize server instance management a-la it is done in Gel server itself
  • Make IsolationLevel a proper enum
  • Allow running tests with geltest

@elprans elprans force-pushed the geltest branch 2 times, most recently from d9ef4fe to e13fd3c Compare September 4, 2025 17:53
The vast majority of model reflection is std, and though in a specific
schema reflection we can avoid running codegen if things did not change,
that does not help across multiple branches.

This makes it possible to

1) generate `std` separately from user/extension schema (via
   `--std-only`), and

2) import a std reflection generated earlier with
   `--source-std-from=<path>`, specifying the sourcing method
   woth `--source-std-method={copy|reexport}`.
…self

The new `gel._internal._server` is a collection of `Instance`
implementations to manage server lifecycle.  This is primarily needed
for tests.
`geltest` [1] is `edb test` extracted out of Gel server codebase and
generalized to run any `unittest`-based suite.

Notable changes here:

1. `_testbase` moved to `_internal._testbase` and broken down along
   major case types (base, models, third-party ORM);

2. Test cases that involve model generation now reuse `std` reflection
   for better `mypy` cache utilization.

3. Test models are now reflected into (.gitignored) `tests/models` and
   relative imports in tests now work consistently (so instead of
   `from models.orm import Foo` write `from .models.orm import Foo` and
   have your editor LSP pick that up.  This obviates the need to run
   `tools/gen_models.py` (which I will remove in a subsequent commit).
@elprans elprans merged commit cc842ba into master Sep 4, 2025
42 checks passed
@elprans elprans deleted the geltest branch September 4, 2025 18:39
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.

4 participants